Don't understand german? Read or subscribe to my english-only feed.

google hack for your desktop: keyword correct

March 9th, 2008

Do you know the situation where you just aren’t sure whether you are spelling a word the right way? If you know how to type the word pretty well, then a dictionary might work just fine. If you aren’t sure at all you might consider using Google’s ‘Did you mean’-feature. Check out a simple demonstration for the word Wondows, which could mean ‘Windows’. ;-) If you happen to use that google-feature just too many times you might be interested in my small hack:

wget -O google_correct.py http://grml.org/scripts/google_correct.txt
chmod +x google_correct.py

This small python script uses xsel (so it currently works only on systems providing xsel ;-)) to retrieve the currently selected word from your X selection, executes a google search and parses the output for the keyword inside the ‘Did you mean’ section. Finally it sets the corrected keyword as your current X selection. If you provide the keyword directly as an option, then the script just outputs the corrected keyword without touching your X selection so you can integrate it directly inside your $EDITOR as well as an option. This gives you the flexibility to use this feature globally(!) inside your preferred window manager. Select a word, press the keybinding for executing google_correct.py and now you’ve the corrected word available for further actions…

Finally don’t forget to put the affected word (after double-checking it using a real dictionary of course) into your $EDITOR’s dictionary to keep such “help m0m, I can’t sp3ll w0rds anymore” situations at a minimum. I’m using a personal dictionary file and ‘iab wondows windows’ inside Vim to fix spelling errors for words I’m unsure how to spell or which I always get worng.

A whishlist of further ideas/features for the script can be found in the header of the script itself. Further input welcome.

Wie man jemandem im Internet schaden kann…

March 9th, 2008

Aufklärung startet im Kleinen, im Bekannten- und Verwandtenkreis. In einer Diskussion rund um die Vorratsdatenspeicherung und die immer verstärkter aufkommende Videoüberwachung habe ich verschiedene Szenarien aufgezeigt. Ein Szenario davon war, dass man durch Data-Mining und diverse Web 2.0-Dienste immer gläserner wird.

Und zwar muss man dafür gar nicht erst seine eigene Homepage ins Web stellen. Viele Leute wissen nämlich leider gar nicht, was man alles mit den passenden Suchmethoden über sie herausfinden kann. Einer meiner Brüder war der Meinung, dass es zu ihm nichts kompromitierendes im Internet gibt. Das stimmt soweit sogar auch. Seiner Meinung nach gibt er nur bekannt, was er auch bekannt geben will, denn er sei sich der Risiken des Data-Mining durchaus bewusst. Aber wer garantiert ihm, dass nicht doch etwas ungewolltes zu seiner Person vorhanden ist? Nicht öffentlich zugängliche Datenquellen einmal beiseite gelassen; aber kann jemand gezielt seine Person angreifen? Mehrere Personen in der Diskussionsrunde waren der Meinung, dass so etwas nicht so einfach geht. Ich wollte den Gegenbeweis antreten. Und zwar ohne Hijacking irgendwelcher (Web-)Accounts, sondern mit möglichst wenig Aufwand.

Ich habe daher vorgeschlagen, dass ich einfach einen simulierten Angriff auf seine Person im Web durchführe: eine Google-Suche zu seinem Namen ergibt zum Startzeitpunkt als 1. Resultat seine Photosammlung bei Flickr:

Screenshot von der 1. Google-Suche nach Christoph Prokop

Soweit so gut und im Sinne von meinem Bruder. Aber gelingt es mir, innerhalb von einem Monat (so die vereinbarte Deadline, da alles darüber hinaus zu lange für einen realistischen Angriff wäre) bei der Suche nach seinem Namen eine potentiell kompromittierende Webseite unter die Top10 der Suchergebnisse bei Google (alles hinter der 10 ist grundsätzlich ja mal uninteressant) zu schummeln?

