commit bbf97ae7e8bd8183b62a1d7bfdc60200a6f605cf Author: Arif Herusetyo Wicaksono Date: Fri Mar 2 19:52:11 2018 +0900 Migrate from old repository diff --git a/go.md b/go.md new file mode 100644 index 0000000..bcd24a3 --- /dev/null +++ b/go.md @@ -0,0 +1,21 @@ +# Go + +Install go programming language to user .local/bin directory + +## Install binary release from repositories + +```bash +wget -qO go.tar.gz https://dl.google.com/go/go1.9.3.linux-amd64.tar.gz \ + && tar -C $HOME/.local -xzf go.tar.gz \ + && rm go.tar.gz +``` + +## Set up environment variables + +```bash +cat << EOF >> $HOME/.bashrc +export GOPATH=\$HOME/Projects/go +export GOROOT=\$HOME/.local/go +export PATH=\$GOROOT/bin:\$PATH:\$GOPATH/bin +EOF +``` diff --git a/nodejs.md b/nodejs.md new file mode 100644 index 0000000..1ec92dd --- /dev/null +++ b/nodejs.md @@ -0,0 +1,21 @@ +# Node.js + +Install Node.js for Javascript auto-completion in Vim 8. + +## Install binary release from repositories + +```bash +wget -qO nodejs.tar.xz https://nodejs.org/dist/v8.9.4/node-v8.9.4-linux-x64.tar.xz \ + && tar -C $HOME/.local/ -xf nodejs.tar.xz \ + && mv $HOME/.local/node* $HOME/.local/nodejs \ + && rm nodejs.tar.xz +``` + +## Set up environment variables + +```bash +cat << EOF >> $HOME/.bashrc +export NODE_PATH=\$HOME/.local/nodejs +export PATH=\$PATH:\$NODE_PATH/bin +EOF +``` diff --git a/postgres.md b/postgres.md new file mode 100644 index 0000000..c13afba --- /dev/null +++ b/postgres.md @@ -0,0 +1,34 @@ +# PostgreSQL + +## Quick start for Docker-based development + +This quick start deployment utilizes Alpine-based image. + +```bash +# pull the image from docker hub +docker pull postgresql:10-alpine + +# define environment variables +cat << EOF > POSTGRESENV +POSTGRES_USER="" +POSTGRES_PASSWORD="" +POSTGRES_DB="" +EOF + +# define container name and ports +PGSRV="" +PGSRVPORT="" + +docker run -d --name ${PGSRV} --env-file POSTGRESENV -p ${PGSRVPORT}:5432 postgres:10-alpine + +# specify container name for psql configuration, if needed +PGCLI="" +docker run -d --name ${PGCLI} postgres:10-alpine + +# connect using client container, enter password when prompted +PGUSER="" +PGDB="" +PGHOST="" +PGPORT="" +docker exec -it ${PGCLI} psql -h ${PGHOST} -p ${PGPORT} -U ${PGUSER} -W -d ${PGDB} +``` diff --git a/vim8.md b/vim8.md new file mode 100644 index 0000000..b77c1e3 --- /dev/null +++ b/vim8.md @@ -0,0 +1,68 @@ +# Vim + +This document describes my personal preference for Vim 8 setup. + +## Compile Vim 8 from source and install in home directory + +```bsh +# install required dependencies +sudo apt install libncurses5-dev python3-dev git + +# clone vim from github repositories +git clone https://github.com/vim/vim.git + +# build vim 8 +cd vim +./configure --with-features=huge --enable-multibyte --enable-python3interp=yes --prefix=$HOME/.local +make +make install + +# add $HOME/.local bin to PATH to prioritize Vim8 +echo "export PATH=\$HOME/.local/bin:\$PATH" >> $HOME/.bashrc +``` + +## Setup plugins using vundle + +```bash +# clone from github repositories +git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim + +# create .vimrc configuration file in home +cd $HOME +cat << EOF > .vimrc +set nocompatible +filetype off + +set rtp+=~/.vim/bundle/Vundle.vim +call vundle#begin() + +Plugin 'VundleVim/Vundle.vim' +Plugin 'tpope/vim-fugitive' +Plugin 'Shougo/Denite.nvim' +Plugin 'Valloric/YouCompleteMe' + +call vundle#end() +filetype plugin indent on + +set backspace=indent,eol,start +set tabstop=4 shiftwidth=4 expandtab +set number numberwidth=4 +set splitbelow +set encoding=utf-8 fileencoding=utf-8 +syntax on +EOF + +# install plugins +vim +PluginInstall +qall +``` + +# Additional config for auto-completion using YouCompleteMe + +```bash +# install compile dependencies +sudo apt install build-essential cmake python-dev + +# clone from github repositories and install python, go, and javascript completion +cd $HOME/.vim/bundle/YouCompleteMe +./install.py --go-completer --js-completer +```