-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_aliases.symlink
76 lines (60 loc) · 2.11 KB
/
.bash_aliases.symlink
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
#!/bin/bash
# overriding default utils
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# ls
if [[ $(uname -s) == 'Linux' ]]; then
alias ls='ls --color=auto -F'
elif [[ $(uname -s) == 'Darwin' ]]; then
alias ls='ls -G -F'
fi
alias ll='ls -l'
# kitty/ssh
# https://sw.kovidgoyal.net/kitty/faq.html#i-get-errors-about-the-terminal-being-unknown-or-opening-the-terminal-failing-when-sshing-into-a-different-computer
if [[ $TERM == 'xterm-kitty' ]]; then
alias ssh='kitty +kitten ssh'
fi
alias icat='kitty +kitten icat'
# ripgrep
alias rg='RIPGREP_CONFIG_PATH=~/.ripgreprc rg'
# kitty + ripgrep
alias kg='RIPGREP_CONFIG_PATH=~/.ripgreprc kitty +kitten hyperlinked_grep'
# learn2type
alias gti='git'
# tools
alias py2html='pygmentize -f html -O full,style=native'
alias ddprogress='killall -USR1 dd'
alias top=htop
alias webserver='python -m SimpleHTTPServer'
alias git-today='git diff @{yesterday}..HEAD'
alias find-broken-links='find . -type l -exec test ! -e {} \; -print'
# virtualbox
alias ls-vms='VBoxManage list vms'
# nodejs
alias npm-exec='PATH=$(npm bin):$PATH'
alias how-many-npm='find . -name "node_modules" | awk -F "node_modules" '\''NF>=2 {print $(NF-1)}'\'' | sort -u | wc -l'
# docker
alias dockercleancontainers="docker ps -a --no-trunc | grep 'Exit' | awk '{print \$1}' | xargs -L 1 -r docker rm"
alias dockercleanimages="docker images -a --no-trunc | grep none | awk '{print \$3}' | xargs -L 1 -r docker rmi"
alias dockerclean="dockercleancontainers && dockercleanimages"
alias dip="docker inspect --format '{{ .NetworkSettings.IPAddress }}'"
alias docker-dev='docker-machine start dev ; eval "$(docker-machine env dev)"'
# Linux specific aliases
if [[ $(uname) != 'Darwin' ]]; then
alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'
if [ $(type -P xdg-open) ]; then
alias open='xdg-open'
fi
fi
# fucking DNS cache
if [[ $(uname -s) == 'Darwin' ]]; then
alias kill-dns-cache='sudo killall -HUP mDNSResponder'
fi
# emoji
alias shrug='echo "¯\_(ツ)_/¯" | pbcopy'
# strip formatting
alias pbclean='pbpaste | pbcopy'
# ugh apple
alias unquarantine='xattr -d com.apple.quarantine'