Am 4. Februar 2008 habe ich ca. 15 Minuten Zeit investiert: christoph.michael-prokop.at im DNS eingetragen, eine minimalistische Webseite unter Beachtung der einfachsten SEO-Tricks angelegt und dann um 01:45 Uhr an Google-AddURL gefüttert.

5 Tage später (9. Februar) dann ein Zwischenstand:

Screenshot von der 2. Google-Suche nach Christoph Prokop

Und das war auch schon mein gewolltes Ziel: Es hat keine 5 Tage gedauert, um an Platz 7 der Suchergebnisse nach meinem Bruder eine quasi X-beliebige Webseite zu platzieren.

Die Auswertung der Logfiles ergibt, dass es nur sehr kurz gedauert hat, bis der Google-Bot das erste Mal vorbei geschaut hat: 04/Feb/2008:04:48:28 +0100

Dem aufmerksamen Leser wird auffallen, dass ich zwar christoph.michael-prokop.at angelegt habe, dass aber devnull.michael-prokop.at im Suchergebnis auftaucht. devnull.michael-prokop.at war der Default-Eintrag für die IP-Adresse meines Webservers (‘echo “GET /” | nc $IP 80’). Google hat darauf angeschlagen – testweise hab ich devnull.michael-prokop.at dann direkt auf christoph.michael-prokop.at umgebogen. Und wie erwartet hat Google das wiederum bestraft, wie eine aktuelle Suche nach meinem Bruder zeigt.

Selbstverständlich ist der Aufwand, um einen gezielten Angriff gegen eine Person mit einem sehr hohen Pagerank zu fahren höher. Es ist aber durchaus realistisch und machbar. Man erinnere sich nur an die “miserable failure” und “InkompetenzGoogle-Bomben. Die Ziele von so einem konkreten Angriff sind wohl seltener Prominente mit einem hohen Pagerank als die einfachen Leute: der laute Nachbar, die Konkurrenz bei der Jobsuche oder der Lehrer der ja ach so gemein benotet.

Fazit: Wette gewonnen. Mehrere Leute von den Risiken der Vorratsdatenspeicherung und der Videoüberwachung überzeugt. Und was soll ich über dich herausfinden, was du noch nicht weisst?

Linux Live-CD grml 1.1 – Codename Skunk

February 26th, 2008

