-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
56 lines (42 loc) · 1.91 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
#!/bin/bash
# Custom ls
# Use exa(https://github.com/ogham/exa) if present
if hash exa 2>/dev/null; then
alias ls="exa -al"
else
alias ls="ls -aGl"
fi
# Tree
alias tree='tree -CA'
# Undo a `git push`
alias undopush="git push -f origin HEAD^:master"
# IP addresses
alias ip="curl ifconfig.me"
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
# Enhanced WHOIS lookups
alias whois="whois -h whois-servers.net"
# Flush Directory Service cache
alias flush="dscacheutil -flushcache"
# View HTTP traffic
alias sniff="sudo ngrep -d 'en0' -t '^(GET|POST) ' 'tcp and port 80'"
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\""
# OS X has no `md5sum`, so use `md5` as a fallback
type -t md5sum > /dev/null || alias md5sum="md5"
# Trim new lines and copy to clipboard
alias trimcopy="tr -d '\n' | pbcopy"
# Recursively delete `.DS_Store` files
alias cleanup="find . -name '*.DS_Store' -type f -ls -delete"
# File size
alias fs="stat -f \"%z bytes\""
# Empty the Trash on all mounted volumes and the main HDD
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; rm -rfv ~/.Trash"
# Hide/show all desktop icons (useful when presenting)
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
#Other
alias ftp_server_start='sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist'
alias ftp_server_stop='sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist'
alias postgresql_server_start='launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist'
alias postgresql_server_stop='launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist'
alias redis_start='launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist'
alias redis_stop='launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist'