-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc.aliases
155 lines (129 loc) · 3.23 KB
/
.bashrc.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
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
#
# ~/.bashrc.aliases
#
alias ls='ls --color=auto'
alias cleanpacman='sudo pacman -Scc'
alias cleanpacaur='pacaur -Scc'
alias pacrepo='sudo reflector -l 20 -f 10 --save /etc/pacman.d/mirrorlist'
#alias pacman='sudo pacman'
alias synctime="sudo ntpd -qg"
alias lsorphanpacman="pacman -Qtdq"
alias lsorphanpacaur="pacaur -Qtdq"
alias rmorphanpacman="pacman -Qtdq | pacman -Rns -"
alias rmorphanpacaur="pacaur -Qtdq | pacaur -Rns -"
alias journalctl='sudo journalctl'
alias pacu='sudo pacman -Syu --noconfirm'
#alias auru='yaourt -Syua --noconfirm'
alias systemctl='sudo systemctl'
alias se='ls /usr/bin | grep'
export QT_STYLE_OVERRIDE=gtk
export QT_SELECT=qt5
if [[ $LANG = '' ]]; then
export LANG=en_US.UTF-8
fi
# from MANJARO
alias vimrc="vim ~/.vimrc"
alias bashrc="vim ~/.bashrc && source ~/.bashrc"
alias sbash="source ~/.bashrc"
alias ls="ls --color=auto"
alias ll="ls -lrtha"
alias mkdir='mkdir -p'
hb()
{
read -p "Are you sure you want to hiberante? [Yy] for yes: " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
# do dangerous stuff
echo 'hibernating now... '
sleep 3
sudo systemctl hibernate
fi
}
po()
{
read -p "Are you sure you want to shutdown? [Yy] for yes: " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
# do dangerous stuff
echo 'shutting down now... '
sleep 3
poweroff
fi
}
rb()
{
read -p "Are you sure you want to reboot? [Yy] for yes: " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
# do dangerous stuff
echo 'rebooting now... '
sleep 3
reboot
fi
}
alias x='exit'
alias c='clear'
alias h='history'
alias hg='history | grep'
alias j='jobs -l'
alias ports='netstat -tulanp'
alias vi=vim
alias svi='sudo vi'
alias vis='vim "+set si"'
alias edit='vim'
## pass options to free ##
alias meminfo='free -h -l -t'
## get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
## get top process eating cpu ##
alias pscpu='ps auxf | sort -nr -k 3'
alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
## Get server cpu info ##
alias cpuinfo='lscpu'
## set some other defaults ##
alias df='df -H'
alias du='du -ch'
# safe rm in terminal
# self explanatory
alias trash-empty="gio trash --empty"
# for moving files to trash
alias rm="gio trash -f"
# for viewing contents of the trash
alias trash-list="gio list -h trash://"
# virtualenv python
alias actenv="source .venv/bin/activate"
# git
alias gst="git status"
alias gcm="git checkout master"
# cups and sane
alias scan="scanimage --device 'pixma:04A91751_893623' --progress " # --format=png --output-file test.png
alias print=""
#
# # ex - archive extractor
# # usage: ex <file>
ex ()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
alias adb=~/Android/Sdk/platform-tools/adb