+grml-etc-core (0.3.17) unstable; urgency=low
+
+ The 'Man, what a lazy folk'-release
+ * /etc/skel/.zshrc:
+ - added function weather() to retrieve weather information on
+ the console
+ * /etc/zsh/zshrc:
+ - added alias S for screen
+ - alias s for ssh
+ - added alias top10 to get the top 10 shell commands from the history
+
+ -- Michael Prokop <mika@grml.org> Tue, 17 Jul 2007 15:48:48 +0200
+
grml-etc-core (0.3.16) unstable; urgency=low
* /etc/zsh/zshrc: dchange() - restore old behaviour with
if [ -x $(which mrxvt) ] ; then
isutfenv && [ -n "$LANG" ] && alias mrxvt="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} mrxvt"
fi
-
+
if [ -x $(which aterm) ] ; then
isutfenv && [ -n "$LANG" ] && alias aterm="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} aterm"
fi
-
+
if [ -x $(which centericq) ] ; then
isutfenv && [ -n "$LANG" ] && alias centericq="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} centericq"
fi
fi
}
+# retrieve weather information on the console
+# Usage example: 'weather LOWG'
+ weather () {
+ [ -n "$1" ] || {
+ print 'Usage: weather <station_id>' >&2
+ return 1
+ }
+
+ local PLACE="${1:u}"
+ local FILE="$HOME/.weather/$PLACE"
+ local LOG="$HOME/.weather/log"
+
+ [ -d $HOME/.weather ] || {
+ print -n "Creating $HOME/.weather: "
+ mkdir $HOME/.weather
+ print 'done'
+ }
+
+ print "Retrieving information for ${PLACE}:"
+ print
+ wget -T 10 --no-verbose --output-file=$LOG --output-document=$FILE --timestamping http://weather.noaa.gov/pub/data/observations/metar/decoded/$PLACE.TXT
+
+ if [[ $? = 0 ]] ; then
+ if [ -n "$VERBOSE" ] ; then
+ cat $FILE
+ else
+ DATE=$(grep 'UTC' $FILE | sed 's#.* /##')
+ TEMPERATURE=$(awk '/Temperature/ { print $4"° Celcius / " $2"° Fahrenheit" }' $FILE| tr -d '(')
+ echo "date: $DATE"
+ echo "temp: $TEMPERATURE"
+ fi
+ else
+ print "There was an error retrieving the weather information for $PLACE" >&2
+ cat $LOG
+ return 1
+ fi
+ }
+
+
# }}}
# mercurial related stuff {{{
#
# Global Order: zshenv, zprofile, zshrc, zlogin
################################################################################
-#
-# zsh-refcard-tag documentation:
+
+# zsh-refcard-tag documentation: {{{
# You may notice strange looking comments in the zshrc (and ~/.zshrc as
# well). These are there for a purpose. grml's zsh-refcard can now be
# automatically generated from the contents of the actual configuration
# and what lines of code to take into account (and for what purpose).
#
# Here is what they mean:
-#{{{
+#
# List of tags (comment types) used:
# #a# Next line contains an important alias, that should
# be included in the grml-zsh-refcard.
# I like clean prompt, so provide simple way to get that
alias 0 &>/dev/null || functions 0 &>/dev/null || alias 0='return 0'
+# for really lazy people like mika:
+ type S &>/dev/null || alias S='screen'
+ type s &>/dev/null || alias s='ssh'
+
+# get top 10 shell commands:
+ alias top10='print -l ? ${(o)history%% *} | uniq -c | sort -nr | head -n 10'
+
# truecrypt; use e.g. via 'truec /dev/ice /mnt/ice' or 'truec -i'
if [ -x $(which truecrypt) ] ; then
if isutfenv ; then