diff --git a/kubernetes-aliases.sh b/kubernetes-aliases.sh index 20daae9ce..ec8e6a099 100644 --- a/kubernetes-aliases.sh +++ b/kubernetes-aliases.sh @@ -1,5 +1,12 @@ -alias kube="kubectl" -alias mk="minikube" -alias kube-list-contexts="kubectl config get-contexts" -alias docker-suicide="killall com.docker.hyperkit" -alias docker-die="killall com.docker.hyperkit" +alias ts-resolve-host="tsunami variables resolve --unit-type host " + +function ts-variables-show() { + tsunami variables show $1 $2 +} +function ts-variables-show-version() { + tsunami variables history $1 $2 +} + +alias tsunami-resolve-host="ts-resolve-host" +alias tsunami-variables-show="ts-variables-show" +alias tsunami-variables-show-version="ts-variables-show-version" diff --git a/lib/functions.zsh b/lib/functions.zsh index 0cc5afb81..7f496fc44 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -289,22 +289,6 @@ function kube-list-prod-contexts() { # \history -${NUM_LINES} # } -alias h="history -20" -alias gfind-filename=gfindf - -alias ff='fd -t f ' # find files -alias ffa='fd -H -t f ' # find files in horrible places - -alias fdd='\fd -t d ' # find directories -alias fdir='\fd -t d ' # find directories - -alias fdda='\fd -H -t d ' # find directories in horrible places - -alias lg='l | grep -i ' # ls grep -alias gfinda="gfind-all" -alias hg="h | grep -i " -# alias agl="ag --pager less " - function agl() { ag --pager less "$@" } @@ -333,7 +317,7 @@ function clean-slate() { alias clr=clean-slate alias cls=clean-slate -function psg () { +function psgr() { ps auwwwwx | grep -v 'grep ' | grep -E "%CPU|$1" } @@ -366,11 +350,11 @@ function ssh-ds718() { alias git-stash-list-all='gitk `git stash list --pretty=format:%gd`' -function master-protection() { +function master-show-protection() { git branch -vv | grep "origin/`git branch --show-current`" } -function git-branch() { +function git-show-branch() { git branch -vv | grep `git branch --show-current` } @@ -378,40 +362,69 @@ function git-branch() { alias docker-kill-latest='docker ps -l --format='{{.Names}}' | xargs docker kill' # stop all containers -function docker-stop-all() { - docker container stop -t 2 $(docker container ls -q) & +docker-stop-all () { + docker container stop -t 2 $(docker container ls -q) 2>/dev/null } -# Launch firefox profile manager -function firefox-profiles() { - "/Applications/Firefox.app/Contents/MacOS/firefox-bin --profilemanager" -} - -function find-all-massive-files() { +function find-gig-files() { find . -size +1G -ls | sort -k7n # Find files larger than 1GB and then order the list by the file size } -function start-cloud-storage() { +function _start-cloud-storage() { + bgnotify "Booting cloud sync apps..." cd /Applications open Dropbox.app 2>/dev/null & - open Backup\ and\ Sync.app 2>/dev/null & + open Google\ Drive.app 2>/dev/null & # Don't do this cos it downloads my backed up photos # open "Google Drive File Stream.app" 2>/dev/null & cd - } -function tree() { - /usr/local/homebrew/bin/tree -a $1 | colorize_less +function start-cloud-storage() { + ( + bgnotify "Waiting for local unison sync..." + /Users/peter/dotfiles_psk/bin/unison-cron-job.sh + sleep 7 + _start-cloud-storage + ) & } +function tree() { + /usr/local/homebrew/bin/tree -a $1 | colorize_less "$@" +} + +# function open-all-edge-apps() { +# EDGE_APP_DIR='/Users/peter/Dropbox (Personal)/_Settings/Edge Apps.localized/' +# for APP in ${EDGE_APP_DIR}/*.app; do +# echo "Opening $APP ..." +# nohup open -a "$APP" & +# done +# } + +function _open-all-chrome-apps() { + for APP in "${1}"/*.app; do + echo "Opening $APP ..." + nohup open -a "$APP" & + done +} + +function open-all-chrome-apps() { + CHROME_APP_DIR='/Users/peter/Dropbox (Personal)/_Settings/Chrome Apps/Chrome Apps.localized/' + _open-all-chrome-apps "$CHROME_APP_DIR" + CHROME_APP_DIR='/Users/peter/Dropbox (Personal)/_Settings/Chrome/Chrome Apps/Chrome Apps.localized/' + _open-all-chrome-apps "$CHROME_APP_DIR" +} + +alias start-all-edge-apps="open-all-edge-apps" + function kill-cloud-storage() { # TODO investigate pkill as alternative # Don't do this cos it downloads my backed up photos # killall "Google Drive File Stream" 2>/dev/null & killall Dropbox 2>/dev/null & - killall "Backup and Sync" 2>/dev/null & killall "Google Drive" 2>/dev/null & + killall -v "FinderSyncExtension" -SIGKILL & } # For photos, pictures, DS718 diff --git a/lib/grep.zsh b/lib/grep.zsh index 545bd1045..8dea2ad96 100644 --- a/lib/grep.zsh +++ b/lib/grep.zsh @@ -16,9 +16,9 @@ else # isn't available, --color won't be either (they were released at the same # time (v2.5): https://git.savannah.gnu.org/cgit/grep.git/tree/NEWS?id=1236f007 if grep-flags-available --color=auto --exclude-dir=.cvs; then - GREP_OPTIONS="--color=always --exclude-dir=$EXC_FOLDERS" + GREP_OPTIONS="--exclude-dir=$EXC_FOLDERS" elif grep-flags-available --color=auto --exclude=.cvs; then - GREP_OPTIONS="--color=always --exclude=$EXC_FOLDERS" + GREP_OPTIONS="--exclude=$EXC_FOLDERS" fi if [[ -n "$GREP_OPTIONS" ]]; then diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 16e244be5..5b7cfe36c 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -12,6 +12,13 @@ if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then source $ZSH/tools/check_for_upgrade.sh fi +# Homebrew mentioned this so I'm doing it +export SCALA_HOME=/usr/local/homebrew/opt/scala/idea + +# From Helios user guide https://github.com/spotify/helios/blob/master/docs/user_manual.md#using-the-helios-cli +alias helios='helios -z http://localhost:5801' + + # Initializes Oh My Zsh # add a function path diff --git a/themes/agnoster-short.zsh-theme b/themes/agnoster-short.zsh-theme new file mode 120000 index 000000000..dff5a98da --- /dev/null +++ b/themes/agnoster-short.zsh-theme @@ -0,0 +1 @@ +/Users/peter/.oh-my-zsh/custom/themes/agnoster-short.zsh-theme \ No newline at end of file diff --git a/themes/agnoster-shorter.zsh-theme b/themes/agnoster-shorter.zsh-theme new file mode 120000 index 000000000..f46dbc12b --- /dev/null +++ b/themes/agnoster-shorter.zsh-theme @@ -0,0 +1 @@ +/Users/peter/.oh-my-zsh/custom/themes/agnoster-shorter.zsh-theme \ No newline at end of file diff --git a/themes/example.zsh-theme b/themes/example.zsh-theme new file mode 120000 index 000000000..1c9013817 --- /dev/null +++ b/themes/example.zsh-theme @@ -0,0 +1 @@ +/Users/peter/.oh-my-zsh/custom/themes/example.zsh-theme \ No newline at end of file diff --git a/tsunami-aliases.sh b/tsunami-aliases.sh new file mode 100644 index 000000000..7042dedc0 --- /dev/null +++ b/tsunami-aliases.sh @@ -0,0 +1,7 @@ +alias kube="kubectl" +alias kc="kubectl" +alias mk="minikube" +alias kube-list-contexts="kubectl config get-contexts" +alias docker-suicide="killall com.docker.hyperkit" +alias docker-die="killall com.docker.hyperkit" +alias mk="minikube" diff --git a/unison-cron-job.sh b/unison-cron-job.sh new file mode 120000 index 000000000..4f7e45322 --- /dev/null +++ b/unison-cron-job.sh @@ -0,0 +1 @@ +/Users/peter/dotfiles_psk/bin/unison-cron-job.sh \ No newline at end of file