-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
61 lines (48 loc) · 2.01 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
# Easier navigation
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias -- -="cd -"
# Shortcuts
alias hm="cd ~/"
alias dt="cd ~/Desktop"
alias dl="cd ~/Downloads"
alias dev="cd ~/Developer"
alias bb="cd ~/Developer/bitbucket.org"
alias gh="cd ~/Developer/github.com"
alias gl="cd ~/Developer/gitlab.com"
# Apps
alias py="python3"
alias pgstart="postgres -D /usr/local/var/postgres"
# Docker shortcuts
alias dockerenv="eval '$(docker-machine env default)'"
alias dockersetup="docker-machine start default &> /dev/null; eval $(docker-machine env default)"
alias dockerrmall="docker stop $(docker ps -a -q); docker rm $(docker ps -a -q)"
alias dockerrmallimgd='docker rmi $(docker images -f "dangling=true" -q)'
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
else # OS X `ls`
colorflag="-G"
fi
# List all files colorized in long format
alias l="ls -lF ${colorflag}"
# List all files colorized in long format, including dot files
alias la="ls -laF ${colorflag}"
# List only directories
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
# Always enable colored `grep` output
alias grep='grep --color=auto '
# 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"
# Stopwatch
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
# View HTTP traffic
alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'"
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\""
# Processes and daemons
alias pg="postgres -D /usr/local/var/postgres"
# Clean up LaunchServices to 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 && killall Finder"