Minecraft

[An English version might follow later, if I can be buggered to cough up a working multi-language solution.]

Nicht gerade wenige werden sich noch an ihre Kindheit zurückerinnern können. Insbesondere an das, womit man sich so damals die Zeit vertrieben hat, klein und unschuldig wie man war.

Und bei vielen der Leuten, die sich dran erinnern, wird hoffentlich das Wort “Lego” sofort Assoziationen wecken. Nicht nur im Kontext von “Dinger, auf die man drauftrampelt” sondern auch “etwas, womit ich früher gespielt habe”.

Sollte jemand das nicht sagen können, dann muss er vielleicht gar nicht weiterlesen.

Wie der Titel schon sagt: Es geht um Minecraft. Und Minecraft ist sowas wie das Lego von heute. Zwar digital, am Computer, und nicht wirklich zum anfassen und eigentlich sogar sehr beschränkt – doch kitzelt es genau die selben Nerven wie unser beliebtes Lego früher.

Minecraft ist gerade recht hoch angesagt, zumindest in gewissen Kreisen, und viele werden heutzutage nicht drumherum kommen, von diesem komischen Spiel zumindest mal gehört zu haben.

Die Prämisse ist einfach: Man ist, und man kann machen. Mehr Story braucht’s nicht. Das Spiel (in seiner aktuellen Fassung) wirft einen einfach vor vollendete Tatsachen, mit einer minimalen Anleitung in Form einer einstellbaren Tastenbelegung. Sprich wie Lego ohne Bauanleitung.

Entweder erschließt man es sich mühsam selbst, oder man guckt im Internet nach, oder (wie die meisten) hat’s mal irgendwo gesehen: man kann diese komischen Blöcke, aus denen die Welt besteht, kaputtschlagen, und dann kann man meist die Blöcke selber aufnehmen. Und dann wieder wo hinsetzen. Wenn man etwas weiter nachschlägt, findet man heraus, daß man zum Beispiel Holz zu einer Werkbank zusammensetzen kann, mit der man dann tollere Sachen in einem 3×3-Raster zusammenklicken kann.

Bisher ist das alles noch nicht viel, aber da oben in der Ecke steht ja auch noch “alpha”.

Und was ist jetzt so “toll” dran, daß alle davon schwärmen?

Ganz einfach: das Spiel ist Sandkasten pur.

Ohne ein Ziel gibt es nichts, was einem vorschreibt, wie man Handeln muss. Man kann in dem Spiel sterben, aber das ist nicht das tragischste Ereignis aller Zeiten – man verliert nur sein gesammeltes Hab und Gut, welches man mit sich führte.

Man kann erkunden gehen, und merkt, daß man immer weiter erkunden kann. Es gibt also keine bestimmte Landschaft zu erkunden, sondern das Spiel macht einfach immer weiter Landschaft, wenn man von der bisher Bekannten weggeht. Also auch hier kein Ziel – selbst wenn der Weg Spaß macht.

Also bleibt einem eigentlich nur eines: den eigenen Drang zu erfüllen, sich selber für etwas auf die Schulter klopfen zu können. Und so fängt man an mit Bauen. Man stapelt Blöcke aufeinander – meistens erstmal in einer Art Haus oder Höhle. Man findet heraus, daß böse Viecher einem Böses wollen, und gestaltet dann die eigene Heimat so, daß sie es nicht mehr können. Und stakst überall Fackeln hin.

Und so geht das weiter. Das Haus wächst, man baut in den nächstgelegenen Berg oder Hügel rein, hölt ihn aus, oder findet eventuell ein Höhlensystem. Man sucht es nach Ressourcen ab, findet welche, und macht sich bessere Werkzeuge. So ein kleines bisschen wie Leben halt.

Aber auch da stellt sich nach der Weile ein “wofür” ein. Einfach nur immer weiter Horten und Sammeln führt zu nichts. Dann hat man nachher ganz viele volle Kisten, und das war’s.

Nun – willkommen in der menschlichen Natur: jetzt wird erschaffen. Man baut nicht nur Häuser, sondern man baut interessante Konstruktionen (die momentan leider eher nicht “waghalsig” sein können, aber das ändert sich wahrscheinlich noch). Man steckt Aufwand und Liebesmühe herein, um etwas zu basteln.

Zum Beispiel hat man dann irgendwann über Seen und Flüsse erkundet und findet das ganze Stapfen durch die Pampa mühselig. Und dann fängt man wie der Autor an, sich eine eigene Wegterasse zu errichten.

A screenshot of Minecraft, showing a player-built highway.

Baby steps

So muss man dann nicht mehr mühselig durch die Landschaft stapfen, und hat auch noch was schönes gemacht dabei, da es bei Nacht so schön leuchtet.

Anderen Leuten wiederum ist sowas nicht genug, und sie setzen da noch Schienen drauf, und erstellen einen fast kolossales Bahn-Projekt.

