ce41d0e5bdf7df7e4261ad6e5b3e3c0fa59dd890
- Author
- Daniel Bolton <danielbarrettbolton@gmail.com>
- Committer
- Daniel Bolton <danielbarrettbolton@gmail.com>
- Date
Message
Add debian plugins file
Diff
1diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
2new file mode 100644
3index 0000000000000000000000000000000000000000..f8865a41210d3318525e867734cffd7cbe5bb7b2
4--- /dev/null
5+++ b/plugins/debian/debian.plugin.zsh
6@@ -0,0 +1,60 @@
7+# https://github.com/dbbolton/
8+#
9+# Debian-related zsh aliases and functions for zsh
10+
11+
12+# Aliases ###################################################################
13+
14+# Some self-explanatory aliases
15+alias afs='apt-file search --regexp'
16+alias aps='aptitude search'
17+alias apsrc='apt-get source'
18+alias apv='apt-cache policy'
19+
20+alias apdg='su -c "aptitude update && aptitude safe-upgrade"'
21+alias apud='su -c "aptitude update"'
22+alias apug='su -c "aptitude safe-upgrade"'
23+
24+# print all installed packages
25+alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
26+
27+# Install all .deb files in the current directory.
28+# Warning: you will need to put the glob in single quotes if you use:
29+# glob_subst
30+alias di='su -c "dpkg -i ./*.deb"'
31+
32+# Create a basic .deb package
33+alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
34+
35+# Remove ALL kernel images and headers EXCEPT the one in use
36+alias kclean='su -c '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))'\'' root'
37+
38+
39+
40+# Functions #################################################################
41+
42+# create a simple script that can be used to 'duplicate' a system
43+apt-copy() {
44+ print '#!/bin/sh'"\n" > apt-copy.sh
45+
46+ list=$(perl -m'AptPkg::Cache' -e '$c=AptPkg::Cache->new; for (keys %$c){ push @a, $_ if $c->{$_}->{'CurrentState'} eq 'Installed';} print "$_ " for sort @a;')
47+
48+ print 'aptitude install '"$list\n" >> apt-copy.sh
49+
50+ chmod +x apt-copy.sh
51+}
52+
53+
54+# Kernel-package building shortcut
55+dbb-build () {
56+ MAKEFLAGS='' # temporarily unset MAKEFLAGS ( '-j3' will fail )
57+ appendage='-custom' # this shows up in $ (uname -r )
58+ revision=$(date +"%Y%m%d") # this shows up in the .deb file name
59+
60+ make-kpkg clean
61+
62+ time fakeroot make-kpkg --append-to-version "$appendage" --revision \
63+ "$revision" kernel_image kernel_headers
64+}
65+
66+