Mal wieder ein paar Pogonabilder

Bild: Motte
Motte (Aug. 18, 2014, 8:11 p.m.)
[Tags: barties ] [Album: Terrarium ]
Bild: Pebbles
Pebbles (Aug. 18, 2014, 8:11 p.m.)
[Tags: barties ] [Album: Terrarium ]
Bild: Louise
Louise (Aug. 18, 2014, 8:11 p.m.)
[Tags: barties ] [Album: Terrarium ]
Bild: Sir William
Sir William (Aug. 18, 2014, 8:11 p.m.)
[Tags: barties ] [Album: Terrarium ]
Bild: Godzilla
Godzilla (Aug. 18, 2014, 8:11 p.m.)
[Tags: barties ] [Album: Terrarium ]
Bild: Mr. Schreck
Mr. Schreck (Aug. 18, 2014, 8:11 p.m.)
[Tags: futter ] [Album: TheInternetz ]
Bild: Drei Damen vom Grill
Drei Damen vom Grill (Aug. 18, 2014, 8:12 p.m.)
[Tags: barties ] [Album: People ]

18.08.2014 20:11 CC0 Terrarium Null Kommentar






Datenschutz à la Teich-Forum.org

Ich habe ja immer noch meine 7 Rainbow Shiner, die ich noch irgendwie loswerden muss. In einem Aquariumforum habe ich sie seit längerem annonciert. Dort hat sich inzwischen ein Interessent gefunden, der die aber per DHL geliefert haben will. Ich habe ihm erklärt, dass das gar nicht erlaubt ist und dass die Pakete, die ich per DHL verschicke, üblicherweise einen bis mehrere Tage in Neumünster zwischengelagert werden, dass die Fische dann sterben würden. Er wollte trotzdem DHL. Dann hab ich ihm angeboten, die Hälfte der Go! Versandkosten zu übernehmen. Auch abgelehnt.

*Seufz*

Nun dachte ich mir, hey, die Shiner sind doch auch prima für den Teich geeignet. Da announciere ich sie halt in einem Teichforum. Einmal Google und ich bin auf www.teich-forum.org gestoßen, das wäre ideal. Man muss sich registrieren, wie üblich. Also hab ich mir meine übliche Tracking-Mail-Adresse angelegt, alles eingetragen und scrolle runter - und was sehe ich da?

Man soll Name, Adresse und Telefonnummer eingeben. Und die würden dann auch da anrufen, um die Echtheit der Angaben zu verifizieren. Selbstverständlich gibt es keine SSL-Version der Seite, es gibt auch keine Angaben, wofür die Daten gebraucht würden und was damit gemacht würde, wer die einsehen darf, ob und wie man sie gelöscht bekommt etc.

Ich kann ja nachvollziehen, dass man sich gegen Spammer wehren will, aber so? Was für Knalltüten.

Bild: Screenshot Registrierung teich-forum.org
Screenshot Registrierung teich-forum.org (Aug. 14, 2014, 3:22 p.m.)
[Tags: idioten ] [Album: Screencaps ]







Ich liebe Valgrind

Ich bin gerade auf Dienstreise, die Internetanbindung ist dürftig und ich habe Zeit. Daher überarbeite ich gerade pcp mit Valgrind.

Man lässt ein Programm mit Valgrind laufen und es zeigt einem nachher Memoryleaks, Buffer Overflows und vieles mehr an. Da ich in letzter Zeit eine Menge am Code hinzugefügt habe, haben sich da leider einige solcher Probleme angesammelt. Und die arbeite ich momentan systematisch ab.

Eigentlich ist die Ausgabe von Valgrind erschütternd und deprimierend. Und doch hilft es mir enorm, dutzende subtiler und fieser Bugs zu finden und zu fixen. Im aktuellen Durchlauf (Import eines Secret Keys, der fehlschlägt) hatte ich am Anfang seitenweise Leaks. Schlimm. Jetzt bin ich durch und das hier ist die Ausgabe, wenn Valgrind happy ist:

scip@io: % valgrind --leak-check=full --show-reachable=yes src/pcp1 \
           -V tests/va -K -I tests/key-alicia-sec -x a
