f50b3fe7107d4bb6a9439a4032ac6922b9c0c20b
- Author
- nextgenthemes <nextgenthemes@users.noreply.github.com>
- Committer
- nextgenthemes <nextgenthemes@users.noreply.github.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh
2new file mode 100644
3index 0000000000000000000000000000000000000000..0211d33742577092cf8902b4e83cb0761d9d7433
4--- /dev/null
5+++ b/plugins/ubuntu/ubuntu.plugin.zsh
6@@ -0,0 +1,141 @@
7+# Authors:
8+# https://github.com/AlexBio
9+# https://github.com/dbb
10+# https://github.com/Mappleconfusers
11+# Nicolas Jonas nextgenthemes.com
12+#
13+# Debian, Ubuntu and friends related zsh aliases and functions for zsh
14+
15+alias acs='apt-cache search'
16+compdef _acs acs='apt-cache search'
17+
18+alias afs='apt-file search --regexp'
19+compdef _afs afs='apt-file search --regexp'
20+
21+# These are apt-get only
22+alias ags='apt-get source' # asrc
23+compdef _ags ags='apt-get source'
24+
25+alias acp='apt-cache policy' # app
26+compdef _acp acp='apt-cache policy'
27+
28+# superuser operations ######################################################
29+alias afu='sudo apt-file update'
30+compdef _afu afu='sudo apt-file update'
31+
32+alias ppap='sudo ppa-purge'
33+compdef _ppap ppap='sudo ppa-purge'
34+
35+alias ag='sudo apt-get' # age - but without sudo
36+alias aga='sudo apt-get autoclean' # aac
37+alias agb='sudo apt-get build-dep' # abd
38+alias agc='sudo apt-get clean' # adc
39+alias agd='sudo apt-get dselect-upgrade' # ads
40+alias agi='sudo apt-get install' # ai
41+alias agp='sudo apt-get purge' # ap
42+alias agr='sudo apt-get remove' # ar
43+alias agu='sudo apt-get update' # ad
44+alias agud='sudo apt-get update && sudo apt-get dist-upgrade' #adu
45+alias agug='sudo apt-get upgrade' # ag
46+alias aguu='sudo apt-get update && sudo apt-get upgrade' #adg
47+
48+compdef _ag ag='sudo apt-get'
49+compdef _aga aga='sudo apt-get autoclean'
50+compdef _agb agb='sudo apt-get build-dep'
51+compdef _agc agc='sudo apt-get clean'
52+compdef _agd agd='sudo apt-get dselect-upgrade'
53+compdef _agi agi='sudo apt-get install'
54+compdef _agp agp='sudo apt-get purge'
55+compdef _agr agr='sudo apt-get remove'
56+compdef _agu agu='sudo apt-get update'
57+compdef _agud agud='sudo apt-get update && sudo apt-get dist-upgrade'
58+compdef _agug agug='sudo apt-get upgrade'
59+compdef _aguu aguu='sudo apt-get update && sudo apt-get upgrade'
60+
61+# Remove ALL kernel images and headers EXCEPT the one in use
62+alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
63+ ?not(~n`uname -r`))'
64+
65+# Misc. #####################################################################
66+# print all installed packages
67+alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
68+
69+# Create a basic .deb package
70+alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
71+
72+# apt-add-repository with automatic install/upgrade of the desired package
73+# Usage: aar ppa:xxxxxx/xxxxxx [packagename]
74+# If packagename is not given as 2nd arument the function will ask for it and guess the defaupt by taking
75+# the part after the / from the ppa name wich is sometimes the right name for the package you want to install
76+aar() {
77+ if [ -n "$2" ]; then
78+ PACKAGE=$2
79+ else
80+ read "PACKAGE?Type in the package name to install/upgrade with this ppa [${1##*/}]: "
81+ fi
82+
83+ if [ -z "$PACKAGE" ]; then
84+ PACKAGE=${1##*/}
85+ fi
86+
87+ sudo apt-add-repository $1 && sudo apt-get update
88+ sudo apt-get install $PACKAGE
89+}
90+
91+# Prints apt history
92+# Usage:
93+# apt-history install
94+# apt-history upgrade
95+# apt-history remove
96+# apt-history rollback
97+# apt-history list
98+# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
99+apt-history () {
100+ case "$1" in
101+ install)
102+ zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*)
103+ ;;
104+ upgrade|remove)
105+ zgrep --no-filename $1 $(ls -rt /var/log/dpkg*)