1+ # Reload Shell
2+ alias reload=". ~/.zshrc"
3+
4+
5+ # ---------------------------------------------------------------------
6+ # Path Shortcuts
7+ # ---------------------------------------------------------------------
8+ alias appsupport='cd ~/Library/Application\ Support'
9+ alias apps='cd ~/Applications'
10+ alias desktop='cd ~/Desktop'
11+ alias documents='cd ~/Documents'
12+ alias dotfiles='cd ~/Projects/dotfiles'
13+ alias downloads='cd ~/Downloads'
14+ alias home='cd ~'
15+ alias library='cd ~/Library'
16+ alias onedrive='cd ~/OneDrive'
17+ alias projects='cd ~/Projects'
18+ alias sites='cd ~/Sites'
19+ alias transfer='cd ~/OneDrive/Transfer'
20+
21+ # Projects
22+ alias codeyard='cd ~/Projects/codeyard'
23+ alias cashtml='cd ~/Projects/cas-html5'
24+ alias cassd='cd ~/Projects/cas-sd'
25+ alias wogv3='cd ~/Projects/WoG/wog-v3'
26+
27+ # Download
28+ alias bandcamp-dl='youtube-dl --output "~/Downloads/Mp3/%(title)s.%(ext)s"'
29+ alias youtube-mp3='youtube-dl --output "~/Downloads/Mp3/%(title)s.%(ext)s" --extract-audio --audio-format mp3'
30+ alias youtube-mp4='youtube-dl --output "~/Downloads/%(title)s.%(ext)s" --format mp4'
31+
32+
33+
34+
35+ # ---------------------------------------------------------------------
36+ # Apache
37+ # ---------------------------------------------------------------------
38+
39+ # Open Apache Folder
40+ alias apaopen='open /etc/apache2'
41+
42+ # Edit Apache Configuration
43+ alias apaconf='code /private/etc/apache2/httpd.conf'
44+
45+ # Edit Apache Virtual Hosts
46+ alias apahosts='code /private/etc/apache2/extra/httpd-vhosts.conf'
47+
48+ # Open Apache Error Log
49+ alias apalog='code /private/var/log/apache2/error_log'
50+
51+ # Start, Stop, Restart Apache
52+ alias aparestart='sudo apachectl restart'
53+ alias apastop='sudo apachectl stop'
54+ alias apastart='sudo apachectl start'
55+
56+ # Test Apache Syntax
57+ alias apatest='sudo apachectl -t'
58+
59+
60+
61+
62+ # ---------------------------------------------------------------------
63+ # Docker
64+ # ---------------------------------------------------------------------
65+ alias dockstart='docker start cfelastic mssql'
66+ alias dockstop='docker stop cfelastic mssql'
67+ alias dcfrestart='docker restart cfelastic'
68+ alias dockcf='docker exec -it cfelastic bash'
69+ alias docksql='docker exec -it mssql bash'
70+
71+
72+
73+
74+ # ---------------------------------------------------------------------
75+ # Hosts
76+ # ---------------------------------------------------------------------
77+
78+ # Edit Hosts File
79+ alias hhosts='code /etc/hosts'
80+
81+ # Flush Hosts File Cache
82+ alias flushhosts='dscacheutil -flushcache'
83+
84+
85+
86+
87+ # ---------------------------------------------------------------------
88+ # Abbreviations
89+ # ---------------------------------------------------------------------
90+
91+ # Directory Browsing
92+ alias ..='cd ..'
93+ alias ...='cd ../..'
94+ alias ....='cd ../../..'
95+ alias .3='cd ../../..'
96+ alias .4='cd ../../../..'
97+ alias .5='cd ../../../../..'
98+ alias .6='cd ../../../../../..'
99+
100+ alias _='sudo'
101+ alias c='clear'
102+ alias g='git'
103+
104+ # Get week number
105+ alias week='date +%V'
106+
107+
108+
109+
110+ # ---------------------------------------------------------------------
111+ # List & Tree
112+ # ---------------------------------------------------------------------
113+
114+ # List all in long, ungrouped, human-readable format
115+ alias la='ls -lhaoG'
116+
117+ # List in long, ungrouped, human-readable format
118+ alias ll='ls -lhoG'
119+
120+ # List directories instead of contents, and do not dereference symbolic links
121+ alias ld='ls -ldo */'
122+
123+ # List only directories & files
124+ alias l1='ls -1'
125+
126+ # Tree: include hidden files
127+ alias treea='tree -aC --dirsfirst'
128+
129+ # Tree: list directories only
130+ alias treed='tree -dC'
131+
132+ # File size
133+ alias fsize="stat -f \"%z bytes\""
134+
135+
136+
137+
138+ # ---------------------------------------------------------------------
139+ # Network Utils
140+ # ---------------------------------------------------------------------
141+
142+ # Get IP Addresses
143+ alias localip='ipconfig getifaddr en1'
144+ alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ and print $1'"
145+
146+ alias myip='curl ipecho.net/plain; echo'
147+ #alias myip='dig +short myip.opendns.com @resolver1.opendns.com'
148+
149+
150+
151+
152+ # ---------------------------------------------------------------------
153+ # Mac OS X Utils
154+ # ---------------------------------------------------------------------
155+
156+ # Activity Monitor
157+ alias monitor='top -o cpu'
158+ alias top25='top -o cpu -n 25'
159+ alias topmem='top -o mem'
160+
161+ # List running processes
162+ alias processes="command ps -SAcr -o 'uid,pid,ppid,time,rss,command'"
163+
164+ # Mute, Unmute
165+ alias mute="osascript -e 'set volume output muted true'"
166+ alias unmute="osascript -e 'set volume output muted false'"
167+
168+ # Disable Startup Chime
169+ alias nochime="sudo nvram SystemAudioVolume=%01"
170+
171+ # Hide/show all desktop icons (useful when presenting)
172+ alias showdeskicons='defaults write com.apple.finder CreateDesktop -bool true && killall Finder'
173+ alias hidedeskicons='defaults write com.apple.finder CreateDesktop -bool false && killall Finder'
174+
175+ # Launch iOS Simulator
176+ alias iossim="open -a /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app"
177+
178+ # Lock screen
179+ alias lock="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
180+
181+
182+
183+ # MAINTENANCE
184+
185+ # Update Homebrew packages
186+ alias brewupd='brew update; brew upgrade; brew cleanup'
187+
188+ # Update Node packages
189+ alias npmupd='npm update npm -g; npm update -g'
190+
191+ # Update Homebrew & Node packages
192+ alias update='brew update; brew upgrade; brew cleanup; npm update npm -g; npm update -g'
193+
194+ # Flush Directory Service cache
195+ alias flush='dscacheutil -flushcache'
196+
197+ # Free up inactive Memory
198+ alias purge='sudo purge'
199+
200+ # Empty the Trash
201+ alias emptytrash='rm -rfv ~/.Trash'
202+
203+ # Empty the Trash on all mounted volumes and the main HDD
204+ # Also, clear Apple’s System Logs to improve shell startup speed
205+ alias emptyalltrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
206+
207+ # Recursively delete `.DS_Store` files
208+ alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
209+
210+ # Enable, Disable Spotlight
211+ alias spotoff='sudo mdutil -a -i off'
212+ alias spoton='sudo mdutil -a -i on'
213+
214+ # Hide the Spotlight Menu Icon
215+ alias spothide='sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search; killall SystemUIServer'
216+
217+ # Remove Double 'Open With' Entries
218+ alias cleanopenwith='/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder'
219+
220+
221+
222+
223+ # ---------------------------------------------------------------------
224+ # Utilities
225+ # ---------------------------------------------------------------------
226+
227+ # Generate Random Password
228+ alias randpw='dd if=/dev/urandom bs=1 count=12 2>/dev/null | base64 | rev | cut -b 2- | rev'
229+
230+ # Generate Random Password and copy to clipboard
231+ alias randpwc='dd if=/dev/urandom bs=1 count=12 2>/dev/null | base64 | rev | cut -b 2- | rev | pbcopy'
232+
233+ # grep with color
234+ alias grep='grep --color=auto'
235+
236+ # Weather Forecast for Bern
237+ alias weather='curl http://wttr.in/bern'
0 commit comments