==35083== Memcheck, a memory error detector
==35083== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==35083== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==35083== Command: src/pcp1 -V tests/va -K -I tests/key-alicia-sec -x a
==35083== 
Secretkey sanity check: there already exists a key with the id 0x437A76EDE40D67EC
==35083== 
==35083== HEAP SUMMARY:
==35083==     in use at exit: 0 bytes in 0 blocks
==35083==   total heap usage: 95 allocs, 95 frees, 146,878 bytes allocated
==35083== 
==35083== All heap blocks were freed -- no leaks are possible
==35083== 
==35083== For counts of detected and suppressed errors, rerun with: -v
==35083== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Was soll ich sagen? Valgrind ist echt geil. Gar nicht auszudenken, was ich täte, wenn es das nicht gäbe.








Willkommen in Hamburg

Heute morgen Zwischenstopp Hamburg HBF:

Bild: public couch potatoes
public couch potatoes (Aug. 4, 2014, 7:57 a.m.)
[Tags: foto ] [Album: People ]







Beckenupdate 28.07.2014 - Updated 28.09.2014 13:32

Viel neues gibts nicht. Ich hab die Lampen erneuert, was man am Foto sieht, stellenweise ist das so hell, dass man kaum was erkennen kann.

Bild: Becken 28.07.2014
Becken 28.07.2014 (July 28, 2014, 9:12 p.m.)
[Tags: aquarium2013 ] [Album: Aquarium ]


Update 27.08.2014 16:00:

Im Moment hab ich leider ein Gleichgewichtsproblem im Becken. Ich hatte ja die Lampen wie geschrieben erneuert. Irgendwann muss der CO²-Diffusor unter der Pumpe weggerutscht sein, ich hatte also kaum noch CO² im Becken. UND neulich hab ich ne Menge Pflanzen entnommen für ein neues Becken und eine Bekannte. Dadurch ist das Becken nun aus dem Tritt gekommen. Die Pflanzen wachsen kaum noch und es treten vermehrt Fadenalgen auf. Keine Plage aber auffällig. Sonst musste ich bei jedem Wasserwechsel immer eine Menge gärtnern. Beim letzten Wasserwechsel (vorgestern) war gar nichts zum Gärtnern. Ich habe jetzt den Diffusor korrigiert und zusätzlich einen Trichter darüber angebracht, damit das ganze CO² durch die Pumpe geht. Ansonsten werd ich sehen, ob es sich wieder einpendelt.


Update 28.09.2014 13:32:

So dele. Fadenalgen sind weg. Pflanzen wachsen lassen, häufigere Wasserwechsel und Geduld - so einfach ist das. So sah das Becken eben aus (lange nicht gegärtnert).

Bild: Becken 28.09.2014
Becken 28.09.2014 (Sept. 28, 2014, 1:32 p.m.)
[Tags: aquarium2013 ] [Album: Aquarium ]

28.07.2014 21:11 CC0 Aquarium Null Kommentar






Mückenlarven Zucht

Ich züchte seit ein paar Wochen Mückenlarven, und zwar erfolgreich. Das ist richtig einfach, Brennesseln sammeln, in einen Behälter, Wasser rein und draussen etwa 2-3 Wochen stehen lassen. Dabei entsteht Jauche. Dann fischt man die groben Sachen raus und kann dann schon nach kurzer Zeit regelmäßig Mückenlarven rausfischen.

Bild: Der Zuchtbehälter für die Mückenlarven mit der Jauche
Der Zuchtbehälter für die Mückenlarven mit der Jauche (July 20, 2014, 7:57 p.m.)
[Tags: futter ] [Album: Aquarium ]
Bild: Die Mückenlarven Beute (die Menge hol ich jeden Tag raus!)
Die Mückenlarven Beute (die Menge hol ich jeden Tag raus!) (July 20, 2014, 7:57 p.m.)
[Tags: futter ] [Album: Aquarium ]
Bild: Mückenlarven aus der Nähe im Netz
Mückenlarven aus der Nähe im Netz (July 20, 2014, 7:57 p.m.)
[Tags: futter ] [Album: Aquarium ]







geo.de fliegt raus

Ich betreibe ja seit langer Zeit meinen eigenen River of News, d.h. ein RSS Feed Reader hier auf der Seite. Der ist allerdings aus abmahnungstechnischen Gründen nicht mehr öffentlich, ich nutze ihn also nur privat, und zwar täglich.

Unter anderem habe ich den Feed von GEO im Reader. Da kommt nur selten was neues, und meistens ist es Unfug. Heute hab ich den Feed gelöscht, weil sich der Unfug echt nicht mehr steigern lässt. Was denken die sich dabei?!

