#a3# Execute \kbd{grep-excuses}
alias ge='grep-excuses'
- # debian upgrade
- #f3# Execute \kbd{apt-get update \&\& }\\&\quad \kbd{apt-get dist-upgrade}
- upgrade() {
- emulate -L zsh
- if [[ -z $1 ]] ; then
- $SUDO apt-get update
- $SUDO apt-get -u upgrade
- else
- ssh $1 $SUDO apt-get update
- # ask before the upgrade
- local dummy
- ssh $1 $SUDO apt-get --no-act upgrade
- echo -n 'Process the upgrade?'
- read -q dummy
- if [[ $dummy == "y" ]] ; then
- ssh $1 $SUDO apt-get -u upgrade --yes
- fi
- fi
- }
-
# get a root shell as normal user in live-cd mode:
if isgrmlcd && [[ $UID -ne 0 ]] ; then
alias su="sudo su"
print 'Finished, running "swapoff -a; swapon -a" may also be useful.'
}
-# spawn a minimally set up mksh - useful if you want to umount /usr/.
-minimal-shell() {
- emulate -L zsh
- local shell="/bin/mksh"
-
- if [[ ! -x ${shell} ]]; then
- printf '`%s'\'' not available, giving up.\n' ${shell} >&2
- return 1
- fi
-
- exec env -i ENV="/etc/minimal-shellrc" HOME="$HOME" TERM="$TERM" ${shell}
-}
-
# a wrapper for vim, that deals with title setting
# VIM_OPTIONS
# set this array to a set of options to vim you always want
}
#f5# Create Directoy and \kbd{cd} to it
-mcd() {
+mkcd() {
mkdir -p "$@" && cd "$@"
}
+
#f5# Create temporary directory and \kbd{cd} to it
cdt() {
local t
#k# mkdir -p <dir> from string under cursor or marked area
zle -N inplaceMkDirs && bindkey '^XM' inplaceMkDirs
-# Function Usage: doc packagename
-#f5# \kbd{cd} to /usr/share/doc/\textit{package}
-doc() {
- emulate -L zsh
- cd /usr/share/doc/$1 && ls
-}
-_doc() { _files -W /usr/share/doc -/ }
-check_com compdef && compdef _doc doc
-
-#f5# Make screenshot
-sshot() {
- [[ ! -d ~/shots ]] && mkdir ~/shots
- #cd ~/shots ; sleep 5 ; import -window root -depth 8 -quality 80 `date "+%Y-%m-%d--%H:%M:%S"`.png
- cd ~/shots ; sleep 5; import -window root shot_`date --iso-8601=m`.jpg
-}
-
#f5# List files which have been accessed within the last {\it n} days, {\it n} defaults to 1
accessed() {
emulate -L zsh