important aliases, refactorings, all sorts

This commit is contained in:
Peter Kingswell 2021-07-15 10:36:48 -04:00
commit e278d94f6f
9 changed files with 76 additions and 38 deletions

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -0,0 +1 @@
/Users/peter/.oh-my-zsh/custom/themes/agnoster-short.zsh-theme

View file

@ -0,0 +1 @@
/Users/peter/.oh-my-zsh/custom/themes/agnoster-shorter.zsh-theme

1
themes/example.zsh-theme Symbolic link
View file

@ -0,0 +1 @@
/Users/peter/.oh-my-zsh/custom/themes/example.zsh-theme

7
tsunami-aliases.sh Normal file
View file

@ -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"

1
unison-cron-job.sh Symbolic link
View file

@ -0,0 +1 @@
/Users/peter/dotfiles_psk/bin/unison-cron-job.sh