-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ubuntu
59 lines (48 loc) · 1.4 KB
/
.ubuntu
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
# Ubuntu specific dotfile for zsh
# Workaround for missing distro icons
OS_ICON='\uE271'
#
# Antibody bundles
#
antidote bundle ohmyzsh/ohmyzsh path:plugins/ubuntu >~/.zsh_plugins.zsh
#
# Ubuntu specific aliases
#
alias ports='sudo netstat -tulpen'
#
# Ubuntu functions
#
function localip(){
echo "📶 "$(ip addr show | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)
}
function apt-history(){
case "$1" in
install)
grep 'install ' /var/log/dpkg.log
;;
upgrade|remove)
grep $1 /var/log/dpkg.log
;;
rollback)
grep upgrade /var/log/dpkg.log | \
grep "$2" -A10000000 | \
grep "$3" -B10000000 | \
awk '{print $4"="$5}'
;;
*)
cat /var/log/dpkg.log
;;
esac
}
function apt-install-history(){
comm -23 <(find /var/log/apt/ -name "history.*" -exec zsh -c "zgrep 'apt-get install' {}" \; | sed 's/.* //' | sort) <(find /var/log/apt/ -name "history.*" -exec zsh -c "zgrep 'apt-get remove' {}" \; | sed 's/.* //' | sort)
}
function 4ktofhd(){
ffmpeg -i $1 -vf scale=1920:1080 -c:v libx264 -crf 20 -preset slow fhd-$1
}
function cleanSnaps(){
snap list --all | awk '/deaktiviert/{print $1, $3}' |
while read snapname revision; do
sudo snap remove "$snapname" --revision="$revision"
done
}