Bild: Geo Unfug
Geo Unfug (July 18, 2014, 7:52 p.m.)
[Tags: idioten ] [Album: Screencaps ]

18.07.2014 19:49 CC0 idioten river River Null Kommentar






Autosudo

If you're condemned to use sudo for systems administration on a daily basis you know the problem: working all the time with sudo is annoying. It's ok if you've got to enter sudo only here and there. But on some systems almost everything is only reachable via sudo.

At least it annoyed me, so I put the nightmare to an end. Autosudo consists of a couple of bash functions which - once enabled - learn each entered sudo command and create a temporary wrapper function for it so that you can leave "sudo" the next time you use the command. An example session:

[16.Jul 09:48:22] --- [~] ---
me@machine: % autosudo ena

[16.Jul 09:49:14] --- [~][autosudo]  ---
me@machine: % sudo less /var/log/splunk/ticket.log
[..]

+++ autosudo: added "less" to auto sudo commands +++

[16.Jul 09:50:32] --- [~][autosudo+1]  ---
me@machine: % less /var/log/splunk/ticket.log

[16.Jul 09:50:50] --- [~][autosudo+1]  ---
me@machine: % autosudo sh
+++ auto sudo enabled for:  less +++

[16.Jul 09:50:52] --- [~][autosudo+1]  ---
me@machine: % autosudo dis
+++ disabling auto sudo commands +++
    disabling less

[16.Jul 09:50:58] --- [~] ---
me@machine: % less /var/log/splunk/ticket.log
/var/log/splunk/ticket.log: Permission denied

What happens here? First, I enabled the feat with "autosudo ena". Next I called a sudo command "sudo less". Once completed the autosudo facility adds "less" as an autosudo wrapper and notifies me about it. From now on I can just use "less" instead of "sudo less" while achieving the same functionality. Finally I let it display a list of currently autosudo'ed commands ("autosudo sh") and then I disable it with "autosudo dis". Note that the plain "less" call in the end doesn't work anymore since after disabling autosudo "less" was not sudo wrapped anymore. Easy enough.

Here's the code:

autosudo () {
    # enable auto sudo
    case $1 in
        e|ena|enable)
            export AUTOSUDO=1
            export SUDOCMD=`type -p sudo`
            alias sudo=sudoexec
            ;;
        d|dis|disable)
            unset AUTOSUDO
            unalias sudo
            echo "+++ disabling auto sudo commands +++"
            for cmd in $AUTOSUDOCMDS; do
                echo "    disabling $cmd"
                unset $cmd
            done
            ;;
        s|sh|show|status)
            if test -n "$AUTOSUDO"; then
                echo "+++ auto sudo enabled for: $AUTOSUDOCMDS +++"
            else
                echo "+++ auto sudo disabled +++"
            fi
            ;;
        *)
            echo "Usage: autosudo <enable|disable|show>"
            ;;
        esac
}

sudoexec () {
    # determine sudo cmd and if successfull, alias it away
    if test -n "$AUTOSUDO"; then
        if $SUDOCMD $*; then
            cmd=`echo "$*" | awk '{ print $1}'`
            if echo "$cmd" | egrep -v "^-" > /dev/null 2>&1; then
                lambda="/tmp/.lambda.bash.$$"
                cmd=`basename $cmd`
                cat <<EOF > $lambda
unalias $cmd
function        $cmd () {
  $SUDOCMD $cmd \$*
}
EOF
                export LAMBDA=$lambda
                AUTOSUDOCMDS="$AUTOSUDOCMDS $cmd"
                echo
                echo "+++ autosudo: added \"$cmd\" to auto sudo commands +++"
                echo
            fi
        fi
    fi
}

cleanlambda() {
    if test -n "$LAMBDA"; then
        rm -f $LAMBDA
        LAMBDA=""
        unset LAMBDA
    fi
}
PROMPT_COMMAND="if test -n \"\$LAMBDA\"; then source \$LAMBDA; cleanlambda; fi; PS1='\[\033]0;\u@$host:\w\007\]
\$(DATE) --- [\w]\$(SHAUTOSUDO)\$(JOBS) ---
\u@$host: $CURSOR '"

