Skip to content

Instantly share code, notes, and snippets.

@eerkunt
Created March 27, 2019 10:56
Show Gist options
  • Save eerkunt/9ccb512b037026cf2dee51bdfb5ca7b9 to your computer and use it in GitHub Desktop.
Save eerkunt/9ccb512b037026cf2dee51bdfb5ca7b9 to your computer and use it in GitHub Desktop.
# Path to your oh-my-zsh installation.
export ZSH=/Users/sharky/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="spaceship"
# Spaceship Configuration
SPACESHIP_AWS_SHOW="true"
SPACESHIP_USER_SHOW="true"
SPACESHIP_KUBECONTEXT_SHOW="false"
SPACESHIP_PYENV_SHOW="false"
# GIT
SPACESHIP_GIT_SHOW=true
SPACESHIP_GIT_PREFIX="on "
SPACESHIP_GIT_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"
SPACESHIP_GIT_SYMBOL=""
# GIT BRANCH
SPACESHIP_GIT_BRANCH_SHOW=true
SPACESHIP_GIT_BRANCH_PREFIX="$SPACESHIP_GIT_SYMBOL"
SPACESHIP_GIT_BRANCH_SUFFIX=""
SPACESHIP_GIT_BRANCH_COLOR="magenta"
# GIT STATUS
SPACESHIP_GIT_STATUS_SHOW=true
SPACESHIP_GIT_STATUS_PREFIX=" ["
SPACESHIP_GIT_STATUS_SUFFIX="]"
SPACESHIP_GIT_STATUS_COLOR="red"
SPACESHIP_GIT_STATUS_UNTRACKED="?"
SPACESHIP_GIT_STATUS_ADDED="+"
SPACESHIP_GIT_STATUS_MODIFIED="!"
SPACESHIP_GIT_STATUS_RENAMED="»"
SPACESHIP_GIT_STATUS_DELETED=""
SPACESHIP_GIT_STATUS_STASHED="$"
SPACESHIP_GIT_STATUS_UNMERGED="="
SPACESHIP_GIT_STATUS_AHEAD=""
SPACESHIP_GIT_STATUS_BEHIND=""
SPACESHIP_GIT_STATUS_DIVERGED=""
# 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 change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# 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.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
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? (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 cloudapp vagrant-prompt battery virtualenv terraform sublime python osx nmap github docker docker-compose cp colored-man-pages brew)
# User configuration
# export PATH="/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
# 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"
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
# 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="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"
DIRECTORY_NAME="CONTINO.io Encrypted Working Environment"
export WORKROOT="/Volumes/$DIRECTORY_NAME"
# Load OWN Scripts
echo -n "Loading customised scripts "
ls -1 /Users/sharky/.ownZshFunctions/*.sh | while read LIBRARY_FILE; do
echo -ne "\e[93m.\e[0m"
source ${LIBRARY_FILE}
done
echo
source $ZSH/oh-my-zsh.sh
export PATH="/usr/local/sbin:$PATH"
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
# added by travis gem
[ -f /Users/sharky/.travis/travis.sh ] && source /Users/sharky/.travis/travis.sh
# Export GO Paths
export GOPATH="/Users/sharky/Repository/go-projects"
export GOROOT="/usr/local/opt/go/libexec"
export PATH="$PATH:$GOROOT/bin:$GOPATH/bin"
alias lgit=lazygit
alias ls='ls --color'
#AWSume alias to source the AWSume script
alias awsume=". \$(pyenv which awsume)"
fpath=(/usr/local/share/zsh/site-functions $fpath)
alias dlg=". ~/Repository/venv2/bin/activate && cd ~/Repository/dlg && awsume -l"
alias msfconsole="/opt/metasploit-framework/bin/msfconsole"
alias msfupdate="/opt/metasploit-framework/bin/msfupdate"
alias cat='bat'
# tabtab source for serverless package
# uninstall by removing these lines or running `tabtab uninstall serverless`
[[ -f /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/serverless.zsh ]] && . /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/serverless.zsh
# tabtab source for sls package
# uninstall by removing these lines or running `tabtab uninstall sls`
[[ -f /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/sls.zsh ]] && . /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/sls.zsh
docker () {
if [[ "${1}" = "tags" ]]; then
docker_tag_search $2
else
command docker $@
fi
}
docker_tag_search () {
# Display help
if [[ "${1}" == "" ]]; then
echo "Usage: docker tags repo/image"
echo " docker tags image"
return
fi
# Full repo/image was supplied
if [[ $1 == *"/"* ]]; then
name=$1
# Only image was supplied, default to library/image
else
name=library/${1}
fi
printf "Searching tags for ${name}"
# Fetch all pages, because the only endpoint supporting pagination params
# appears to be tags/lists, but that needs authorization
results=""
i=0
has_more=0
while [ $has_more -eq 0 ]
do
i=$((i+1))
result=$(curl "https://registry.hub.docker.com/v2/repositories/${name}/tags/?page=${i}" 2>/dev/null | jq -r '."results"[]["name"]' 2>/dev/null)
has_more=$?
if [[ ! -z "${result// }" ]]; then results="${results}\n${result}"; fi
printf "."
done
printf "\n"
# Sort all tags
sorted=$(
for tag in "${results}"; do
echo $tag
done | sort
)
# Print all tags
for tag in "${sorted[@]}"; do
echo $tag
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment