-
Notifications
You must be signed in to change notification settings - Fork 0
/
.shell_common
78 lines (59 loc) · 1.64 KB
/
.shell_common
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
# This file contains shell instructions/ aliases/ functions/ etc. that should work for most shells
_os=$(uname)
# VARIABLES
export MANPATH="/usr/local/man:${MANPATH}"
export PATH="${PATH}:/usr/local/bin:${HOME}/.local_tools/"
export LC_ALL=en_US.UTF-8
export LANG=$LC_ALL
export EDITOR='vim'
if [[ $_os == Darwin || $_os =~ .*BSD ]]; then
LS_OPTIONS='-lhFs'
else
LS_OPTIONS='--color=always -lhFs --time-style=long-iso'
fi
# ALIASES
alias ..='cd ../'
alias ...='cd ../../'
alias atc_uptodate='apt-get update && apt-get upgrade'
alias gdc='git diff --cached'
alias grep="grep -E --color=auto -nI --exclude-dir={.bzr,.cvs,.git,.hg,.svn}"
alias j='jobs -l'
alias l="ls -a ${LS_OPTIONS}"
alias la="ls -A ${LS_OPTIONS}"
alias ll="ls ${LS_OPTIONS}"
alias lhistory='fc -lfDE -1000'
alias mtr_dns='mtr --report --report-wide'
alias mtr_nodns='mtr --report --report-wide --no-dns'
alias salt='time salt -v'
alias sudo='sudo ' # Make alias lookup
alias s='sudo ' # Make alias lookup
alias ta='tail -f'
alias tree='tree -aFC --charset=ascii'
if [[ $_os == Darwin || $_os =~ .*BSD ]]; then
alias cp='cp'
alias mv='mv'
alias rm='rm'
alias ports='netstat tulpena'
else
alias chgrp='chgrp --preserve-root'
alias chmod='chmod --preserve-root'
alias chown='chown --preserve-root'
alias cp='cp -i'
alias diff="colordiff -u"
alias fwrules='iptables -nvL --line-numbers'
alias fw6rules='ip6tables -nvL --line-numbers'
alias ls="ls --color=tty"
alias mv='mv -i'
alias ports='netstat -tulpena'
alias rm='rm -i'
fi
# MISC
halt() {
l8security "/sbin/shutdown -hf +1"
}
reboot() {
l8security "/sbin/shutdown -rf +1"
}
checksum() {
sha256sum $@
}