-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_functions
102 lines (101 loc) · 2.11 KB
/
.bash_functions
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
h2d(){
echo "ibase=16;${@^^}" | bc
}
d2h(){
echo "obase=16;$@" | bc
}
pickline(){
head -n $1 $2 | tail -n 1
}
tellme(){
grep $1 ~/PGround/Ref/Linux_Command
}
bigguy(){
echo "du -ah | sort -h | tail"
du -ah | sort -h | tail
}
restoremytime(){
echo "kill all unity-panel-service"
killall unity-panel-service
}
showkernelerrors(){
echo "dmesg -xT -l err,crit,emerg"
dmesg -xT -l err,crit,emerg
}
syncmytime(){
echo "sudo ntpdate ntp.ubuntu.com"
sudo ntpdate ntp.ubuntu.com
}
getmyfield(){
echo 'column -t | cut -d' ' -f$1'
column -t | cut -d' ' -f$1
}
alarmme(){
sleep $1 && notify-send $2 &
}
unmuteall(){
for i in Master Headphone PCM Front Surround Center LFE Side; do
amixer -c 0 set "$i" playback unmute
done &>/dev/null
}
unpackme(){
fn=$(echo "$1" | tr '[:upper:]' '[:lower:]')
echo "$fn"
case "$fn" in
*".tgz"|*.tar.gz)
echo "Unpacking targz or tgz";
tar xzvf $fn;;
*.lzh|*.lha)
echo "Unpacking lzh";
lha x $fn;;
*.zip)
echo "Unpacking zip";
unzip $fn;;
*.tar.bz2|*.tbz)
echo "Unpacking tar.bz2 or tbz";
tar xjvf $fn;;
*.bz2)
echo "Unpacking bz2";
bzip2 -d $fn;;
*.tar.xz)
echo "Unpacking tar.xz";;
*.7z)
echo "Unpacking 7z";;
*.rar)
echo "Unpacking rar";;
*.tar.Z)
echo "Unpacking tar.z";;
*.tar.bz2|*.tbz2)
echo "Unpacking tar.bz2 or tbz2";;
*.gz)
echo "Unpacking gz";
gunzip -d $fn;;
*.z)
echo "Unpacking z";;
*.tar)
echo "Unpacking tar";
tar xvf $fn;;
*.arj)
echo "Unpacking arj";;
*.cab)
echo "Unpacking cab";;
esac
}
findPid () {
echo 'lsof -t -c "$@"'
lsof -t -c "$@" ;
}
listmyusb(){
echo 'sudo fdisk -ls'
sudo fdisk -ls
}
ejectmyusb(){
echo 'udisks --detach /dev/sdb'
udisks --detach /dev/sdb
}
playmovie(){
nohup mplayer $1 &
}
colormycommand()(set -o pipefail;"$@" 2>&1>&3|sed $'s,.*,\e[31m&\e[m,'>&2)3>&1
export MOZILLA_FIVE_HOME=/usr/lib/firefox
PATH="$PATH":$HOME/mycommand