우분투를 안쓴지 제법되었는데.. 솔직히 CensOS를 신봉하는 나로서는..

새로운 것을 지원 빨리한다. Ubuntu.. 안정적인 것을 원한다. CentOS.. 이런 형식으로 약간..

이건 뭐 제 느낌이라.


BlockChain을 개발하는 나에게 이상하게 자료를 찾다보면 Ubuntu 와 연관이 많아 다시 한번 써보려 한다.

사실 아직도 크게 신뢰 하진 않으나.. 12.04가 벌써 18.04가 되어 있었다.


각설..

Introduction

VNC, or "Virtual Network Computing", is a connection system that allows you to use your keyboard and mouse to interact with a graphical desktop environment on a remote server. It makes managing files, software, and settings on a remote server easier for users who are not yet comfortable with the command line.

In this guide, we will be setting up VNC on an Ubuntu 18.04 server and connecting to it securely through an SSH tunnel. The VNC server we will be using is TightVNC, a fast and lightweight remote control package. This choice will ensure that our VNC connection will be smooth and stable even on slower internet connections.

Prerequisites

To complete this tutorial, you'll need:

  • An Ubuntu 18.04 Droplet set up via the Ubuntu 18.04 initial server setup tutorial, which includes having a sudo non-root user. Note that this tutorial can be completed using any size Droplet, but a VNC built on a smaller droplet may have more limits on functionality than a larger one.

  • A local computer with a VNC client installed that supports VNC connections over SSH tunnels. If you are using Windows, you could use TightVNC, RealVNC, or UltraVNC. Mac OS X users can use the built-in Screen Sharing program, or can use a cross-platform app like RealVNC. Linux users can choose from many options: vinagrekrdc, RealVNC, TightVNC, and more.

Step 1 — Installing the Desktop Environment and VNC Server

By default, an Ubuntu 18.04 Droplet does not come with a graphical desktop environment or a VNC server installed, so we'll begin by installing those. Specifically, we will install packages for the latest Xfce desktop environment and the TightVNC package available in the official Ubuntu repository.

On your server, install the Xfce and TightVNC packages.

  • sudo apt-get update
  • sudo apt install xfce4 xfce4-goodies tightvncserver

To complete the VNC server's initial configuration after installation, use the vncserver command to set up a secure password.

  • vncserver

You'll be prompted to enter and verify a password, and also a view-only password. Users who log in with the view-only password will not be able to control the VNC instance with their mouse or keyboard. This is a helpful option if you want to demonstrate something to other people using your VNC server, but isn't necessary.

Running vncserver completes the installation of VNC by creating default configuration files and connection information for our server to use. With these packages installed, you are now ready to configure your VNC server.

Step 2 — Configuring the VNC Server

First, we need to tell our VNC server what commands to perform when it starts up. These commands are located in a configuration file called xstartup in the .vnc folder under your home directory. The startup script was created when you ran the vncserver in the previous step, but we need modify some of the commands for the Xfce desktop.

When VNC is first set up, it launches a default server instance on port 5901. This port is called a display port, and is referred to by VNC as :1. VNC can launch multiple instances on other display ports, like :2:3, etc. When working with VNC servers, remember that :X is a display port that refers to 5900+X.

Because we are going to be changing how the VNC server is configured, we'll need to first stop the VNC server instance that is running on port 5901.

  • vncserver -kill :1

The output should look like this, with a different PID:

Output
Killing Xtightvnc process ID 17648

Before we begin configuring the new xstartup file, let's back up the original.

  • mv ~/.vnc/xstartup ~/.vnc/xstartup.bak

Now create a new xstartup file with nano or your favorite text editor.

  • nano ~/.vnc/xstartup

Paste these commands into the file so that they are performed automatically whenever you start or restart the VNC server, then save and close the file.

~/.vnc/xstartup
#!/bin/bash xrdb $HOME/.Xresources startxfce4 &

The first command in the file, xrdb $HOME/.Xresources, tells VNC's GUI framework to read the server user's .Xresources file. .Xresources is where a user can make changes to certain settings of the graphical desktop, like terminal colors, cursor themes, and font rendering. The second command simply tells the server to launch Xfce, which is where you will find all of the graphical software that you need to comfortably manage your server.

