-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
131 lines (112 loc) · 5.29 KB
/
.aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# 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`.
#
# Shortcuts
alias .cci="mkdir .circleci && touch .circleci/config.yml"
alias .nvm="curl https://raw.githubusercontent.com/NdagiStanley/repo-boiler-plate/main/.nvmrc > .nvmrc"
alias .mdlint="curl https://raw.githubusercontent.com/NdagiStanley/repo-boiler-plate/main/.markdownlint.json > .markdownlint.json"
alias c="code" # x-cmd "cd" conflicts with this command therefore when x-cmd is enabled, use `code` instead
alias ci="code-insiders"
alias cls="clear"
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias e="exit"
alias .editorconfig="curl https://raw.githubusercontent.com/NdagiStanley/repo-boiler-plate/main/.editorconfig > .editorconfig"
alias g="git"
alias gcs="git checkout staging"
alias glogat="git log --graph --all --pretty='format:%C(auto)%h %d %s (%ah)'" # at for --all & time (format:%ah)
alias gpo="git push origin"
alias grao="git remote add origin"
alias h="history"
alias hs="python3 -m http.server"
alias md="cd ~/Projects/MD"
alias notify="tput bel & say done"
alias .netlify="curl https://raw.githubusercontent.com/NdagiStanley/repo-boiler-plate/main/netlify.toml > netlify.toml"
alias p="cd ~/Projects"
alias reload="source ~/.zshrc"
alias wifi-off='networksetup -setairportpower en0 off'
alias wifi-on='networksetup -setairportpower en0 on'
alias bt-off='blueutil -p off'
alias bt-on='blueutil -p on'
alias offline='wifi-off & bt-off'
alias online='wifi-on & bt-on'
# More Directories (To add more specific workstation directories, do so in this format)
alias cci="cd ~/Projects/Work/cci"
alias cito="cd ~/Projects/Work/CITO"
alias ks="cd ~/Projects/Work/KS"
alias nm="cd ~/Projects/Work/NM"
alias nt="cd ~/Projects/Work/NT"
alias or="cd ~/Projects/Work/OR"
alias tk="cd ~/Projects/Work/TK"
alias tm="cd ~/Projects/Work/TM"
# Brew
alias binfo="brew info"
alias bi="brew install"
alias bic="brew install --cask"
alias bl="brew list"
alias blc="brew list --cask"
alias bs="brew search"
alias bui="brew uninstall"
alias buic="brew uninstall --cask"
alias mdbrew="brew update && brew upgrade && brew cu -a && brew cleanup"
alias vlc="/Applications/VLC.app/Contents/MacOS/VLC --extraintf=http --http-password=vlcdirect"
# NPM
alias ni="npm install"
alias nui="npm uninstall"
alias nig="npm install --global"
alias nuig="npm uninstall --global"
alias kill="npx kill-port"
# Python
alias bpy="bpython"
alias ipy="ipython"
alias par="pip-autoremove"
alias pc="pip-chill"
alias pcc="pc | grep -v 'autopep8' | grep -v 'pip-autoremove' | grep -v 'flake8' | grep -v 'pip-chill'"
alias pf="python3 -m pip freeze"
alias pi="python3 -m pip install"
alias pui="python3 -m pip uninstall"
alias ptpy="ptpython"
alias py2="python2"
alias py="python3"
# Docker
alias d-reset="sh ~/dotfiles/code/docker_reset.sh"
alias d="docker"
alias dc="docker compose"
alias di="docker images"
# DB
alias pg-start="launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist"
alias pg-stop="launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist"
# Simplify the command for opening browser Chrome and Arc
alias ch="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
alias arc="/Applications/Arc.app/Contents/MacOS/Arc"
# Get week number
alias week='date +%V'
# Lock the screen (when going AFK - Away from Keyboard)
alias afk="pmset displaysleepnow"
# Remove duplicates in the “Open With” menu
alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user"
# Recursively delete `.DS_Store` files
alias cleanup="sudo find . -type f -name '*.DS_Store' -ls -delete && emptytrash && docker system prune"
# Empty the Trash on all mounted volumes and the main HDD.
# Also, clear Apple’s System Logs to improve shell startup speed.
# Finally, clear download history from quarantine. https://mths.be/bum
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl; sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'"
# Show/hide hidden files in Finder
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Hide/show all desktop icons (useful when presenting)
alias hidedt="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdt="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
# Stopwatch
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
# Get macOS Software Updates, and update Homebrew, npm, and their installed packages as well as Oh My Zsh
alias update='sudo softwareupdate -i -a; mdbrew; npm install npm -g; npm update -g; omz update'
# IP addresses
alias ip="curl ifconfig.me"
alias localip="ipconfig getifaddr en0"
alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
# CZ
alias czc="cz -n cz_gitmoji c"
alias czcc="cz c && ggpush && notify"