-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot.bash_alias
157 lines (139 loc) · 4.13 KB
/
dot.bash_alias
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# Author: Jorge Pereira <[email protected]>
# Last Change: Mon Mar 6 11:36:57 2023
##
if [ -e "$HOME/.bash_alias_work" ]; then
decho "$HOME/.bash_alias_work"
source "$HOME/.bash_alias_work"
alias edit-alias-work="$EDITOR ~/.bash_alias_work && source ~/.bash_alias_work"
fi
#
# Personal sudo
#
[ -e "$HOME/bin/sudo" ] && alias sudo="$HOME/bin/sudo"
#
# Lazzy
#
if ls --help 2> /dev/null | grep -q "color"; then
alias ls="ls --color=auto"
else
alias ls="ls -G"
fi
# lazzy....
if ! type sl 1> /dev/null 2>&1; then
alias sl="ls"
alias sl-l="ls -l"
alias sl-la="ls -la"
fi
alias ls-l="ls -l"
alias ls-la="ls -la"
alias cd-="cd -"
alias cd..="cd .."
alias cd.="cd .."
alias d='ls'
alias mv='mv -iv'
alias rm='rm -iv'
alias p='pwd'
alias la='ls -lah'
alias l='ls -alF'
alias v='ls -la'
alias lsc='ls -1 | wc -l | cut -c 7'
alias lsdir='ls -lh | grep "^d"'
alias lsd='ls -ladh'
alias lsf='ls -lah | grep "^-"'
alias lsh='ls -a | grep "^\."'
alias lsiz='ls -alS'
alias lsnew='ls -lctr'
alias lsx='ls -lah | grep "^-..x"'
alias tm='tail -f /var/log/messages'
alias reload-bashrc="source ~/.bashrc"
alias set-editor-to-subl="export EDITOR='subl' EDITOR_OPTS='-w'"
alias set-editor-to-vim="export EDITOR='vim' EDITOR_OPTS=''"
#
# Dynamic aliases
#
_set-edit2alias "$HOME/.ssh/config" "sshconfig"
_set-edit2alias "$HOME/.ssh/config.hosts" "sshconfig.hosts"
_set-edit2alias "$HOME/.gdbinit"
_set-edit2alias "$HOME/.gitconfig"
_set-edit2alias "$HOME/.screenrc"
_set-edit2alias "$HOME/.vimrc"
_set-edit2alias "$HOME/.bash_alias"
_set-edit2alias "$HOME/.bash_functions"
_set-edit2alias "$HOME/.bash_profile"
_set-edit2alias "$HOME/.bash_profile-Darwin"
_set-edit2alias "$HOME/.bash_profile-Linux"
_set-edit2alias "$HOME/.bashrc"
_set-edit2alias "$HOME/.profile"
_set-dir2alias "$HOME/Devel"
_set-dir2alias "$HOME/Devel/github-jpereira"
_set-dir2alias "$HOME/Devel/FreeRADIUS"
#
# Devel commands
#
alias vi=vim
alias grep='grep --color'
alias grep-h="grep --include '*.h'"
alias grep-c="grep --include '*.c'"
alias cat-nocomments='grep -v -E "^($|.*#)"'
alias beep='echo -en "\x07"'
alias nobeep='setterm -blen 0'
alias gdb="gdb --silent"
alias rsync='rsync -Cdravzp --progress '
alias untar='tar -xzvf'
alias unbz='tar -xjfv'
alias visudo='sudo visudo'
alias ping='ping -c4'
#
# Misc
#
alias update-own2me="sudo chown -R $USER:$GROUP"
alias test-iperf3-torouter="iperf3 -c 192.168.1.254"
alias tohex="xxd -pu | sed 's/^/0x/g'"
alias toascii="xxd -rp"
alias whatismyip="curl api.ipify.org"
alias ifconfig.publicip="whatismyip"
#
# Scp/Ssh
#
alias ssh.nokey="ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no"
alias ssh.force-password="ssh.nokey"
alias scp.aws.ipv4="scp -i ~/Documents/Pessoais/Keys/SSH/aws-jorge1.pem"
alias ssh.aws.ipv4="ssh -i ~/Documents/Pessoais/Keys/SSH/aws-jorge1.pem -l root"
alias ssh.halfdome="ssh -l root halfdome.lan"
alias ssh.dongle="ssh -l root dongle.lan"
alias ssh.router="ssh -l root router.lan"
alias ssh.capacete="ssh -l admin capacete.lan"
alias ssh.capacete-dev="ssh -l root capacete-ubuntu.lan"
alias ssh.tapioca="ssh -p 6922 -l root tapioca.mooo.com"
alias ssh.dev01="ssh -l root dev01.lan"
alias ssh.dev02="ssh -l root dev02.lan"
alias ssh.dev03="ssh -l root dev03.lan"
#
#
#
alias mysql.capacete="mysql -u root -proot -h capacete.lan"
#
# Linux
#
alias apt="sudo /usr/bin/apt"
alias aptf='apt -y install'
alias aptr='apt --reinstall install'
alias apt-search='apt-cache search'
alias apt-get='sudo /usr/bin/apt-get'
alias dpkg='sudo /usr/bin/dpkg'
alias iptables='sudo /sbin/iptables'
alias lockx="/usr/bin/xscreensaver-command -lock"
alias lynx-firefox='/usr/bin/lynx -useragent "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5 Lynx"'
alias noscanfs='tune2fs -c 0 -i 0'
alias reboot='sudo /sbin/reboot'
alias mrxvt="/usr/bin/mrxvt -rv -sr -fn 9x15 -title \"Terminal Mrxvt\" -g 90x30 -cr red -tnum 4"
alias wgetcookie='wget -c --load-cookies=$HOME/.mozilla/firefox/default/cookies.txt'
alias xterm="/usr/bin/xterm -fg white -bg black -fn 10x20"
alias psup='ps -ax -o etime,command -c | grep'
#
#
#
function pmake() {
echo "# make -j8 --load-average=$NCPU $@"
make -j8 --load-average=$NCPU $@
}