To ensure that the VNC server will be able to use this new startup file properly, we'll need to grant executable privileges to it.

  • sudo chmod +x ~/.vnc/xstartup

Now, restart the VNC server.

  • vncserver

The server should be started with an output similar to this:

Output
New 'X' desktop is your_server_name.com:1 Starting applications specified in /home/sammy/.vnc/xstartup Log file is /home/sammy/.vnc/liniverse.com:1.log

Step 3 — Testing the VNC Desktop

In this step, we'll test the connectivity of your VNC server.

First, we need to create an SSH connection on your local computer that securely forwards to the localhost connection for VNC. You can do this via the terminal on Linux or OS X with following command. Remember to replace user and server_ip_address with the sudo non-root username and IP address of your server.

  • ssh -L 5901:127.0.0.1:5901 -N -f -l username server_ip_address

If you are using a graphical SSH client, like PuTTY, use server_ip_address as the connection IP, and set localhost:5901 as a new forwarded port in the program's SSH tunnel settings.

Next, you may now use a VNC client to attempt a connection to the VNC server at localhost:5901. You'll be prompted to authenticate. The correct password to use is the one you set in Step 1.

Once you are connected, you should see the default Xfce desktop. It should look something like this:

VNC connection to Ubuntu 16.04 server

You can access files in your home directory with the file manager or from the command line, as seen here:

Files via VNC connection to Ubuntu 16.04

Step 4 — Creating a VNC Service File

Next, we'll set up the VNC server as a systemd service. This will make it possible to start, stop, and restart it as needed, like any other systemd service.

First, create a new unit file called /etc/systemd/system/vncserver@.service using your favorite text editor:

  • sudo nano /etc/systemd/system/vncserver@.service

Copy and paste the following into it. Be sure to change the value of User and the username in the value of PIDFILE to match your username.

/etc/systemd/system/vncserver@.service
[Unit] Description=Start TightVNC server at startup After=syslog.target network.target [Service] Type=forking User=sammy PAMName=login PIDFile=/home/sammy/.vnc/%H:%i.pid ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1 ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 :%i ExecStop=/usr/bin/vncserver -kill :%i [Install] WantedBy=multi-user.target

Save and close the file.

Next, make the system aware of the new unit file.

  • sudo systemctl daemon-reload

Enable the unit file.

  • sudo systemctl enable vncserver@1.service

The 1 following the @ sign signifies which display number the service should appear over, in this case the default :1 as was discussed above. 
Stop the current instance of the VNC server if it's still running.

  • vncserver -kill :1

Then start it as you would start any other systemd service.

  • sudo systemctl start vncserver@1

You can verify that it started with this command:

  • sudo systemctl status vncserver@1

If it started correctly, the output should look like this:

