Showing posts with label Vim. Show all posts
Showing posts with label Vim. Show all posts

Monday, 21 January 2019

Install MySQL, Vim, Go, and Git on Ubuntu 16.04.5

Install MySQL, Vim, Go, and Git on Ubuntu 16.04.5

In Ubuntu: to get IP address
$ ip addr
Turn on Putty, input IP address,set Data(optional), run Ubuntu.
Setting for Data

access multiple separate terminal sessions:
$ tmux

Install the environmental configuration:

Install in both user and root:
# cd \
&& git clone https://github.com/junxie6/config_centos_v2.git \
&& bash config_centos_v2/script/setHomeConfig.sh \
&& source ~/.bashrc \
&& tmux
Note: git remote set-url origin git@github.com:junxie6/config_centos_v2.git

Compile and install the latest Vim 8:

# apt-get install libncurses5-dev python-dev ruby-dev libperl-dev ruby-dev liblua5.3-dev exuberant-ctags cscope
// Fix liblua paths
# ln -s /usr/include/lua5.3 /usr/include/lua
# ln -s /usr/lib/x86_64-linux-gnu/liblua5.3.so /usr/local/lib/liblua.so

# cd /usr/local/src \
&& git clone https://github.com/vim/vim.git --depth 1 \
&& cd vim \
&& ./configure \
--prefix=/usr --with-features=huge --enable-multibyte --enable-pythoninterp \
--enable-rubyinterp --enable-perlinterp --enable-luainterp --enable-cscope \
&& make \
&& make install

# hash -r
# vim --version | head

Install Go

rm -rf /usr/local/go \
&& curl 'https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz' -o go.tar.gz \
&& tar -zxvf go.tar.gz -C /usr/local \
&& rm -f go.tar.gz \

Install MySQL5.7:

# apt-cache policy mysql-server
# apt-cache search mysql-server
# apt-cache show mysql-server | less
# apt show mysql-server

# apt-get install mysql-server

# vim /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 0.0.0.0
# systemctl restart mysql
# vim ~/.my.cnf
[client]
host = localhost
port = 3306
user = root
password = MyPassword
[client]
host = localhost
port = 3306
user = root
password = MyPassword

Compile and install the latest Git 2.18.0 from source code:

# apt-get install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev \
&& apt-get install curl \
&& cd /usr/local/src/ \
&& curl -L https://github.com/git/git/archive/v2.18.0.tar.gz -o git.tar.gz \
&& tar zxvf git.tar.gz \
&& cd git-2.18.0/ \
&& make configure \
&& ./configure --prefix=/usr \
&& make all \
&& make install

# git --version
git version 2.18.0
Generate public key and private key pair for github:
$ ssh-keygen -t rsa -C “kang3889631@gmail.com”
$ cat ~/.ssh/id_rsa.pub
Note: copy and paste to github SSH setting
Varify the success of connection to github
$ ssh -i ~/.ssh/id_rsa -T git@github.com
Make a new directory:
mkdir -p go/src/github.com/kang3889631
git init .
git clone git@github.com:kang3889631/demo.git
git remote -v
git status
git diff
git add filename
git commit
git push
git log
git show

# apt-get install tree