Und das ist der Punkt, wo es anfängt: der kleine Größenwahn.

Früher als Kind hatte man nur eine begrenzte Anzahl Legosteine, mit denen man irgendwas basteln könnte. Wenn man einem Kind aber einen unendlichen Vorrat an Legosteinen geben würde und es eine Weile allein lässt – dann sollte man sich nicht wundert, wenn man einen Wolkenkratzer im Garten hat.

Das Spiel setzt genau da an, wo nicht wenige Menschen anfällig sind: der Basteltrieb. Man erschafft etwas, und sieht das Resultat vor sich entstehen, und irgendwas in einem wird ruhig, gelassen, und glücklich. Und man macht weiter, und merkt gar nicht, wie man sich dadrin verliert. Das kleine OCD für Jedermann.

Und alles wächst. Ehe man sich versieht, hat man imposante Großprojekte geschaffen. Andere machen Trailer, die einen quasi mit dem Suchtpotential des Spieles locken. Gruppen von Nutzern bauen mal eben die ganze Welt von Bioshock möglichst detailgetreu nach.

Man sucht weiter herum, auf YouTube, bei Google, in irgendwelchen Foren und auf einmal auch in der Twittertimeline bei Leuten, wo man es nie erwartet hätte. Und alle basteln irgendwas. Viele auch am Spiel selber. Es hat ein bisschen was von der Makerbewegung, nur, daß statt handfesten Objekten Pixelwerke geschaffen werden.

Ist dies schlechter? Nein. Macht es Spaß? Hell yeah.

Versuch’s selbst.

Android 2.2 (“Froyo”) and you: the gritty details behind «Apps to SD»

tl;dr version: If you can’t use Apps2SD, do adb shell, pm setInstallLocation 2, move any app to SD (ignoring possible “failed” errors at first try).

Our beloved Frozen Yoghurt came with many new features welcome to the community at large, and one feature which had a mixed reception: “Apps on external storage”, which allows the user to install applications to its phone’s external storage – mostly in order to free up internal disk space.

Many custom ROM distributions for Android already had this feature built in, going by the moniker “Apps to SD” (or “Apps2SD” or just “A2SD”).

The typical implementation of A2SD works by using an ext2/ext3 partition on the SD card of your device – and usually only works when it’s exactly the second partition. For the sake of argument, one such custom implementation of A2SD will be included at the end of this post.

What it then does is just completely move all the applications to the SD partition, leaving only the /data partition behind, and uses a bind mount to fool the system into believing that the files are still on the same file system. So, in essence, the a2sd patch “cheats” and pretends that nothing actually has happened while quietly siphoning the apps to the SD card.

This, of course, only works when you actually have root access to your device and are allowed to play around with all the interesting system data itself. If you’re working on an unrooted/stock handset and firmware, you don’t have the option of using this feature; and also if you’re too lazy or unknowing or prissy to set up an ext[23] partition on your SD card.

Thus the «official» Apps to SD comes into play – if your device is running Android 2.2, that is.

An important thing to note about understanding the official implementation is that it assumes that the user has no direct access to the /system partition. Especially: the user is not able to access any installed Android application package in any way that allows copying files.

What Froyo does when installing an application to SD is pretty simple: it creates a file on the SD card and uses this as a container to store the application in. Said container is used with a crypted loop mount, that is the actual data on the SD card is encrypted, and will be decrypted at load time when accessing the application.

The idea behind this seemingly convoluted setup is simple: if you have paid for an application, you could just store it on SD and then copy it if it is not encrypted. If it is encrypted, you cannot access the application in a “simple” way to copy (i.e. pirate) it.

Additionally, the application (with the default settings) needs to allow Android to move it to the SD card – otherwise the system does not enable the functionality, probably to ensure that applications aren’t “broken” by SD storage.

Of course this is easily manhandled by using the USB debugging interface with adb shell: just issue pm setInstallLocation 2. This tells he package manager (hence «pm») to use the external storage as a default install location, which incidentally lifts the block that does not allow an application to be stored on external storage, too.

The downside:
/dev/block/dm-41 on /mnt/asec/de.hafas.android.db-1 type vfat [...]

And yes, that’s 41 device mapper crypto loops. At least they don’t produce that much overhead as to noticeably slow down the system.

One of the boons of the Froyo implementation is that with above command, it can easily be used even with an unrooted phone and without repartitioning your SD drive. The disadvantages are that Android requires a fair bit of time after booting to mount all the crypto loop devices, which will result in your applications being accessible rather late after booting. Also, you will not be able to use widgets of any app that is on SD.

Here come the advantages of the customized A2SD approach: you can still access widgets and applications on your SD card even when it is mounted to your computer – because Android will only mount away the root partition (the FAT one), and not your ext partition. And you’ll have less overhead due to the crypto business.

And, as promised, the code that enables A2SD on most current ROMs:

#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# Originally by cyanogen (shade@chemlab.org)
# Modified to use a cleaner /sd-ext implementation by IEF (ief@shadowchild.nl)

# execute any postinstall script then kill it
if [ -e /dev/block/mmcblk0p2 ];
then

    # mount and set perms
    busybox mkdir /sd-ext
    busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /sd-ext;
    busybox chown 1000:1000 /sd-ext;
    busybox chmod 771 /sd-ext;

    # clean up any old symlinks, create data directories
    for i in data;
        do
                if [ -h /data/$i ];
                then
                        rm /data/$i;
                fi;
                if [ ! -d /data/$i ];
                then
                        mkdir /data/$i;
                        busybox chown 1000:1000 /data/$i;
                        busybox chmod 771 /data/$i;
                fi;
        done;

    # don't allow /data/data on sd because of upgrade issues - move it if possible
    if [ -d /sd-ext/data ];
    then
        busybox cp -a /sd-ext/data/* /data/data/;
        busybox rm -rf /sd-ext/data;
    fi;

    # move apps from internal memory to sdcard
    for i in app app-private dalvik-cache;
    do
        if [ ! -d /sd-ext/$i ];
        then
            mkdir /sd-ext/$i;
        fi

        busybox chown 1000:1000 /sd-ext/$i;
        busybox chmod 771 /sd-ext/$i
            
        if [ -d /data/$i ] && [ ! -h /data/$i ];
        then
            busybox cp -a /data/$i/* /sd-ext/$i/;
            busybox rm -f /data/$i/*;
        fi;
    done;

    # symlink app dirs - they must be on the same filesystem
    for i in app app-private dalvik-cache;
    do
        if [ -d /data/$i ] && [ ! -h /data/$i ];
        then
            busybox rm -rf /data/$i;
            busybox ln -s /sd-ext/$i /data/$i;
        fi;
    done;

    # clean up old whiteouts
    for i in local misc property system tombstones data;
    do
        if [ -h /sd-ext/$i ]; then rm -f /sd-ext/$i; fi
    done;

    # please don't put odex files in the app directory people!
    # it causes dexopt to crash when switching builds!
    busybox rm -f /sd-ext/app/*.odex

    setprop shadow.apps2sd.active 1;
    
    echo "+++ Apps-to-SD successfully enabled";

else
    
    # replace symlinks with directories so we can boot without sd
    for i in app app-private dalvik-cache;
    do
       if [ -h /data/$i ];
       then
            rm -f /data/$i;
            mkdir /data/$i;
            busybox chown 1000:1000 /data/$i;
            busybox chmod 771 /data/$i;
        fi;
    done;


    setprop shadow.apps2sd.active 0;
fi;
sync;

This is run as an init script.

No rest for the wicked

A sudden jolt woke Paul from his slumber. He startled and sat up properly, unsure what really woke him, but couldn’t find anything that should have unsettled him; and he was quite sure that nothing physically shook him.

The train was rumbling along between cities in the Rhein/Ruhr-Megaplex. The whole Ruhrgebiet had always felt like a particularly big city, but since those reforms a couple of years ago after the housing expansion, the whole area has been officially merged into one big municipality.

Buildings were flashing past the windows, too fast for the eye to discern any more than fleeting details. Paul dug in his pockets for his mobile phone, which told him that he was somewhere between Düsseldorf and Duisburg. Nobody new could have boarded since he was awake when they stopped in Düsseldorf itself.

Yet he couldn’t shake the feeling that someone was looking for him, and he could’t just pretend this was any kind of normal paranoia.

After all, there’s no such thing as random paranoia when you know that there really were people out to get you.

All of this could only mean one thing: this probably is a stealth grab, and they’re going to get Paul before the train arrives in Duisburg.

Again he checked the crowd, almost too casually, with an eye open for anyone who might already be eyeballing him. But there wasn’t even one remotely suspicious person around.

But then again, that would make it way too easy, wouldn’t it.

He briefly considered that this was just a seeking entanglement produced by an especially vigorous conductor starting his round of checking the traveler’s tickets, but no – this felt way too specific for that and this wasn’t like any of the other ticket checks he’d been in. [In general, most ticket checks were way more intense than airport security checks, too – even the employees didn’t seem to think very much of those.]

Besides, he had a valid ticket. Luckily for him, these weren’t personalized yet, or else he’d be in all kinds of shit by now.

Paul came to a decision. It started with standing up.

Shuffling sideways to the aisle came next, and heading down to the toilet followed suite.

And there the problems began. Paul had to dodge a pair of retirees which were suddenly standing up without looking around or bothering to check if they’ll bump into anyone, as they usually do, and almost knocked him over. Next was a pile of baggage that he could have sworn was not there before and which required some elaborate climbing to cross. Clambering down, he barely managed to dodge a stream of puke suddenly erupting from a child next to him, which had been noticeably happy and obnoxiously un-sick just a few moments ago.

So. Now he could definitely tell someone was on to him, and they weren’t messing with their obstruction field – else going down the aisle to the toilet, of all places, wouldn’t have triggered such a strong reaction.

The toilet itself was stuck – of course – but mercifully, it wasn’t occupied. Then again, this might just be the field’s ploy to lock him inside and leave Paul as a nice package for his pursuers, but he had to take that risk.

With a bit of manhandling, he got the door open and locked himself inside. The almost tranquil calm of the mostly sound-proof toilet washed over him, and Paul tried his best to relax. Then he opened his senses to the world.

In the first rush, he contemplated the fact that they were putting up such an effort to capture him. With such a blatantly strong alteration active, it meant that they were either very cocky – or very effective. Possibly both, but let’s not explore that avenue. At least they were confident enough to assume that they’d catch him before the train arrived in Duisburg and didn’t assume that there’s a need to hide from their prey.

He then chose to actually perceive with his heightened senses, opening his consciousness to the perception. He was flooded by impressions of all kind, with images being the strongest due to the fact that he was suffering from something called being human. Other thing that were swamping his mind included that he could feel the thoughts of the people around him, hear their breathing and their heart beating, smell their movement (which was something where he couldn’t even remotely figure out how those two are related) and taste their emotions.

All in all, Paul was handling more information that any normal human brain could have any hope of handling. The key word in that sentence is the “normal”, though.

And without a doubt, he could also feel the gravity-like pull of the reality alterations his pursuers were employing. He still couldn’t believe that normal people weren’t able to feel this.

A mayor precaution against being now was to practice emission control. Paul clamped down hard on any “signals” he gave off to the environment which would immediately register as irregular. There was always a kind of background static produced by him not fitting quite into the “normal” reality of the world, but its effects were all but undetectable from a few metres away.

At the moment, Paul and his pursuers were engaging in something which could closely be described as something like a World War II submarine fight, with Paul being a lone submarine and the others the circling destroyers above him, hunting for any sign of their quarry.

Which means that as long as he wasn’t being obvious, the enemies needed to use some kind of sensor to find them, and that sensor also gives them away. In historical cases, this role was filled by sonar scanners, which worked by sending out sound waves through water and then measuring where the signals came back earlier than expected.

But also, when it hit the submarine the sonar was trying to find, it registered with a characteristic “ping” sound heard in all kinds of submarine-themed movies. And if you heard that sound, you knew that your situation just went from bad to worse, but at least you’d know about it.

And could initiate counter-measures like hugging the ground, running silent and similar methods.

Knowing that he was being hunted kind of streamlined his options down to two courses of action. The dramatic option would be to hide whatever’s giving you away by masking yourself with your surroundings and hoping you won’t be noticed. In your run of the mill movie, this is the point where everything is turned off, and the hushed crew just cowers inside their still watertight metal tube, waiting for the depth charges to go off around them – hoping that there won’t be the lucky charge that hits them.

Luckily for Paul, there was no such thing as an analogue to depth charges that threatened him. Unluckily, there was also no kind of depth to hide in.

Option two, of course, is to bolt away as soon as you know someone’s following you. Against superior numbers, this is actually the best course of action, since you want to be the one that decides where the show’s going to be, not have the choice forced on you. But most of these scenarios do not involve being stuck on a moving train, a fact which is known to excessively hinder escaping from said scenario.

And if you think about it, that’s probably the reason why they didn’t board the train already scanning – he could have just slipped out in Düsseldorf and lost them at the train station.

Well, there’s still option three, but from their perceived level of arrogance, fighting them right out was probably just a creative way of committing suicide. That and the fact that Paul didn’t like odds along the lines of “there’s quite a lot of them, and I’m alone”.

There might be a few select circumstances where he could overwhelm then, but if the pursuers are worth their money, they’re probably running a optimistic derivate generator, which would make it all but impossible for him to have the necessary kind of luck.

Back to option two, then. And he can already feel the pull of the searcher’s need getting stronger, which means he’s getting closer.

He surveyed the layout of the train and then dialed down his perception to a level slightly above average – which still gave him an advantage over almost everyone he would encounter. Paul got into a slight moment of panic as the toilet door wouldn’t open, but then it suddenly budged and he could get out.

Heading back to his seat again, Paul again had to struggle, but mostly with luggage this time; no animate objects actively blocking him, and even the kid was looking healthy again. (That, and everybody seems to have forgotten that he just puked all over the place.)

Paul was just leaning over to pick up his backpack as a voice behind him cleared its throat – surreptitiously, yet unmistakably directed at him.

He froze, and only when he slowly turned around he noticed that that conductor was smiling at him. “Guten Tag, die Fahrausweise bitte!” Ticket check.

At precisely that moment, the pull hit him full force, and he knew that it came from the conductor.

Slightly flabbergasted, he produced his ticket from somewhere inside his backpack and showed it to the conductor, and as soon as she nodded and thanked him, the pressure went away.

Why did he just think people were out to get him? Was he actually getting paranoid? Why was he being so oversensitive? He was convinced the Inquisition was about to get him, but it was just a bloody ticket check.

Paul relaxed and sat back down, letting his head sink back into his neck and rest against the chair.

“Nächster Halt: Duisburg Hauptbahnhof. Ausstieg links” the announcement robot said, indicating that they were close to stopping at Duisburg.

He stopped staring at the ceiling, and decided he needs to get out at Duisburg anyway. The train would drive him crazy if he stayed on any longer. Paul looked ahead, in the direction of the doors.

There were two men standing there. He was still using his heightened senses, and he noticed that they weren’t just your regular blokes waiting to get off. They were tensed and ready to move at a moment’s notice. And they were carrying.

Paul glanced back, in the general direction of the conductor.

She was holding a finger to her ear, which, he now noticed, held a small headset.

And with a sudden thunder clash, men started running in his direction.

Their pull became stronger than background level and almost tore him apart. They had managed to keep it suppressed. They were good.

Paul went into automatic mode. He pulled hard at the isolation seal of the window next to him, ripping it clean off, and with another decisive shove, the window sprang out of the frame and crashed on the track bed.

He grabbed his backpack and swung himself outside. His pursuers were still struggling their way to him, shouting and pulling weapons. Their obstruction field failed to overpower his need for survival.

Paul drew on his powers and enhanced himself – no use being subtle now. He grabbed onto the train and climbed up the side with a couple of strong pulls which sent him flying upward.

He looked around and found no-one atop the train. Silly buggers were trained good, but not good enough.

Looking forward, he saw the train slowing as it entered the station.

Paul broke out into a sprint and with one giant leap jumped over onto a small building next to the track, landing with a roll and leaving a dent in the ground. His pursuers took a few potshots at him, but they went wide.

He sighed a breath of relief. They had good men, but their tactician had sucked balls. Else he wouldn’t have gotten out of the toilet alive. Thank creation for small gifts.

Paul jumped down from the building and started running away. The adrenalin rush doesn’t float him any longer than it does any normal human, so better use it now before he crashes and starts sobbing.

He had stopped counting how often his days ended like this.

In a sense, it never got old.

Value of two-factor authentication in MMOs

Cypherpunks everywhere know that using two-factor authentication, when done right, is inherently more secure.

Nothing can be said against the security of wisely-used one-factor authentication, but care must be taken to ensure the ongoing security of that factor. If you use a password, you need to choose a secure one – and if you don’t change it regularly, it logically gets weaker, too.

I know of at least one WoW player who is positively paranoid about exposing their passwords to someone, even though they don’t exhibit that behaviour elsewhere.

And then, of course, there’s the people who complain about having their accounts hacked, even though they used a secure password like their birthday. Or abcde.

A mitigating factor against people being too stupid to use passwords securely, then, is needed. And that’s where two-factor authentication comes along.

Two-factor authentication, in essence, means that there you need to prove your own identity by two different means. This isn’t like using two different passwords. The common examples for factors include “things the user knows” – like a password, PIN, etc, “things the user has”, like some form of physical security token, and “things the user is”, i.e. biometric verification methods.

Biometric verification is more “comfortable” to use, but does have two major drawbacks:

  1. it requires specialized equipment (in most cases)
  2. it is vulnerable to replay attacks

So, mainly for reasons of practicality, owning an authentication token is the best method of getting a second factor into the mix.

But why would a company like Blizzard, for example, cough up the effort to actually enable something like authenticators – not only via device, but by mobile phone, too – and then go ahead and reward players (in the form of an in-game pet, but nevertheless) for using an authenticator – merely to save people from their own stupidity?

Simple enough: to help battle against “economic” abuse, and to help protect their own interests by having to deal with less “hacked account” cases.

Even though the latter reason might just be enough to implement it, the former is actually the most important one. Gold farming is a serious problem for online gaming companies, and even underdeveloped economies like that of WoW can suffer greatly from such manipulation.

If you want to read a fictional example of a near-future vision on the importance and concepts of gold farming, you should read up on Cory Doctorow’s “For The Win”. Even though it’s a bit over the top compared to the current state of the game, it might very well be similar in the years to come.

Of course, the battle.net authentication token Blizzard distributes does seem to have reliability problems, the mobile authenticator – a Java application – seems to work fairly well, and, compared to the DIGIPASS Go 6 authenticators used by Blizzard, actually has a reverse-engineered spec available.

Even though the DIGIPASS algorithm was, to the author’s knowledge, not broken so far, the fact that the developing company does not disclose the DIGIPASS source code to non-customers, along with a rather cheeky attitude, should serve as sufficient indicators to avoid their products.

Using grub2 to recover your system

grub2 is hailed as the all new, super modular cure-all remedy for all booting problem you’ve had, have and will have. At least that’s the way the developers and some enthusiasts see it, whereas most blokes who’ve actually had to use it with more than arrow keys and enter will paint a slightly different picture.

The thing with grub2 is that even though in theory it sounds like the end of all things booting, it’s about as well-documented as the question for life, the universe, and everything.

And as I today had to try to fight my way through googling for necessary information again, I’d thought I’d create a quick step-by-step reference with all the most interesting bits you’ll ever need already there.

Thusly, the ingredients needed to resurrect your computer with grub2. The gist is that you have the goal of booting one specific operating system on your computer, from wherein which you’ll use whatever methods you deem necessary to update your grub in the “right way” – usually a downgrade to an older version and waiting for the dust to blow over.

  1. A booting grub2. If your grub2 already fails to boot because of some random error, you need to get a grub in smelling distance of your BIOS. One of the most proven methods is to
    1. Download a USB rescue image like grml (usually from Your Other Computer or that of somebody else)
    2. Put it on an USB stick (dd if=grml-variant_version.iso of=/dev/sdx in most cases, with appropriately chosen variables)
    3. (Re)boot, eventually adjusting the priority for your USB HDD/USB key

    And that’s it, you’re in a grub. Also note that it’s recommendable to have an USB stick with a rescue image lying around for the times when you can’t just easily download it.

  2. Enter the command line/shell mode by pressing ‘c‘.
  3. Do an ‘ls‘, which will give you a listing of recognized devices. Doing an ‘ls device‘, e.g. ls (hd0,1) will give you more information about that device.
  4. If the information by your ls isn’t complete, you will have to load some modules (by using insmod modulename). Here’s a checklist:
    1. If you do not see any other devices which look like your hard drive(s), e.g. you only have an (hd0) device from your USB medium, then load a device driver. They will allow you to find the actual devices. Examples include:
      • biosdisk
      • scsi
      • fs_uuid
      • pci
      • raid
      • mdraid
      • dm_nv
    2. If you have devices, but no partitions, you’ll need a partition driver. It seems the default grub config does not load any partition driver, and debugging this is just a bit annoying. But there’s two easy choices for most people:
      • Load the module “part_msdos“.
      • If this doesn’t help, try “part_gpt“.

      These are the two most common partition tables (at least for next to everyone reading this guide in need) and should help your grub find its partitions again.

    3. Eventually, you will also have to load your filesystem drivers. I presume you already know which those are, but for the sake of completion:
      • Almost all Linux use ext2
      • Most current Windows will use ntfs, but fat is also an option.
      • Mac users will use hfsplus for newer systems, hfs for older ones.
    4. The next step depends on exactly what you want to do. There’s a fork in the road – if you just want to load your previously unbootable grub, you will try to load its configuration file, else you’ll try to boot your operating system kernel.

    5. To search for a file, you use the search -f filename command, which will give you results on where files of that name are stored. Use root device to set the resultant device as the root device for your further operations. If you only want to load your old grub config, type in configfile filename, whereas filename will usually be something like /grub/grub.cfg or /boot/grub/grub.cfg.
    6. Should this fail to resolve your problem, or not be what you’re aiming for, you’ll need to find the operating system. For most Linuxens, you’ll probably have a file called /vmlinuz or /boot/vmlinuz to search for. For Windows operating systems, look for /Windows/win.ini. For Mac: no clue. When found, set your root device (with root device).
    7. Now methods will become divergent, as operating systems differ in the way of booting them.
      Linux
      1. kernel kernel_filename
      2. initrd initrd_filename [most current kernels come with an “initial ramdisk” holding modules etc.]
      3. boot – if all goes well, you’re set.
      Windows
      1. chainloader +1
      2. boot
      MacOS
      Probably the same as Windows, using the chainloader.

    And that’s it. It should cover most cases you’d need to restore your capability of booting your operating system. You’ll probably want to fix/install your bootloader after this, though.

    A helpful tool for debugging your current grub state is probe, which will allow you to check what drivers are assigned to devices.

vimium mapping for Dvorak layouts

I recently stumbled upon the rather neat vimium extension for Chrom(e|ium), which does much the same as the vimperator extension for Firefox. The problem, though, as with vimperator and vim itself, is that the default keyboard mappings are a bit of a pain in the arse for Dvorak users, as hjkl isn’t on the home row anymore, much less next to each other.

Therefore, it needs some remapping to get in a halfway familiar and Dvorak-compatible layout, which would look like this:

unmapAll

map r reload
map e removeTab
map u restoreTab
map h scrollDown
map t scrollUp
map d scrollLeft
map n scrollRight
map <c-h> scrollPageDown
map <c-t> scrollPageUp
map <c-u> scrollFullPageDown
map D goBack
map N goForward
map T nextTab
map H previousTab
map <c-y> createTab
map gg scrollToTop
map G scrollToBottom
map gf toggleViewSource
map zi zoomIn
map zo zoomOut
map yy copyCurrentUrl
map i enterInsertMode
map f LinkHints.activateMode
map F LinkHints.activateModeToOpenInNewTab
map / enterFindMode
map . performFind
map , performBackwardsFind

Just paste it in the remap field of the extension’s “advanced options” menu.

D&D rules lawyering: cover and stealth

I was recently reading up on the stealth and cover mechanics, and even though I was fairly certain about what is and what is not possible, I found out that one edge case isn’t particularly well-documented.

The rules, to be exact the Stealth rules correction from Player’s Handbook 2, state:

Becoming Hidden: You can make a Stealth check against an enemy only if you have superior cover or total concealment against the enemy or if you’re outside the enemy’s line of sight. Outside combat, the DM can allow you to make a Stealth check against a distracted enemy, even if you don’t have superior cover or total concealment and aren’t outside the enemy’s line of sight. The distracted enemy might be focused on something in a different direction, allowing you to sneak up.

So, what it especially says is that “superior cover” works as a basis to get hidden behind. According to the Dungeon Master’s Guide on determining cover for ranged attacks:

Choose a Corner: The attacker chooses one corner of a square he occupies, and draws imaginary lines from that corner to every corner of any one square the defender occupies. If none of those lines are blocked by a solid object or an enemy creature, the attacker has a clear shot. The defender doesn’t have cover. (A line that runs parallel right along a wall isn’t blocked.)
Superior Cover: The defender has superior cover if no matter which corner in your space you choose and no matter which square of the target’s space you choose, three or four lines are blocked. If four lines are blocked from every corner, you can’t target the defender.

So, in theory, if you’d have a situation where you’d have superior cover from an enemy, e.g.
Illustration with a player behind two allies, and lines of sight to an enemy.
you’d be able to stealth yourself and gain combat advantage.

The only thing that really denies this possibility are, again, the Stealth updates from Player’s Handbook 2, this time the “Remaining Hidden” section [emphasis mine]:

Keep Out of Sight: If you no longer have any cover or concealment against an enemy, you don’t remain hidden from that enemy. You don’t need superior cover, total concealment, or to stay outside line of sight, but you do need some degree of cover or concealment to remain hidden. You can’t use another creature as cover to remain hidden.

Many thanks to @Milambus for looking up that passage. [And making me feel stupid for not having found it myself, by the way.]

And that’s the only problem. So, you could gain stealth moving behind enemies, but immediately lose stealth status again by being only behind a creature.

In a sense, this is balanced, since your rogue strikers could then just continue to camp behind your own fighters and shoot sneak attacks at enemies from just behind their buddies (since they don’t block for the player), which would make combat encounters quick enough, but also a bit boring.

Then again, as my player rogue pointed out, when there’s two huge dragonborn warriors pounding away at an enemy, how are they not supposed to be able to hide behind them? They aren’t 5′ wide, surely, but certainly bigger than a half-elf in every other dimension.

I just think that with a further update (yuck), we might be able to get a bit of clarification on the fact how allies grant cover, but cannot grant superior cover.

D&D Characters: Shamorn Fallenheart, Tiefling Bard

As a bit of a side occupation, I like to engage in some character design for role-playing games, as it just comes as a natural extension of being a hobby-ish writer person.

Thus, I present: Shamorn Fallenheart, a tiefling bard from High Imaskar.


Birth – and over misgivings

Shamorn was born in Gheldaneth, the fading Mulanian metropolis of High Imaskar, and his parents believed in the prophecies stating Shamorn to bring forth better times for the tiefling folk of the Gheldaneth slums. Being raised in a community of hired hands to accompany adventurers on dangerous treasure hunts through the depths of the sunken city, hopes were laid on him, and him alone, to liberate them from this life of unofficial slavery.

Early life

Our young tiefling was always a bit pampered. The male role models of the community were often too busy getting killed on a foolish quest, as was Shamorn’s own father – shortly before his fourth birthday. As it were, there was none of the usual goading and testing a tiefling endures as part of growing up. The consequences of this, as well as the pampering he received by his mother and other “faithfuls”, would be dire indeed.

Thus Shamorn grew to be a young adult, helping out everywhere in the community, without ever taking up a real job. He had many on and off teachers, versing him in skills as @skills and the heritage of the tiefling race, training him in the use of weapons and telling stories of heroic deeds throughout time.

Constantly surrounded by an appreciation for life, for heroism, the history and culture of his people and a will to bring good to them, it came as a great surprise to many that Shamorn Fallenheart, Prophesied Saviour of the Gheldaneth Tieflings, came to start training to be…

a bard.

There was a wandering Elven Bard in Gheldaneth at the time, and Shamorn choose to apprentice himself to him, believing that becoming a bard, a herald of their people, would be worth much more than simply slaughtering any would-be oppressors or being a leader to guide the people to their Promised Land.

As was to be expected, his decision did not sit well with some, if not most, of his elders. His mother came just short of disinheriting him, and he was forever branded as a wimp by most others. Still, there were some people who still believed in him, and he managed to stay in the community, even though everyone tried to forget about any kind of prophesy laid upon him.

The turning point

His apprenticeship was going well, all things considered. But his teacher, unbeknowest to him, was a bit of a braggart and ignorant, that is to say: not a very good bard. Still, Shamorn managed to master his natural graps of the Arcane under his tutorship, even though the social values might have been slightly distorted.

Sadly, this distortion and the infusion of heroic tales led to an unfortunate incident. A rough band of treasure hunters, with a fierce reputation for their harsh effectiveness and rumours of a brutal and unrelenting manner towards opposition, sought out their enclave to hire some of their men for help. So, after a few minutes of shouting, waving of weapons and dragging people out of their hovels, Shamorn thought it was time to act.

Bravely stepping forward, he confronted the leader of the scavengers, demanding of him to cease these despicable acts and appealing to his good sense, as a man, to respect his people’s wishes.

The screams as the leader’s minions started slaughtering the women and children are still stuck in Shamorn’s head. He still only has vague memories of that moment, but there is one thing he is quite confident of:

As his mother’s lifeless body was thrown in front of him, crumpled up in a heap, he snapped. Shamorn went into a rage, slamming into the minions and fighting them fiercely. It seemed the demon in him had taken control, for he was full of laughter at the slaughter he was causing, taunting his enemies as he smashed their faces in with his $weapon or embedded his daggers into their hearts, even just ripping into them with his claws and biting as he went along.

It did not take long for him to cut through the minions, emerging bathed in blood, eldritch powers abound and flames crackling around his body. His Elven master bard was astonished at the display, and recognized the potential of a warlock in him should he have even been trained thusly. As it was, the teacher preferred to cower in fear and observe what happened next.

Shamorn confronted the leader of the scavengers who was just standing there, shocked to his core.

“This is what happens when you try to compel my folk, human!” the bard stated in an almost neutral voice, only a hint of a burning darkfire noticable in the voice. And with that, he slew the leader of the group that brought death to his kin.

And as if by miracle, Shamorn immediately calmed down to his usual, naive self. The only hint at his monstrosity was the fact that he surveyed the slaughter he had caused without fear, shame or disgust. Looking around him, he found few people left alive. Some were cowering inside their hovels, either hiding their faces or staring out at him with fear. Others seem to have run a way, and it was eerily silent.

Shamorn cleared his throat. “My master, I will be leaving now. Do you wish to accompany me?”

His master, still shaking slightly, replied “No, my apprentice. I do not think that you need me any further. Consider your training complete.”

And with these short words, the recently orphaned Shamorn Fallenheart set out into the Realms, venturing forth to herald his people – and to leave this blighted home which has been cursed by his deeds.


The character statistics will follow as soon as I have access to the relevant documents again. I might also write a short story or two detailing the background or later adventures.

pisg: patch to irssi parser for euIRC ‘admin’ user mode

As pisg is ill-equipped to handle support for ‘admin’ users in the standard configuration, I went on a quick code hunt to find the bit of code responsible for stripping nick modes from a log line. A bit counter-intuitively, this function is called normalline, and not something like normalize or strip_mode.

Anyhow, here’s a small patch to fix the problem for the Irssi parser module:

--- modules/Pisg/Parser/Format/irssi.pm.old	2008-02-13 21:40:25.000000000 +0100
+++ modules/Pisg/Parser/Format/irssi.pm	2010-03-16 02:29:42.000000000 +0100
@@ -10,7 +10,7 @@
     my ($type, %args) = @_;
     my $self = {
         cfg => $args{cfg},
-        normalline => '^(\d+):\d+[^<*^!]+<[@%+~& ]?([^>]+)> (.*)',
+        normalline => '^(\d+):\d+[^<*^!]+<[@%+~&! ]?([^>]+)> (.*)',
         actionline => '^(\d+):\d+[^ ]+ +\* (\S+) (.*)',
         thirdline  => '^(\d+):(\d+)[^-]+-\!- (\S+) (\S+) (\S+) (\S+) (\S+)(.*)',
     };

Or you could just download the diff directly.

A new reason for leaving Ubuntu

So, if you’re wondering yourself: “Why, Ubuntu is in the process of making everything quite a bit more annoying and fucking things up”, yet still think “that might just be misjudged opinion”, then fret no more. There’s an easy way to now know that Canonical has officially gone bonkers.

The Ubuntu One Music Store.

After installing an annoying App Market-like “Software center” by default, switching users over to a IM client that’s only remotely usable, trying to sell you a cloud-based storage solution and switching to Yahoo as the default search engine, you really have to wonder what the guys responsible are up to.

So.

In short, Canonical is on the verge of going Apple. Just bail boat while you still can.