Output
vncserver@1.service - TightVNC server on Ubuntu 18.04
   Loaded: loaded (/etc/systemd/system/vncserver@.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2016-04-25 03:21:34 EDT; 6s ago
  Process: 2924 ExecStop=/usr/bin/vncserver -kill :%i (code=exited, status=0/SUCCESS)

...

 systemd[1]: Starting TightVNC server on Ubuntu 18.04...
 systemd[2938]: pam_unix(login:session): session opened for user finid by (uid=0)
 systemd[2949]: pam_unix(login:session): session opened for user finid by (uid=0)
 systemd[1]: Started TightVNC server on Ubuntu 18.04.

Conclusion

You should now have a secured VNC server up and running on your Ubuntu 18.04 server. Now you'll be able to manage your files, software, and settings with an easy-to-use and familiar graphical interface.







Reference: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-16-04





 

INSERT INTO llx_user_rights (rowid, entity, fk_user, fk_id)

select rowid+30000 as rowid, entity, 16 as fk_user, fk_id from llx_user_rights

where fk_user = 13

and fk_id not in (select fk_id from llx_user_rights where fk_user = 16)



UPDATE mp_timesheet AS U1, mp_timesheet AS U2 

SET U1.timesheet_date = DATE(U2.timesheet_in)

WHERE U1.timesheet_id = U2.timesheet_id




'Skill > Database' 카테고리의 다른 글

Select Insert Example  (0) 2017.12.21
[MySQL] 8.1.1 Obtaining Auto-Increment Values  (0) 2017.07.21
mac을 위핸 sql tool  (0) 2015.10.26
mysql 무료 툴 간단 벤치마킹  (0) 2015.10.26
[Mysql] Function 권한 설정  (0) 2015.10.13
MySQL 설치와 초기 설정  (1) 2015.09.23

Obtaining the value of column that uses AUTO_INCREMENT after an INSERT statement can be achieved in a number of different ways. To obtain the value immediately after an INSERT, use a SELECT query with the LAST_INSERT_ID() function.

For example, using Connector/ODBC you would execute two separate statements, the INSERT statement and the SELECT query to obtain the auto-increment value.

INSERT INTO tbl (auto,text) VALUES(NULL,'text');
SELECT LAST_INSERT_ID();

If you do not require the value within your application, but do require the value as part of another INSERT, the entire process can be handled by executing the following statements:

INSERT INTO tbl (auto,text) VALUES(NULL,'text');
INSERT INTO tbl2 (id,text) VALUES(LAST_INSERT_ID(),'text');

Certain ODBC applications (including Delphi and Access) may have trouble obtaining the auto-increment value using the previous examples. In this case, try the following statement as an alternative:

SELECT * FROM tbl WHERE auto IS NULL;

This alternative method requires that sql_auto_is_null variable is not set to 0. See Server System Variables.

See also How to Get the Unique ID for the Last Inserted Row.








Reference : https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-usagenotes-functionality-last-insert-id.html








'Skill > Database' 카테고리의 다른 글

Select Insert Example  (0) 2017.12.21
[MySQL] 8.1.1 Obtaining Auto-Increment Values  (0) 2017.07.21
mac을 위핸 sql tool  (0) 2015.10.26
mysql 무료 툴 간단 벤치마킹  (0) 2015.10.26
[Mysql] Function 권한 설정  (0) 2015.10.13
MySQL 설치와 초기 설정  (1) 2015.09.23

Roundcube is a web browser based mail client & also known as webmail. It provides a GUI ( Graphical User Interface ) where end users can check their mails, can create & manage folders, can use address book to search email ids and lot of other webmail features.

To install roundcube on CentOS 7 followings are the prerequisite that should be installed.

  • PHP
  • Database ( MariaDB or MySQL )
  • Web Server ( Apache )
  • Any MTA – Postfix , Sendmail & Qmail

In My Case i have already installed Postfix with dovecot on CentOS 7 with

  • Domain name = nsitmail.com
  • Hostname = tec.nsitmail.com

Follow below Steps to install & configure latest version of Roundcube :

Step:1 Install PHP , Database & Apache using below command :

[root@tec ~]# yum install httpd php php-common php-json php-xml php-mbstring php-imap php-pear-DB php-mysql mysql mariadb-server

Once the above package list is installed , set the time zone value in PHP .

root@tec ~]# vi /etc/php.ini
date.timezone = Asia/Kolkata

Save & exit the file

Step:2 Create & Configure Roundcube Database

Let us first set the Initial settings & root password of Mariadb Server :

[root@tec ~]# systemctl start mariadb
[root@tec ~]# systemctl enable mariadb
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'
[root@tec ~]#
[root@tec ~]# mysql_secure_installation

Above Command “mysql_secure_installation” will allow us to set root password , remove anonymous users , disable remote root login and will remove test database.

Now Create database for Roundube and grant all the permissions to the database

create-database-roundcube

Step:3 Download tar file of Roundcube

Download latest version of Roundcube tar file either from their official site “https://roundcube.net/download/” or we can use below wget command.

[root@tec ~]# wget http://nchc.dl.sourceforge.net/project/roundcubemail/roundcubemail/1.1.3/roundcubemail-1.1.3-complete.tar.gz

Untar the downloaded file in your web server document root.

[root@tec ~]# tar -zxpvf roundcubemail-1.1.3-complete.tar.gz -C /var/www/html/

Rename the extracted file as Roundcube and set the required permissions

[root@tec html]# mv roundcubemail-1.1.3 roundcube
[root@tec html]# chown apache:apache roundcube
[root@tec html]#

Start the Apache service

[root@tec html]# systemctl start httpd
[root@tec html]# systemctl enable httpd
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
[root@tec html]#

Step:4 Start Roundcube installation using web browser installer.

To start the installation of Rouncube , access the below url in the web browser

http://tec.nsitmail.com/roundcube/installer

Roundcube-Webmail-Installer-page

click on Next…

Define the Database, Authentication Mechanism, SMTP & IMAP setting in this step. When We click on Create Config option it will ask us to Copy or download the configuration and save it as config.inc.php within the /var/www/html/roundcube/config/ directory of your Roundcube installation.

In my case i am using http based authentication mechanism , so i create one user on my Linux box and set its password using htpasswd command .

[root@tec ~]# htpasswd -c /home/linuxtechi/.htpasswd linuxtechi
New password:
Re-type new password:
Adding password for user linuxtechi
[root@tec ~]#

Roundcube-config-php-file

 

Roundcube-test-config-pafe

Remove the installer directory from your web server document root ( /var/www/html/roundcube )

[root@tec ~]# cd /var/www/html/roundcube/
[root@tec roundcube]# rm -rf installer
[root@tec roundcube]#

Step:5 Now access your account using Roundcube

Open the url in the browser “http://tec.nsitmail.com/roundcube/” , use the credentials that we set using htpasswd command.

Roundcube-Webmail-login-page

Roundcube-inbox

Roundcube installation is completed, Now explore it and enjoy.









출처 : https://www.linuxtechi.com/install-latest-version-of-roundcube-centos-7/










PINPOINT란

대규모 분산 시스템의 성능을 분석하고 문제를 진단, 처리하는 java 플랫폼.

네이버에서 2012년 7월 부터 개발을 시작하여 14년 말에 배포하였다.

(PINPOINT 뜻 : 원인을 콕! 집어내다)


기능

 1. 서버 맵 - 대상 서버와 연결된 다른 서버와의 관계 다이어그램

 2. 스캐터 - 요청별 응답시간에 따른 그래프

 3. request detail - 스캐터에서 선택된 요청의 스택트레이스 뷰

 4. 에러 발생 요청 표시 - 에러가 발생한 요청 빨간색으로 표시

 5. 서버의 jar목록 표시 - 서버에 접속하지 않아도 관련된 jar 목록 확인 가능


구성 


 1. DB - HBase(하둡 분산 데이터베이스 기반)

 2. Web UI로 view적으로 보여줌

 3. Collector - Web UI를 보여주는것을 쌓아두는거 , 대상이 되는 타겟 서버의 정보를 HBase가 저장함

 4. Agent - 각각의 대상 서버에 pinpoint agent를 줘서 각각의 pinpoint agent가 collector의 데이터를
    udp/tcp + thrift를 통해서 보내주고 그걸로 디비에 저장하고 그걸 web ui가 보여줌


특징

- 분산 트랜잭션 추적

- 토플로지 다오 발견

- 수평 확장성

- 코드 수준의 가시성


요청/반응 분석 차트

실시간 트래픽 차트

콜 스택 트리(여러 대의 서버를 한번에 볼 수 있다.)

인스펙터(JVM 힙상태 등 여러개 확인 가능)


도입 전 사전 확인

애플리케이션 환경 확인(java version, framework & lib, was 등)


도입 과정에서 고민했던 내용

HBase 이중화? 샤딩? Hadoop? 구성을 해야하는 가?

(핀 포인트 데이터의 경우 실 서버 데이터가 아니라 날라가도 문제 없다고 판단했기 때문에)








출처 : https://yangbongsoo.gitbooks.io/study/content/pinpoint.html

   <기초적이지만, 제법 괜찮은 자료들이 많습니다>








+ Recent posts