Julius Plenz – Blog

Nachlese

Verschiedene Texte, die ich heute las und für sehr lesenswert halte:

posted 2012-07-31 tagged linkdump, perl, oneliner, math and politik

URL shortener

The bit.ly service requires some sort of registration or an API key for some time now. I used to use it in shell scripts to automate shortening of links.

Similar to the sprunge pastebin service, there's come up a new, easy-to-understand URL shortening service called gnzkrz (short for German "ganz kurz", "very short"). And with it's latest commit, it acquired a simple API. I use it as such:

#!/bin/sh
URL=`xclip -o`
SHORT=`wget -qO- "http://krzz.de/_api/save?url=$URL"`
(echo -n $SHORT | xclip -i -display :0 -loops 0 ) &
/home/feh/bin/notify-wrapper "krzz.de: switched URL in clipboard" "$SHORT"

Now I simply bind a hotkey to call this program, and it will exchange the URL from my X clipboard with a shortened version.

posted 2011-08-07 tagged sh and oneliner

dec2bin for the poor

Convert 0x53 to binary, quick! – Now you start to think: In which language could you implement a dec2bin function within a few seconds? Or just do it with pen and paper, old school?

But wait, there's poor man's dec2bin!

$ echo -n "\x53" | xxd -b
0000000: 01010011

;-)

posted 2011-01-26 tagged oneliner