Some words about it: If you call "autosudo ena", then "sudo" will be made an alias to "sudoexec", one of the functions above. "sudoexec" then executes the sudo command as usual and if it returns success it extracts the command and puts it into a wrapper function which it writes into a temporary file. The filename gets exported into the variable $LAMBDA. The most important part is the extension to $PROMPT_COMMAND. I precede it with a little bit of code which looks for an environment variable $LAMBDA. If set it assumes it is a file and sources it. This makes the wrapper function available to the current bash environment.


16.07.2014 19:42 CC0 opensource Source Null Kommentar






Review To The Stars (Harry Irons Trilogy) - Updated 18.07.2014 18:04

These days I started to read a new book "To The Stars" (from Herry Irons Trilogy) by Thomas Stone. First of all, I'd like to note, that I particularly like the novel in that I can't stop reading it. The story is utterly fascinating and I want to know how it ends very bad.

However, there are so many painful errors in the book, it's a shame. And I'm only done with the first half of the first book.

First of all are the characters. They are mostly flat and thin, all of them out of the bag of a very limited number of stereotypes with the exception of Harry the main character. In most cases it's unclear what motivates the people in the story. Sometimes it is pure money, sometimes ... we don't know. They are also painted in contradictorily ways. While at the start of the story we learn that only the best of the best of society will be allowed to travel to the stars, we see later that almost everybody on board of a spaceship thinks only of one thing: the bonus. That's really annoying at times. For instance, there's some women who shall have a tremendous scientifical background. The first thing she says when encountering the very first alien race is about an additional bonus which she will get because of it. C'mon! Which scientist in the world doesn't have a minimum of curiosity?! And who does abandon her crewmates just to secure an extra bonus? Who would do that?

The overall dumpness is appalling. Just one example out of hundreds possible: Harry is there down on the surface and is confronted by three aliens. They wear sophisticated suits, well protected and use advanced weaponry, while Harry is unarmed (though he had a weapon but lost it earlier). He's got help by two native sentient beings (they are on stone age level). Together they manage to catch one of the aliens with a net, the alien looses its weapon, Harry takes it and disables the suit with it. Surely an advantage. Then the remaining aliens approach them and the three of them run away. In the process Harry dumps the weapon. Yes, literally. He dumps it away, he doesn't just loose it. Holy Mother Mary! Instead of running he could have just fired on the other aliens and the problem had be solved. But no. In this example you can clearly see, how Stone drives the story forward. Stupidity causes trouble, which they try to solve with more stupidity which causes even more trouble and so forth.

Consistency is a concept which doesn't seem to be familiar to Stone as well. Before the said encounter Harry aproached one of the aliens. It didn't shoot at him but instead pointed some kind of energy beam at him which made him able to "see" some kind of a message (that the red dwarf is about to go nova, that is). However, Stone abandons the episode completely during the following chapters. On several occassions Harry reasons why the aliens don't communicate with him. Though they did, but Stone the author, just forgot. Utter madness!

Another problem figure is the Fagen character, the commander of the mission. He seems to be manipulative, keeps secrets about the mission and lies on serveral occassions. At the very beginning of the book there's a sequence where Fagen was previously at the planet they visit later again. Most of his crew got killed by aliens and one crewman (a women, I'll come to that later) wants to screw him up (for the money. again!), so he kills her. His motive seems to be that he's annoyed by corporation rules and money making, or so he says. Only on the first couple of pages you can clearly see, that almost all of the first crew are psychopaths. I don't understand how a profit oriented space corporation could send such dump loosers out into the universe to explore it. And it's not better with the current crew as well. The point is, Fagen redirected the Maghellan (their ship) to the said planet again. But we never learn for what reason, at least not in the first half. Perhaps that will resolved later, I hope.

Then there are the women. Psychos. All of them but one. The latter is beautiful and has a lovely attitude which seems to be her only talent. Also she's white. Any other female character is either dump, corrupt, egocentric or all of it combined. This goes far beyond simple sexism, it's insulting for any sentient being - female or male alike. Mad, irrational people everywhere. I'd say you could remove circa fifty per cent of the book just by making the characters reasonable.

But physics and technology are the worst of it. It starts with a wormhole they discovered sometime earlier which can be used to travel the galaxy. There's an entry interstice in our solar system and depending on your entry speed you will drop out at some specific point somewhere else, so that practically every point in the galaxy (or universe?) could be reached. There's no explanation why that would be so. It's just so. Because. You know. And then there's the way back home. Not explained at all.

Stone writes about a red dwarf which is about to go nova. Except that red dwarfs don't do that. The crew wears spacesuits, walk the hot planet surface in it but sweat heavily. Because, you know, in 2200 spacesuits don't have environmental systems built in. Oh, and they cannot communicate with the ship above in orbit, since they all left the shuttle. The suits have radio capabilities but totally obviously they cannot use the shuttle as a relay to talk with orbit. Oh - and an explosion in space causes a shock wave. Ridiculous.

The shuttle hangar (side note: Stone writes it as "hanger", for whatever reason) has a decontamination feature which will be used regularly when the shuttle comes on board of the space ship after a planetary visit. However, the people inside just went outside on the planet, helmets open. So, they get contamined by alien microbes and they contamined the alien world with earth's microbes - and don't give a shit about it. But they clean the outside of the shuttle after it flew through the vacuum. Another aspect of the shuttle is also interesting: there's some defect and it turns out that some pipe leaks hydraulic fluids. An engineer repairs it later. The interesting thing is, he does it while laying below the shuttle. Since hydraulic pipes are naturally mounted UNDER a space shuttle, which means at the OUTSIDE if it. And then they wonder why it gets off when entering the atmosphere? Huh?!

Another character - the "computer genius" as Stone tells us on every possible occassion - uses a CD player. I abandoned my CD player about 10 years ago. That is, before the book had even been written. WTF? And the guy only hooks into computers. Not into the net. In fact, there's no net in the book. Which have been written while the internet is an old hat these days. You don't even have to imagine such things, just look out into our very own world. It looks as if the book have been written in the 1950s.

In summary, I'd assume Stone tries hard to deliver a good story but has no idea of science. Or science fiction. He probably never read a scify story. You'd already know the most basics just by reading some piece of Clarke or Asimov. And he seems to have no affinity to the internet as well. Would it really be too much just googling "super nova" and reading some sentences about it on wikipedia? He makes the impression on me to be the one who wrote the Prometheus script. Don't get it wrong, everyone has to start somewhere so has Stone. In some reviews I read that it get's better in the following books, so there's hope.

However, I like the story anyway! Don't ask me why :) And I'm eager to see how it develops. That's probably the craziest thing about the book. It doesn't make any sense in most parts, the party is run by a pack of fools, but it's kinda funny and exciting. Didn't have such a combination ever...


Update 18.07.2014 18:04:

I'm done with the book, in both senses - I'm not going to read the other two of the trilogy. It's just too lame. Can't sustain it any longer. I found even more bullshit in the remainder. For one it's the problem with free fall Stonce seems to have. You see, in free fall there's no gravity at work so you don't weight anything in such an environment. You move by floating around, you can't fall down, fluids form spheres flying around if exposed to force, things stay right in the air where you stick them, and the likes.

Not so in Stones world. There, an injured one moves around the ship to search for an alien together with a crewmember. Sometimes they (correctly) float around, sometimes they "stand" or "walk". Then, after some time he complains that his foot hurts and he needs to get back to his bunk in order to lie down and rest. I'm not sure why his foot hurts, obviously from "walking" around a longer time in the ship, under free fall conditions. You would assume, that free fall would be one of the best possible conditions if your foot hurts. Since - you know - you don't weight anything, which relieves the foot the best way possible. But as it is, Stone doesn't have any clue about such details. Oh, and the same character engages in a foot bath earlier.

Other crew members are on board of the alien craft, there's free fall as well. At least at some point Stone writes it. But the aliens walk around all the time, they don't float. And the crew sometimes floats but sometimes crawls or walks. There's a tunnel which leads "downward" (how do you know in free fall on board of an alien ship where that "down" might be?), two of them fall down, one onto the other. In fucking free fall. Crackbrained, that is.

I already mentioned the women who wants to leave the system no matter what, even when the majority of the crew is not on board. So they've got an alien on board and a rare event happens: they shut down all the hatches. Wow, Mr. Stone, there you have it: 1 point out of 100 negatives! While the others look out for the alien, said women waits. Finally the alien catches both of them and kills them. The women doesn't hear anything from them for a long time, so she decides to open all the hatches. Because reasons. I don't know how many times I face palmed during the last chapters.

Stone doesn't know about vacuum either. Said alien which boards the human vessel, "leaves the ship silently". That is a citation. SILENTLY. Honestly, Mr. Stone, were you stoned when you wrote that utter crap?!
Haha, one last piece: they missed one crew on the planet (Harry) but he managed to leave the surface anyway on board of the alien shuttle. The shuttle goes to the alien ship from where Harry flees and comes aboard the Maghellan again. Guess what they say to him on first sight? "How are you doing?". LOL.

So, I wont buy the other two books, it just hurts too much. Yes, I'd like to know how it continues, since the plot as it is, isn't bad at all. But as a detail loving nerd I can't stand it any longer. Sorry.








New shell gimmicks

So, I decided to streamline my shell config the other day. The very first I did, was to write an awk replacement in perl. Sounds a little senceless, but sometimes I need some more power inside an awk command and sometimes I just want to save typing. This is how it looks like, when used:

# awk version:
ps | grep sleep | grep -v grep | awk '{print $1}' | xargs kill
# pwk version:
ps | grep sleep | grep -v grep | pwk 1 | xargs kill

This is the simple variant, which just saves typing, pretty handy. The other variant is more perlish and at first looks like the original awk syntax. Hover, you can add almost any kind of perl code to it:

ps | pwk 'if($5 =~ /^python$/) { $t=`fetch -o - "http://$8/"`; if($t =~ /<title>(.+?)<\/title/) { print "$8: $1"} }'

Here's the shell function, just put it into your .bashrc:

pwk () {
    if test -z "$*"; then
        echo "Perl awk. Usage:"
        echo "Perlish: pawk [-F/regex/] [-Mmodule] <perl code>"
        echo " Simple: pawk <1,2,n | 1..n>"
        echo "Perlish helpers:"
        echo "  p() - print field[s], eg: p(\$1,\$4,\$7)"
        echo "  d() - dump variables, without param, dump all"
        echo "  e() - exec code on all fields, eg: e('s/foo/bar/')" 
        echo
        echo "Default loaded modules: Data::Dumper, IO::All"
        echo "Enable \$PWKDEBUG for debugging"
        echo "Simple mode has no helpers or anything else"
    else
        # determin pwk mode
        if echo "$*" | egrep '^[0-9,\.]*$' > /dev/null 2>&1; then
            # simple mode
            code=`echo "$*" | perl -pe 's/([0-9]+?)/\$x=\$1-1;\$x/ge'`      
            perl -lane "print join(' ', @F[$code]);"
        else
            # perl mode
            # prepare some handy subs
            uselib="use lib qw(.);"
            subprint="sub p{print \"@_\";};"
            subsed='sub e{$r=shift; foreach (@F) { eval $r; }};'
            subdump='sub d {$x=shift||{_=>$_,S=>\@F}; print Dumper($x);};'
            begin=";  BEGIN { $uselib $stdsplit $subprint $subdump $subsed}; "
            
            # extract the code and eventual perl parameters, if any
            code=""
            args=""
            last=""
            for arg in "$@"; do
                args="$args $last"
                last="$arg"
            done
            code=$last
            
            # fix perl -F /reg/ bug, complains about file /reg/ not found,
            # so remove the space after -F
            args=`echo "$args" | sed -e 's/-F /-F/' -e 's/-M /-M/'`
            
            # convert $1..n to $F[0..n]
            code=`echo "$code" | perl -pe 's/\\\$([0-9]+?)/\$x=\$1-1;"\\\$F[\$x]"/ge'`
            
            # rumble
            defaultmodules="-MData::Dumper"
            if perl -MIO::All -e0 > /dev/null 2>&1; then
                defaultmodules="$defaultmodules -MIO::All"
            fi
            
            if test -n "$PWKDEBUG"; then
                set -x
            fi
            perl $defaultmodules $args -lane "$code$begin"
            if test -n "$PWKDEBUG"; then
                set +x
            fi
        fi
    fi
}

Another new shell function is extr, which unpacks any kind of archive. In contrast to its sisters out there (there are a couple of generic unpack shell funcs to be found on the net), it takes much more care about what it does. Error checking, you know. And it looks inside the archive to check if it extracts into its own directory, which is not always the case and very annoying. In such instances it generates a directoryname from the archivename and extracts it to there. Usage is simple: extr archivefile. Here's the function:

extr () {
    act() {
        echo "$@"
        "$@"
    }
    n2dir() {
        tarball="$1"
        suffix="$2"
        dir=`echo "$tarball" | perl -pne "s/.$suffix//i"`
        dir=`basename "$dir"`
        echo "$dir"
    }
    tarball="$1"
    if test -n "$tarball"; then
        if test -e "$tarball"; then
            if echo "$tarball" | grep -Ei '(.tar|.jar|.tgz|.tar.gz|.tar.Z|.tar.bz2|tbz)$' > /dev/null 2>&1; then
                # tarball
                if echo "$tarball" | grep -E '.(tar|jar)$' > /dev/null 2>&1; then
                    # plain old tarball
                    extr=""
                elif echo "$tarball" | grep -E '(bz2|tbz)$' > /dev/null 2>&1; then
                    extr="j"
                elif echo "$tarball" | grep -E 'Z$' > /dev/null 2>&1; then
                    extr="Z"
                else
                    extr="z"
                fi

                if ! tar ${extr}tf "$tarball" | cut -d/ -f1 | sort -u | wc -l
                    | egrep ' 1$' > /dev/null 2>&1; then
                    # does not extract into own directory
                    dir=`n2dir "$tarball" "(tar.gz|tgz|tar.bz2|tbz|tar|jar|tar.z)"`
                    mkdir -p $dir
                    extr="-C $dir -${extr}"
                fi
                act tar ${extr}vxf $tarball
            elif echo $tarball | grep -Ei '.zip$' > /dev/null 2>&1; then
                # zip file
                if unzip -l "$tarball" | grep [0-9] | awk '{print $4}' | cut -d/ -f1 | sort -u \
                    | wc -l | egrep ' 1$' /dev/null 2>&1; then
                    # does not extract into own directory
                    dir=`n2dir "$tarball" zip`
                    act mkdir -p $dir
                    opt="-d $dir"
                fi
                act unzip ${opt} $tarball
            elif echo "$tarball" | grep -Ei '.rar$' > /dev/null 2>&1; then
                if ! unrar vt "$tarball" | tail -5 | grep '.D...' > /dev/null 2>&1; then
                    # does not extract into own directory
                    dir=`n2dir "$tarball" rar`
                    act mkdir -p "$dir"
                    (cd "$dir"; act unrar x -e $tarball)
                else
                    act unrar x $tarball
                fi
            elif echo "$tarball" | grep -Ei '.gz$' > /dev/null 2>&1; then
                # pure gzip file
                act gunzip "$tarball"
            else
                :
            fi
        else
            echo "$tarball does not exist!"
        fi
    else
        echo "Usage: untar <tarball>"
    fi
}

And finally an updated version of my h function, which can be used for dns resolving. Usage is pretty simple:

% h theoatmeal.com
; dig +nocmd +noall +answer theoatmeal.com
theoatmeal.com.         346     IN      A       208.70.160.53

% h 208.70.160.53
; dig -x 208.70.160.53 +short
oatvip.gpdatacenter.com.

% h theoatmeal.com mx
; dig +nocmd +noall +answer theoatmeal.com mx
theoatmeal.com.         1800    IN      MX      5 eforwardct2.name-services.com.
theoatmeal.com.         1800    IN      MX      5 eforwardct3.name-services.com.
theoatmeal.com.         1800    IN      MX      5 eforwardct.name-services.com.

It uses dig to do the work, or host if dig cannot be found. The source:

h () {
    if type dig > /dev/null 2>&1; then
        args="$*"
        opt="+nocmd +noall +answer"
        rev=""
        if echo "$args" | egrep '^[0-9\.:]*$' > /dev/null 2>&1; then
            # ip address
            cmd="dig -x $* +short"
        else
            # hostname
            cmd="dig +nocmd +noall +answer $*"
        fi
        echo "; $cmd"
        $cmd
    else
        # no dig installed, use host instead
        host="$1"
        type="a"
        debug=""
        cmd="host $debug"
        if test -z "$host"; then
            echo "Usage: h <host> [<querytype>]"
            return
        else
            if test -n "$2"; then
                type=$2
            fi
            if test -n "$debug"; then
                set -x
            fi
            case $type in
                ls)
                    $cmd -l $host
                    ;;
                any)
                    cmd=`echo $cmd | sed 's/\-d//'`
                    $cmd -d -t any $host | grep -v ^\; | grep -v "^rcode ="
                    ;;
                mx|a|ns|soa|cname|ptr)
                    $cmd -t $type $host
                    ;;
                *)
                    echo "*** unsupported query type: $type!"
                    echo "*** allowed: mx, a, ns, any, *, soa, cname, ptr"
                    continue
                    ;;
            esac
            if test -n "$debug"; then
                set +x
            fi
        fi
    fi
}