-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fasd role * role antibody-zsh -> zsh-antibody * Thinned out homebrew cask * bash and zsh powerline locked into ap- versions * etchosts role installs .raw-ads.hosts instead of .merge.hosts * ask-sudo -> ask-become-pass flag in bootstrap
- Loading branch information
Showing
31 changed files
with
343 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.DS_store | ||
*.retry | ||
.*.hosts* | ||
.bash-powerline.* | ||
.zsh-powerline.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
[defaults] | ||
|
||
hostfile = ./inventories | ||
roles_path = ./roles | ||
roles_path = ./roles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
- include: provision/mac_core.yml | ||
- include: provision/mac_dev.yml | ||
- include: provision/mac_secure_no_animate.yml | ||
- include: provision/mac_etchost_no_animate.yml | ||
- include: provision/mac_jekyll.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,28 +23,33 @@ alias st="syncthing" | |
#Jupyter | ||
alias jn="jupyter notebook" | ||
|
||
# Directory Shortcuts | ||
alias .f="cd ~/.files" | ||
alias dx="cd ~/Dropbox" | ||
alias dl="cd ~/Downloads" | ||
alias dt="cd ~/Desktop" | ||
alias sr="cd ~/src" | ||
alias sra="cd ~/src/ape" | ||
alias srg="cd ~/src/github.com" | ||
alias sri="cd ~/src/interviews" | ||
alias srj="cd ~/src/jupyter" | ||
alias sru="cd ~/src/uw" | ||
alias ap="cd ~/src/github.com/andrewparadi.github.io" | ||
alias qa="cd ~/src/github.com/Quantular-API" | ||
alias qw="cd ~/src/github.com/Quantular-Web-Client" | ||
#Git | ||
alias gs="git status" | ||
alias ga="git add" | ||
alias gc="git commit" | ||
alias grau="git remote add upstream" | ||
alias gra="git remote add" | ||
alias gl="git log --oneline" | ||
alias gr="git rebase -i" | ||
|
||
# UW SSH | ||
alias uwssh="ssh -4 -i ~/.ssh/id_rsa -Y [email protected]" | ||
alias uwssh1404="ssh -4 -i ~/.ssh/id_rsa -Y [email protected]" | ||
alias uwssh1604="ssh -4 -i ~/.ssh/id_rsa -Y [email protected]" | ||
alias uwssh458="ssh [email protected]" | ||
alias uw458scp="scp -r [email protected]:uml/share/* ./" | ||
alias uwscp458="scp -r ./ [email protected]:uml/share/" | ||
# Docker | ||
alias dc="docker-compose" | ||
alias dka="docker kill $(docker ps -q)" | ||
alias dvp="docker volume prune" | ||
alias drmc="docker rm $(docker ps -a -q)" | ||
alias drmi="docker rmi -f $(docker images -q)" | ||
|
||
# fasd | ||
alias fa='fasd -a' # any | ||
alias s='fasd -si' # show / search / select | ||
alias d='fasd -d' # directory | ||
alias f='fasd -f' # file | ||
alias sd='fasd -sid' # interactive directory selection | ||
alias sf='fasd -sif' # interactive file selection | ||
alias z='fasd_cd -d' # cd, same functionality as j in autojump | ||
alias zz='fasd_cd -d -i' # cd with interactive selection | ||
alias jj='fasd_cd -i' | ||
alias j='fasd_cd -i -1' | ||
|
||
# UW Directories | ||
case "$(uname)" in | ||
|
@@ -53,21 +58,18 @@ case "$(uname)" in | |
*) ;; | ||
esac | ||
alias uw="cd ~/docs/UW/4b" | ||
alias 456="cd ${uwsrc}/cs456${uwpost}" | ||
alias 458="cd ${uwsrc}/cs458${uwpost}" | ||
alias 349="cd ${uwsrc}/cs349${uwpost}" | ||
alias 451="cd ${uwsrc}/cs451${uwpost}" | ||
alias 454="cd ${uwsrc}/cs454${uwpost}" | ||
alias 487="cd ${uwsrc}/co487${uwpost}" | ||
alias 492="cd ${uwsrc}/cs492${uwpost}" | ||
|
||
#Git | ||
alias gs="git status" | ||
alias ga="git add" | ||
alias gc="git commit" | ||
alias grau="git remote add upstream" | ||
alias gra="git remote add" | ||
alias gl="git log --oneline" | ||
alias gr="git rebase -i" | ||
# UW SSH | ||
alias uwssh="ssh -4 -i ~/.ssh/id_rsa -Y [email protected]" | ||
alias uwssh1404="ssh -4 -i ~/.ssh/id_rsa -Y [email protected]" | ||
alias uwssh1604="ssh -4 -i ~/.ssh/id_rsa -Y [email protected]" | ||
alias uwssh458="ssh [email protected]" | ||
alias uw458scp="scp -r [email protected]:uml/share/* ./" | ||
alias uwscp458="scp -r ./ [email protected]:uml/share/" | ||
|
||
#Web Download files off of a webpage | ||
# - Every file: wd "" {url} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
|
||
bash_powerline_div: "### Theme" | ||
bash_powerline_source: 'source {{home}}/.bash-powerline.sh' | ||
bash_powerline_source: 'source {{home}}/.ap-bash-powerline.sh' | ||
bash_powerline_url: https://raw.githubusercontent.com/riobard/bash-powerline/master/bash-powerline.sh | ||
bash_powerline_file: .bash-powerline.sh | ||
bash_powerline_ap_file: .ap-bash-powerline.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#!/usr/bin/env bash | ||
|
||
## Uncomment to disable git info | ||
#POWERLINE_GIT=0 | ||
|
||
__powerline() { | ||
# Colorscheme | ||
readonly RESET='\[\033[m\]' | ||
readonly COLOR_CWD='\[\033[0;34m\]' # blue | ||
readonly COLOR_GIT='\[\033[0;36m\]' # cyan | ||
readonly COLOR_SUCCESS='\[\033[0;32m\]' # green | ||
readonly COLOR_FAILURE='\[\033[0;31m\]' # red | ||
|
||
readonly SYMBOL_GIT_BRANCH='⑂' | ||
readonly SYMBOL_GIT_MODIFIED='*' | ||
readonly SYMBOL_GIT_PUSH='↑' | ||
readonly SYMBOL_GIT_PULL='↓' | ||
|
||
if [[ -z "$PS_SYMBOL" ]]; then | ||
case "$(uname)" in | ||
Darwin) PS_SYMBOL='';; | ||
Linux) PS_SYMBOL='$';; | ||
*) PS_SYMBOL='%';; | ||
esac | ||
fi | ||
|
||
__git_info() { | ||
[[ $POWERLINE_GIT = 0 ]] && return # disabled | ||
hash git 2>/dev/null || return # git not found | ||
local git_eng="env LANG=C git" # force git output in English to make our work easier | ||
|
||
# get current branch name | ||
local ref=$($git_eng symbolic-ref --short HEAD 2>/dev/null) | ||
|
||
if [[ -n "$ref" ]]; then | ||
# prepend branch symbol | ||
ref=$SYMBOL_GIT_BRANCH$ref | ||
else | ||
# get tag name or short unique hash | ||
ref=$($git_eng describe --tags --always 2>/dev/null) | ||
fi | ||
|
||
[[ -n "$ref" ]] || return # not a git repo | ||
|
||
local marks | ||
|
||
# scan first two lines of output from `git status` | ||
while IFS= read -r line; do | ||
if [[ $line =~ ^## ]]; then # header line | ||
[[ $line =~ ahead\ ([0-9]+) ]] && marks+=" $SYMBOL_GIT_PUSH${BASH_REMATCH[1]}" | ||
[[ $line =~ behind\ ([0-9]+) ]] && marks+=" $SYMBOL_GIT_PULL${BASH_REMATCH[1]}" | ||
else # branch is modified if output contains more lines after the header line | ||
marks="$SYMBOL_GIT_MODIFIED$marks" | ||
break | ||
fi | ||
done < <($git_eng status --porcelain --branch 2>/dev/null) # note the space between the two < | ||
|
||
# print the git branch segment without a trailing newline | ||
printf " $ref$marks" | ||
} | ||
|
||
ps1() { | ||
# Check the exit code of the previous command and display different | ||
# colors in the prompt accordingly. | ||
if [ $? -eq 0 ]; then | ||
local symbol="$COLOR_SUCCESS $PS_SYMBOL $RESET" | ||
else | ||
local symbol="$COLOR_FAILURE $PS_SYMBOL $RESET" | ||
fi | ||
|
||
local cwd="$COLOR_CWD\w$RESET" | ||
# Bash by default expands the content of PS1 unless promptvars is disabled. | ||
# We must use another layer of reference to prevent expanding any user | ||
# provided strings, which would cause security issues. | ||
# POC: https://github.com/njhartwell/pw3nage | ||
# Related fix in git-bash: https://github.com/git/git/blob/9d77b0405ce6b471cb5ce3a904368fc25e55643d/contrib/completion/git-prompt.sh#L324 | ||
if shopt -q promptvars; then | ||
__powerline_git_info="$(__git_info)" | ||
local git="$COLOR_GIT\${__powerline_git_info}$RESET" | ||
else | ||
# promptvars is disabled. Avoid creating unnecessary env var. | ||
local git="$COLOR_GIT$(__git_info)$RESET" | ||
fi | ||
|
||
PS1="$cwd$git$symbol" | ||
} | ||
|
||
PROMPT_COMMAND="ps1${PROMPT_COMMAND:+; $PROMPT_COMMAND}" | ||
} | ||
|
||
__powerline | ||
unset __powerline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.