-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.aliases
88 lines (65 loc) · 2.98 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
# replace common utilities with some improved replacements
alias cat='bat --wrap=never'
alias find='fd'
alias ls='exa -l --group-directories-first'
alias j='z'
alias jj='zi'
alias tree='tre'
alias fixcamera="sudo killall VDCAssistant; sudo killall AppleCameraAssistant"
alias ...="cd ../.."
alias asdf-install="cat .tool-versions | cut -d' ' -f1 | grep '^[^\#]' | xargs -I{} asdf plugin add {}; asdf install"
# copy last shell command into the clipboard
# fc -l == history builtin, awk command to remove trailing newline
alias clast="fc -ln -1 | awk '{printf \"%s\", \$0}' | pbcopy"
# TODO the username on this needs to be dynamic in some way
alias pisync='rsync -avh --filter=":- .gitignore" --progress $PWD pi@raspberrypi.local:~'
# fancier ping
alias ping='prettyping --nolegend'
# List all files colorized in long format, including dot files
alias la="exa -laF --group-directories-first"
# List only directories
alias lsd='exa -l -D'
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en1"
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
alias whois="whois -h whois-servers.net"
# Flush Directory Service cache
alias flushdns="sudo killall -HUP mDNSResponder"
# View HTTP traffic
alias sniff="sudo ngrep -d 'en0' -t '^(GET|POST) ' 'tcp and port 80'"
alias httpdump="sudo tcpdump -i en0 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\""
# Start an HTTP server from a directory
alias server="(sleep 0.1 && open http://localhost:8080/) & python -m http.server 8080"
# Trim new lines and copy to clipboard
alias c="tr -d '\n' | pbcopy"
# Dir shortcuts. Most of these aren't
alias p="cd ~/Projects"
# Edit current directory
alias e="code ."
# File size
alias fs="stat -f \"%z bytes\""
# git
alias g="hub"
alias gp="g push origin HEAD"
alias gpb='g pull --rebase origin `git rev-parse --abbrev-ref HEAD`'
alias gpf='g push --force origin HEAD'
alias git-add-origin="git remote add origin https://github.com/iloveitaly/$(basename $(pwd)).git"
# rails
alias rt="bundle exec rails test"
alias be="b exec"
alias b="bundle"
# elixir
alias imix="iex -S mix"
# python
alias poetry-pristine="poetry env remove python && poetry env use python && poetry install"
alias python-debugging-install="pip install ipdb rich ipython_autoimport docrepr pyfzf"
alias python-remove-pycache="fd --no-ignore-vcs __pycache__ | xargs rm -rf"
# 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"
# Toggle spotlight
alias spotoff="sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist && sudo mdutil -a -i off"
alias spoton="sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist && sudo mdutil -a -i on"
# PlistBuddy alias, because sometimes `defaults` just doesn’t cut it
alias plistbuddy="/usr/libexec/PlistBuddy"