Skip to content

Instantly share code, notes, and snippets.

@chaolinhan
Created October 3, 2020 04:57
Show Gist options
  • Save chaolinhan/20d1fda4768cb64a2ec11829fc0b57eb to your computer and use it in GitHub Desktop.
Save chaolinhan/20d1fda4768cb64a2ec11829fc0b57eb to your computer and use it in GitHub Desktop.
zsh_config
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/chaolinhan/.oh-my-zsh"
export PATH="/usr/local/opt/llvm/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="oxide"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
#ZSH_THEME_RANDOM_CANDIDATES=( "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git brew fzf zsh-syntax-highlighting zsh-autosuggestions autojump zsh-interactive-cd yum)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
alias zshconfig="code ~/.zshrc"
alias ohmyzsh="code ~/.oh-my-zsh"
alias ssh_cirrus="ssh -XY s1898201@cirrus-msc.epcc.ed.ac.uk"
alias ssh_archer="ssh -XY s1898201@login.archer.ac.uk"
alias cirrus="s1898201@cirrus-msc.epcc.ed.ac.uk"
alias archer="s1898201@login.archer.ac.uk"
system_profiler SPHardwareDataType
_COLUMNS=$(tput cols)
_MESSAGE=" Warining "
y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
spaces=$(printf "%-${y}s" " ")
echo " "
echo -e "${spaces}\033[41;37;5m WARNING \033[0m"
echo " "
# _COLUMNS=$(tput cols)
# _MESSAGE="Ferderal Law provides severe civil and criminal penalties for"
# y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
# spaces=$(printf "%-${y}s" " ")
# echo -e "${spaces}${_MESSAGE}"
# _COLUMNS=$(tput cols)
# _MESSAGE="the unauthorized reproduction, distribution, or exhibition of"
# y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
# spaces=$(printf "%-${y}s" " ")
# echo -e "${spaces}${_MESSAGE}"
# _COLUMNS=$(tput cols)
# _MESSAGE="copyrighted motion pictures (Title 17, United States Code,"
# y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
# spaces=$(printf "%-${y}s" " ")
# echo -e "${spaces}${_MESSAGE}"
# _COLUMNS=$(tput cols)
# _MESSAGE="Sections 501 and 508). The Federal Bureau of Investigation"
# y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
# spaces=$(printf "%-${y}s" " ")
# echo -e "${spaces}${_MESSAGE}"
# _COLUMNS=$(tput cols)
# _MESSAGE="investigates allegations of criminal copyright infringement"
# y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
# spaces=$(printf "%-${y}s" " ")
# echo -e "${spaces}${_MESSAGE}"
# _COLUMNS=$(tput cols)
# _MESSAGE="(Title 17, United States Code, Section 506)."
# y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
# spaces=$(printf "%-${y}s" " ")
# echo -e "${spaces}${_MESSAGE}"
# echo " "
echo "--------------------------------------------------------------------------------
This is a private computing facility. Access to this service is limited to those
who have been granted access by the operating service provider on behalf of the
contracting authority and use is restricted to the purposes for which access was
granted. All access and usage are governed by the terms and conditions of access
agreed to by all registered users and are thus subject to the provisions of the
Computer Misuse Act, 1990 under which unauthorised use is a criminal offence.
If you are not authorised to use this service you must disconnect immediately.
--------------------------------------------------------------------------------
"
_MESSAGE=" PROXY WARNING "
y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
spaces=$(printf "%-${y}s" " ")
echo " "
echo -e "${spaces}\033[0;30;42m PROXY WARNING \033[0m"
echo " "
echo "N.B. This terminal is using system proxy (port 7890). Use zshconfig to configure the proxy settings."
# env of autojump
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh
PATH="/Users/chaolinhan/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/Users/chaolinhan/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/Users/chaolinhan/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/Users/chaolinhan/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/Users/chaolinhan/perl5"; export PERL_MM_OPT;
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export PATH="$PATH:$HOME/bin"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator
export NODE_PATH='/usr/local/lib/node_modules'
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment