Skip to content

Instantly share code, notes, and snippets.

@manhg
Last active July 16, 2020 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manhg/7b33e1e3ba35828b00f4be9994aa5e07 to your computer and use it in GitHub Desktop.
Save manhg/7b33e1e3ba35828b00f4be9994aa5e07 to your computer and use it in GitHub Desktop.
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export MANPAGER="less -X" # Don't clear the screen after quitting a manual page
export PYTHONIOENCODING=utf-8
export PYTHONUNBUFFERED=1
export PYTHONWARNINGS="ignore:Deprecation"
export JAVA_OPTS="-Xms32m -Xmx256m"
export JVM_OPTS=$JAVA_OPTS
alias l='ls --color=auto --classify --group-directories-first --human-readable --quoting-style=literal'
alias l.='ls -d .* --color=auto' # show hidden only
alias ll='l -la' # show all
alias rand='dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | cut -c -16'
alias du1='du -h --max-depth=1'
alias du10='du --max-depth=1 | sort -n -r | head -n 10'
alias glg="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) \
%C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --max-count=15"
alias gfh="git log --expand-tabs=4 --follow --abbrev-commit --date=relative -p -- " # Usage: gfh {file/folder} all change diff on a file/a folder
alias gmt='git mergetool'
alias gpr='git pull --rebase'
alias grm='git rebase --committer-date-is-author-date master'
alias grc='git rebase --continue'
alias gst='git status'
alias gc='git commit -a'
alias gexp='git archive --format gzip --output'
alias git1="git clone --depth=1"
alias gbs="git clone --depth=1 --single-branch -b " # Usage: gbs {branch} {repo}
alias gca="git add . && git commit -C HEAD --amend"
export GOPATH=~/.gopath
export PATH=$PATH:~/.bin:./node_modules/.bin
[ -f /etc/bash_completion ] && . /etc/bash_completion
if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s` &> /dev/null
ssh-add &> /dev/null
fi
# PS_COLOR="\[$(tput setaf 3)\]"
# RESET="\[$(tput sgr0)\]"
# export PS1="${PS_COLOR}\u@\h \w \$ ${RESET}"
export HISTSIZE=100000
[core]
excludesfile = ~/.gitignore_global
[user]
email = manhg@users.noreply.github.com
name = Giang Manh
[push]
default = current
# Mac
.DS_Store
.DS_Store?
.*
# Not interesting
*.log
*.tgz
*.zip
# Python
__pycache__/
*.py[cod]
*.so
.Python
*.egg-info/
set autoindent
set nonewlines
set tabsize 4
set tabstospaces
set boldtext
set historylog
\set QUIET 1
\pset null '[NULL]'
\set PROMPT1 '%[%033[1m%]%M %n@%/%R%[%033[0m%]%# '
\set PROMPT2 '[more] %R > '
-- Show how long each query takes to execute
\timing
-- Use best available output format
\x auto
\set VERBOSITY verbose
\set HISTFILE ~/.psql_history- :DBNAME
\set HISTCONTROL ignoredups
\set COMP_KEYWORD_CASE upper
\unset QUIET
apt-get update
apt-get install git docker python3-dev postgresql-11 redis-server nginx-full
timedatectl set-timezone Asia/Tokyo
apt-get install docker-compose
apt-get install ufw
apt-get install unzip
curl -sSf https://moncho.github.io/dry/dryup.sh | sudo sh
sudo chmod 755 /usr/local/bin/dry
apt-get install rsync certbot python-certbot-nginx postfix psmisc
ufw allow 9622
ufw allow 80
ufw allow 443
# hostnamectl set-hostname
# ufw enable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment