Skip to content

Instantly share code, notes, and snippets.

@ctranstrum
ctranstrum / bash_prompt
Created December 27, 2017 21:28
Mac bash prompt
user=$(whoami | sed "s/\..*$//")
os=''
blue='\[\e[1;34m\]'
white='\[\e[1;37m\]'
off='\[\e[0m\]'
PS1="${white}${os} ${user}${off} ${blue}\w${off}\$ "
case "$TERM" in
@ctranstrum
ctranstrum / ec2
Created December 27, 2017 21:29
AWS shortcuts
_Name_Tag_='Tags[?Key==`Name`].Value | [0]'
_Env_Tag_='Tags[?Key==`Environment`].Value | [0]'
_Project_Tag_='Tags[?Key==`Project`].Value | [0]'
_Owner_Tag_='Tags[?Key==`Owner`].Value | [0]'
_App_Tag_='Tags[?Key==`ApplicationGroup`].Value | [0]'
ami () {
aws ec2 describe-images --image-id $1 --output json
}
@ctranstrum
ctranstrum / .git-prompt-colors.sh
Last active December 27, 2017 21:50
Bash git prompt
override_git_prompt_colors() {
GIT_PROMPT_THEME_NAME="Custom"
user=$(whoami | sed "s/\..*$//")
os=""
## These are the color definitions used by gitprompt.sh
GIT_PROMPT_PREFIX="" # start of the git info string
GIT_PROMPT_SUFFIX=" ═╕" # the end of the git info string
GIT_PROMPT_SEPARATOR=" " # separates each item
@ctranstrum
ctranstrum / alias
Last active December 27, 2017 22:06
bash startup
alias grep='grep -i --color'
alias egrep='egrep -i --color'
alias fgrep='fgrep -i --color'
alias lsl='ls -l'
alias lsa='ls -al'
alias dev42='ssh -l device42 -p 404 10.31.12.42'
alias cssh='ssh -l ec2-user -i ~/.ssh/corp.pem'
[[ -s ~/.bashrc ]] && source ~/.bashrc
[[ -d ~/.bashd ]] && for f in ~/.bashd/*; do source $f; done