It’s done, we have new releases of grml, the Debian-based Linux Live-CD for sysadmins and texttool users:

  • grml 1.1 (32bit) – Codename Skunk
  • grml64 0.2 (64bit) – Codename Schwammerlklauber
  • grml-medium 0.1 (32bit) / grml64-medium (64bit) – Codename Pfuh
  • Screenshot von grml 1.1

    It’s the first stable release being based on our new build-framework grml-live which itself is based on FAI (Fully Automatic Installation). Thanks to grml-live we can provide you a new grml flavour grml-medium which tries to close the gap between grml-small and grml.

    As usual you’ll get software and kernel updates, many new packages and features plus additional hardware support. We are using LZMA compression for squashfs and provide several additional kernel modules like atl2, iscsitarget, madwifi and (for the first time) loop-aes. Oh and the grml release is known to work fine on the Asus Eee PC – LAN, WLAN and webcam working out-of-the-box! Find all the glory details about the new releases in above mentioned release notes or just visit grml.org.

    For german readers there’s an article about the new release at pro-linux.de.

    BTW: On the next weekend (1st and 2nd of march) we – the grml team) – will present the new release on Chemnitzer Linuxdays at the grml booth. grml-CDs, grml-shirts und (new!) “ready to go grml-usb-pens” will be available as well as the chance to talk to us in reallife. 8-)

    So, we wish you a fast download and hope you enjoy the new release! :-)

    Why you shouldn’t use copy/paste as root

    February 24th, 2008

    Title: How to subtile fsck your Apache setup.

    Solution (quoting the original command line):

    cd /etc/apache2/mods-enabled
    lrwxrwxrwx 1 root www-data 33 2007-09-28 15:23 auth_basic.load -> ../mods-available/auth_basic.load
    lrwxrwxrwx 1 root www-data 33 2007-09-28 15:23 authn_file.load -> ../mods-available/authn_file.load
    lrwxrwxrwx 1 root www-data 36 2007-09-28 15:23 authz_default.load -> ../mods-available/authz_default.load

    Disclaimer: no, it wasn’t me; it’s the log of a customer.

    Credits: thanks to monitoring and the use of mercurial in /etc locating and fixing the problem was a matter of seconds.

    Der Jahreswechsel-Murphy

    February 8th, 2008

    Die kritischste Zeit ist vorbei, ich probiers mal gegen Murphy. Gegen Ende des Jahres verpulvern nämlich nicht nur die Geiz-ist-Geil-Kundschaft und die Weihnachts-Käufer ihr übriggebliebenes Budget, sondern auch Firmen müssen ihre Bilanz mit kurzfristigen Einkäufen anpassen. Die Folge? Damit Hardware-Hersteller konkurrenzfähig bleiben und beim Umsatz mitschneiden, werfen viele von ihnen billige Hardware voreillig auf den Markt. Die Konsequenz? Schlechte Hardware findet Einzug in das Wohnzimmer genau so wie in so manchen Serverschrank. Das Ergebnis? Rund um den Jahreswechsel häufen sich neben den Arbeitsaufträgen dann auch gleich Totalausfälle, Server-Sterben und der allseits gefürchtete Plattentod.

    Wer um den Jahreswechsel herum einkauft, kauft damit – ohne es zu wissen – in vielen Fällen noch schlechtere Hardware, als er es unter dem Jahr schon macht. Wer billig kauft, kauft teuer.

    Statistiken hab ich dafür leider noch nicht. Und wenn, dann geb ich die mit der Schutzgeldzahlung direkt bei Murphy ab.

    grml im Datencenter

    February 8th, 2008

    Danke an Marc ‘Zugschlus‘ Haber für den Hinweis: der Hosting-Provider FirstDedicated verwendet grml als Rescuesystem.

    Warum ich das schreibe? Es ist als Entwickler interessant zu sehen, wo genau das eigene Produkt denn zum Einsatz kommt. In vielen Fällen weiss man das nämlich gar nicht. Bei der grml-Benutzerumfrage 2007 hab ich ja einige nette Dinge erfahren, die ich aber selbst – wie im Vorfeld versprochen – unter NDA halte. Manchmal wird die eigene Software in Bereichen eingesetzt, von denen man nicht mal zu träumen wagt. 8-)

    Falls jemand noch weitere Firmen/Provider/Institutionen/… kennt, wo grml zum Einsatz kommt: lasst es mich wissen! Ich würde bei Gelegenheit nämlich gerne mal eine ‘Happy customers’-Kategorie auf der grml-Homepage einrichten. Aja, und erzählt auch anderen Upstream-Entwicklern einmal, wie zufrieden ihr mit deren Software seid. Das motiviert manchmal unglaublich.

    Für die konditionierten Benutzer…

    February 4th, 2008

    Rescue and Recovery - Screenshot

    … und sowas findet sich in sogenannter Business-Software[tm]…

    Numerische und Lineare Algebra mit Python

    January 27th, 2008

    Die Gerschgorin-Kreise finde ich sehr elegant und via python.codefetch.com bin ich auf den Geschmack gekommen, die numerische und lineare Algebra mittels Python ein wenig nachzuvollziehen. Nur ein paar ganz simple Code-Snippets (unter Verwendung der interaktiven Python-Shell ipython) zur Anregung:

    % ipython
    
    from numarray import *
    import numarray.linear_algebra as la
    
    # Eigenwerte, Eigenvektoren, Inverse + Determinante:
    a=array(((2,0,-1),(0,1,0),(-1,0,2)))
    print a
    print la.eigenvalues(a)
    print la.eigenvectors(a)
    print la.inverse(a)
    print la.determinant(a)
    
    # Pseudo-Inverse:
    m=array(((0,1),(1,-1),(-1,-1)))
    print m
    print la.generalized_inverse(m,rcond=1e-10)
    
    quit()
    

    Oder alternativ auch via Scipy:

    % ipython -p scipy
    
    from scipy.linalg import *
    
    a = array([[2,0,-1],[0,1,0],[-1,0,2]])
    
    # Eigenwerte + Eigenverkten:
    eig(a)
    
    # Inverse:
    inv(a)
    
    # Determinante:
    det(a)
    
    quit()
    

    Der Post-Murphy

    January 17th, 2008

    Wenn du eh nur einmal unter der Woche am Vormittag daheim bist und dann ein Paket erwartest, dann stehst du genau dann unter der Dusche, wenn der Postler an der Tür klingelt. *hmpf*

    /me taucht jetzt aber mal mit ISBN://1590280539 ab…

    Was willst du von mir?

    January 16th, 2008

    Wie man eine Frage zur Konfiguration des Regionalcodes nicht stellen sollte:

    Screenshot von AVS DVD Player

    Schreibtest

    January 15th, 2008

    86 Wörter

    Du schreibst 504 Zeichen pro Minute
    Du hast 86 korrekt geschriebene Wörter und
    Du hast 0 falsch geschriebene Wörter

    via Jens

    Call for Lectures: Grazer LinuxTage 2008

    January 15th, 2008

    Die Grazer LinuxTage (GLT08) finden auch heuer wieder im Rahmen der Linuxwochen Österreich statt – und zwar am Samstag, den 19. April 2008 auf der FH Joanneum. Weitere Informationen zu GLT08 auf linuxtage.at

    Wir (das Organisations-Team der GLT08) sind auf der Suche nach Vortragenden! Es gibt kein spezielles Thema, sondern die Einteilung in die Themengebiete:

    • Desktop/Anwender
    • Entwickler
    • Manager
    • Administratoren

    Wir suchen nicht nur Experten zu Spezialthemen, sondern auch Leute, die Einsteiger-Vorträge halten möchten!

    Du möchtest einen Vortrag oder Workshop auf den GLT08 halten? Dann reiche diesen bitte ein!

    Wir suchen übrigens auch noch motivierte Helfer, die im Vorfeld und/oder vor Ort anpacken können. Wer motiviert ist möge sich doch bitte einfach per Mail an graz08 (at) linuxtage.at bei uns melden. Danke!

    Aleph – Wartungsfenster

    January 7th, 2008

    Derzeit laufen gerade System-Updates oder Sicherungen.
    Von Montag bis Sonntag wird die Datenbank täglich gesichert und ist deshalb von 02:30 – 02:40 offline.
    Außerdem gibt es komplettes Backup am Mittwoch und Samstag, dabei ist die Datenbank von 2:30 – 3:20 nicht erreichbar.

    Bitte versuchen Sie es später nochmals und benutzen Sie einstweilen
    einen anderen Online-Katalog des Österreichischen Bibliothekenverbundes.

    entladung.net

    January 7th, 2008

    Entladung.net ist ein Video-Podcast über Elektronik. Wir wollen unser Publikum bei den absoluten Grundlagen abholen und schrittweise in die Welt der Elektronik begleiten. Dabei ist es uns ein Anliegen nicht nur “Kochrezepte” zu liefern sondern auch detailiert zu erklären wie die Dinge funktionieren.

    entladung.net

    Neue Release-Kandidaten von grml

    December 29th, 2007
    mika@grmlvrs ~www/grml % hg ci -m 'Finalize grml 1.1-rc1, grml64 0.2-rc1 + grml[64]-medium 0.1-rc1'
    summary:     Finalize grml 1.1-rc1, grml64 0.2-rc1 + grml[64]-medium 0.1-rc1
    mika @ Fre Dez 28 23:02:26 CET 2007
    mika@grmlvrs ~www/grml % hg tag grml_1.1-rc1
    summary:     Added tag grml_1.1-rc1 for changeset 8506fc040e39d96b4b1657b15bb8ccdfa4be5a5c
    mika @ Fre Dez 28 23:02:37 CET 2007
    mika@grmlvrs ~www/grml %
    

    Done that… auch die Webseite passt jetzt für die neuen Release-Kandidaten von grml, die da wären:

    Einige Monate Entwicklung, ein neues Build-Framework names grml-live und der aufmerksame Leser und grml-Kenner wird in obiger Liste auch einen neuen grml-Flavour ausmachen: grml-medium soll die Lücke zwischen grml-small und dem großen Bruder schließen.

    Ich halte es kurz: runterladen, anwerfen und was man so typischerweise braucht testen. Falls jemand noch einen Bug finden sollte: bitte melden, damit wir das nach Möglichkeit noch für die bald erscheinende stabile Release richten können.

    Ein großes Danke an dieser Stelle noch an alle aktiven grml-Entwickler und die fleißigen Contributor!

    Happy hacking!

    Make console work comfortable

    December 22nd, 2007

    Update on 2024-11-22: update URL for .zshrc.local (replace http://git.grml.org/f/grml-etc-core/etc/skel/.zshrc with grml.org/console/zshrc.local) and replace http://git.grml.org/?p=grml-etc-core.git with github.com/grml/grml-etc-core

    Update on 2024-02-16: provide curl usage instructions.

    Update on 2020-12-04: include tmux.conf.

    Update on 2017-01-27: provide easy to remember grml.org/console/$filename URLs.

    Update on 2009-02-13: adjust zshrc setup as .zshrc.global is deprecated, see grml-zsh-refcard.

    Update on 2008-10-10: replace old hg.grml.org URLs with current git.grml.org.

    Update on 2009-08-11: refer to /etc/vim/vimrc as /etc/vim/vimrc and /etc/skel/.vimrc have been merged

    You like grml‘s Zsh, GNU screen and Vim configuration? No problem to get that on non-grml/non-Debian/non-Linux/… systems as well. Just copy/paste the following lines which are stolen from one of my personal cheatsheets for working on foreign systems (being Linux as well as Solaris, BSD, Windows,…):

    # IMPORTANT: please note that you might override existing
    # configuration files in the current working directory! => 
    wget -O .screenrc   https://grml.org/console/screenrc
    wget -O .tmux.conf  https://grml.org/console/tmux.conf
    wget -O .vimrc      https://grml.org/console/vimrc
    wget -O .zshrc      https://grml.org/console/zshrc
    # optional:
    # wget -O .zshrc.local https://grml.org/console/zshrc.local
    

    Or if you prefer curl instead:

    # IMPORTANT: please note that you might override existing
    # configuration files in the current working directory! => 
    curl -L -o .screenrc   https://grml.org/console/screenrc
    curl -L -o .tmux.conf  https://grml.org/console/tmux.conf
    curl -L -o .vimrc      https://grml.org/console/vimrc
    curl -L -o .zshrc      https://grml.org/console/zshrc
    # optional:
    # wget -O .zshrc.local https://grml.org/console/zshrc.local
    

    If you do not want to copy/paste just use the grml-config.sh script instead.

    Notice: the above URLs always points to the most recent version of the file(s), so it’s easy to stay up2date as well as checking out a very specific version of the configuration files. Just look at github.com/grml/grml-etc-core.

    Disclaimer: If you notice any problems with the configuration files on your system/platform please let us know, it’s considered a bug then. Any other feedback is welcome as well of course. :)

    Event in Graz: “Sicher im Netz”

    December 16th, 2007

    Ort:
    ESC/Labor, Jakoministraße 16, 8010 Graz

    Termine:
    Mittwoch, 19 Dezember 2007 16:00 – 18:00 Uhr
    Hands On Registered Commons Workshop mit Roland Alton-Scheidl. Anmeldung an sicherimnetz@mur.at erforderlich.

    Mittwoch, 19 Dezember 2007 19:00 Uhr
    Creative Commons und Registered Commons Vortrag von Roland Alton-Scheidl

    Weitere Details bei mur.at.

    Checklist for 1:1 clone of a Debian system

    December 13th, 2007

    When cloning a Linux/Debian system 1:1 you should have a checklist of what’s important to change on the cloned system.

    For cloning I use the grml Linux Live-CD of course (the following tips are part of grml-tips as well). To create a 1:1 clone I boot grml on the systems (usually using the ssh=password bootoption to be able to access the system remotely as well) and use something like:

    Listener:
    # nc -vlp 30000 > /dev/sda1
    Source:
    # dd if=/dev/sda1 bs=$VALUE | nc -vq 0 $IP_OF_LISTENER 30000
    

    When I have to leave the place where the clone process is running and if the CD-ROM doesn’t reinsert CDs on reboot automatically (usually that’s the case for server systems) I can use my remote-reboot procedure via ssh later on like:

    eject &>/dev/null
    umount -l /cdrom
    eject /dev/cdrom
    echo b > /proc/sysrq-trigger
    

    But stop: before executing the last steps to reboot the server you should take care of a few important steps, otherwise rebooting might fail and you won’t be able to login via SSH. ;-) That’s my personal checklist:

    • Using LVM? If you want to rename any devices using vgrename/lvrename do not forget to adjust entries in /etc/fstab, lilo/grub,…
    • Check that labels/UUID/… for stable devices inside your configuration path (bootloader config, /etc/fstab, /etc/udev/*,…) match with the present setup (of course that’s especially important if you change any labels/UUIDs/… on your box after cloning)
    • Using udev, right? Do not forget to adjust any statically configured network interfaces as well – check out /etc/udev/rules.d/z25_persistent-net.rules and /lib/udev/write_net_rules (that’s probably the most common and serious pitfall when cloning systems BTW)
    • Make sure to configure your network setup accordingly (using /etc/network/interfaces)
    • Do you use any kernel modules on one host you don’t want to use on the other one? Check blacklisting, configuration,… in /etc/modprobe.d/ and /etc/modules.
    • And last but not least: if you change any of the "core files" (see above bullets to get an idea what I’m talking about) make sure to rebuild your initrd (executing ‘update-initramfs -c -t -k $KERNEL_VERSION’), and when using lilo don’t forget to execute lilo as well :-)

    Tip: I highly recommend the use of a version controll system for maintaining /etc, for example etckeeper and mercurial should do the job for you.

    c’t special 02/2008 Netzwerke: grml

    December 12th, 2007

    Bild vom Netzwerke-Magazin

    Ab 17.12. heisst es Schlange stehen, denn dann gibt es das c’t special 02/2008 Magazin zum Thema Netzwerke im Handel. Und weil grml Teil der beliegenden DVD ist, heisst es: kaufen! :)

    Power drain with Suspend-To-Disk?

    December 4th, 2007

    The battery of your laptop keeps getting drained even though you are using Suspend-To-Disk [STD]? (No, I’m not talking about Suspend-To-RAM!) That’s what happens at least on my Lenovo ThinkPad X61s notebook. Thankfully there exists a workaround:

    Check out what suspend method you use:

    # cat /sys/power/disk
    [platform] test testproc shutdown reboot
    

    So by default ‘platform’ is used, which corresponds with ACPI S4 and is fine if it works for you. What should fix your problem if you notice too much power drain with STD:

    # echo shutdown > /sys/power/disk
    

    Now you shouldn’t find any “blinking suspended leds” on your system any longer and no further power drain should happen. More details available at $LINUX_KERNEL/Documentation/power/.