Smokes your problems, coughs fresh air.

Month: February 2009 (Page 1 of 2)

Wget one-liner

Earlier today, I wanted to download all songs by this totally kick-ass rap outfit:

wget -q -O - http://www.assheads.nl/dehuilenderappers/?p=nummers \
| sed --quiet -e 's#^.*<a href="\(nummers/.*\.mp3\).*$#\1#p' \
| sort -u \
| wget -i - -B 'http://www.assheads.nl/dehuilenderappers/'

The same command-line, now using GNU long options to increase readability:

wget --quiet --output-document=- http://www.assheads.nl/dehuilenderappers/?p=nummers \
| sed --quiet --expression='s#^.*<a href="\(nummers/.*\.mp3\).*$#\1#p' \
| sort --unique \
| wget --input-file=- --base='http://www.assheads.nl/dehuilenderappers/'

Silent change in URLs of Ruby on Rails svn repository

I don’t know why, but everything associated with Ruby on Rails seems to change all the time, without notice, or (in the case of URLs) without redirect.

We used http://svn.rubyonrails.org/rails for our svn:external deployment of rails 1.2.6. But that suddenly stopped working. The Ruby on Rails weblog doesn’t contain any information on it (that I can find), going to svn.rubyonrails.org with my web browser yielded just the front page of the weblog and Googling didn’t help much. That is, until I accidentally found http://dev.rubyonrails.org/svn/rails.

So, I changed the svn:externals from “rails http://svn.rubyonrails.org/rails/tags/rel_1-2-6/” to “rails http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-6/” and now it works again.

WordPress feed pagination

Wiebe uses his author Atom feed to generate a list of his blog posts here on his own website. WordPress feeds only display the latest 10 entries. He has written 16 so far. What he needs is a feed with all his entries.

First, I tried if pagination works for feeds. Appending “/page/2” (as is used an non-feed lists) to a feed URL gives a 404 so I was kind of stuck there. Four days ago, after Googling for some time, unable to find a solution anywhere, I asked on the forum. Still no answer today so I tried to find out which parameters WordPress accepts in the QUERY_STRING. The WordPress Codex does explain how queries are handled but not which parameters are accepted.

Digging into wp-includes/query.php, with much trial and error, I found out that I can append ?paged=2 to the URL to get the next page. At least I got that sorted then. There are a number of much more promising parameters supported by get_posts(), but these don’t seem to be parsed by parse_query(). Next time, I’d like to find out how how to use two of these: nopaging and posts_per_page.

Wiebe could complete his list by merging together all the pages of the feed, but I’d much prefer to find a relatively painless method to produce a feed with an unlimited number of posts.

Notes

  • http://codex.wordpress.org/Query_Overview
  • http://codex.wordpress.org/Function_Reference/WP_Query
  • http://codex.wordpress.org/Template_Tags/query_posts

Jock itch: my cock itch

Ok, so according to the family doctor it was never a fungal infection (which a jock itch is), but really eczema. Nobody knows what that is. Whatever. I’m not a doctor. It itches and it affects my cock, so I am just going to refer to it as my cock itch. I hate doctors. Really. I can’t stand them. Or, at least: I fear them. Which is probably the same. Anyway, doctors are truly useless. Why would I want some jerk-off to finger my privates, glancing only ever so slightly and proclaiming ever-so-authoritatively what it is that is affecting my nether regions? I forgot even when I went to the doctor. It was in one of those positive bouts where I suddenly thought it’d be a good idea to seek treatment for a number of ailments that I was growing accustomed to. None of these ailments were remedied by following the doctor’s advice; here I am, years later, still suffering the same stupid symptoms. Fuck you, dear doctor! (She’s a lady and, no, I would not like to fuck her, especially with my sex organs all itchy and sore. Neither would she; she’s actually seen my sex organs. 😯 ) My toenails (another story, which will be much better with pictures) have deteriorated and my “eczema” has only continued to conquer fresh, virgin territory. Yeah, ok, maybe not completely “virgin”, but not far off either. I have gotten laid precisely once in the past nine years and (apart from my general awkwardness) the sensitivity, shame and soreness at the time led to an experience so horribly traumatizing that I have been seriously wishing for my cock itch not to go away. It won’t. I’ve actually been worried for a bit that I might have infected that girl with some kind of fungal goo. Should I have told her? I worried, but the doctor had told me only months before that it was just eczema. I had even been given prescriptions for some ridiculously ineffective and unpleasant hormonal creams (another rant altogether). Then, my shame somewhat subsided when I learned that my girl had been getting it on with anyone confident enough to treat her unfriendly while I was “dating” her and that she did have to seek treatment for an actual STD just before and after we dated. The cunt! And that bitch had me worried for her health! Fuck you, bitch! Yeah, I guess I’ll have to call you bitch; I can hardly refer to you as my “then girlfriend” because I have only been allowed to call you that for like 10 minutes, bitch! How did these other guys call you then? Surely, you must have been their bitch. (Just be glad I don’t post your full name in this post; I’m good with Google. Bad with privacy too.) Ok, this rant to hide my feelings of sexual inadequacy has gone on long enough. If you want to hear more juicy details about my sex life, you’re out of luck, because, unless you count masturbating wildly in front of a mirror, I don’t have one. (No wonder.) The only thing that is satisfying about my sex-life is the size of my dick, which is pretty meaningless because where am I going to stick it? Surely not in miss STD again; she broke up with me precisely because of my broken sexual performance. Otherwise, my doggish stupidity would have kept me all dedicated to appreciating the scraps of love she threw me in exchange for my desperate advances. The cunt! No, wait: the rant hasn’t gone on quite long enough. That sex-experience might have been horrible either way, but I’m sure the only-just-barely-recovered skin that would increasingly hurt with every minute of intercourse didn’t add up positive to the already negative, frightful mood. What do you expect with a soul craving for affection, after surrendering my trust only to be continuously discarded as some kind of nuisance, a distraction to the fast life you were living? And where had the tenderness and playfulness gone? And how could either of these occur without some bloody time and peace? Yeah, yeah, sure. I was taking too much time already. Maybe that’s why you had to announce to your friends in fucking public that we were going to have sex for the first time. What the fuck?! And they say men are insensitive! You’re surprised I take it public now? Cunt. No, the whole debacle can not wholly be attributed to me. Surely you knew no mercy, although you could consider your toleration of my mechanic, cramped up and down movements a form of tenderness too. It was fucking horrible. I was completely paralyzed by fear. Fuck it. There’s no way to be politically correct about this. I’ve been fucking humiliated. Humiliated, fucking! I hope you have some aggressive testosterone-ridden rhino doing you now, someone who accidentally stumbles upon this blog and attacks me and—Ooo, that would be such a relief. Come and kill me, wankers!

The benefits …

There are upsides to penile itch, although it’s not the penis but the scrotum where these benefits are best felt: scratching. You should never scratch when you suffer from eczema. They say. Sure! Why won’t I just enjoy all the drawbacks and none of the benefits, eh? Scratching is great. Scratching is divine. Scratching is the glimmering gift of God to the scabby mammal. Fuck them! And hooray for scratching! I have to admit that I’ve gotten better at it too. I can usually scratch quite thoroughly without actually worsening the injury. This is especially satisfying when there’s a soft layer of whitey “pseudo-skin” on the loose. You can really put your nail into that stuff. Then, with practiced and applied, steady pulls, you can gather quite a bit of tissue that’s not doing anything useful anyway. Another kind of satisfying exercise is playing with the soft crusts. Sometimes, if you haven’t scratched too hard—scratching too hard will lead to real (bloody) crusts—you will get these kind of crusts that are really more like hardened skin fragments. Really great to tackle, these are. The pleasure of peeling these off cleanly, without serious harm, can only be compared to getting a nice, stubborn crust of snot out of your nose without enthusiastically causing a nose bleed. These crusts are especially good when you have to be truly, really extra, super careful because you’re quite sure that if you’re going to pull it a little bit more in this direction—oooe, don’t scratch that bit there!—you know you’re going to cause one hell of a bleeder. It’s like digging your nose, but so much more satisfying. Hell, any excuse to play with your dingly-dang is satisfying. There’s all kinds of crusts too. Every variation in between basically just a dry shard of skin and a very tough, nasty patch of dry blood in one of the seems of the ball sack. Sometimes I find myself trying really hard to remove a bump that’s really just a big white scar. ‘Wonder how that got there.

… to being dysfunctional

I made up all kinds of whack-job theories about my cock itch. They all revolve around personal development and blockages and fears and all that. The truth is: I like it this way. My cock itches. I’m twenty-six year old, so my cock would be itching either way. At least now I don’t have to contemplate the impossible, the unfathomable: having to actually please a woman. The very idea! It’s frightening as hell, and becomes scarier every day of every year. This year it’ll be ten years since my first and last pleasurable sexual experience. That’s a long time, and a lot of scary. But who am I, complaining? I’ve been celibate for years, celebrating the great special power that this would give me on an purely energetic level. My cock only started itching after I had gradually given up the idea that masturbation and sex would cost me my vitality and life force. If only catholic priests would be stricken by the same irony, life for choir boys would be much more pleasant. (Yes, I actually thought that abstinence would make me a better stronger person.) I’m a bad loser and I don’t like to take the blame for my own awkward stupidity. It’s not easy to miss how, by complaining about the lack of empathy of an eighteen year old girl, I try to drive the attention away from my own pathetic self: “Don’t look at me! I’m scared! Don’t touch me! You’re a woman! Look at me, please! Don’t! No! Do!” Thank you, my cock, my friend. Thanks to you and your condition, The Scary People can’t touch me. You saved me from the witches’ clasp.

Lame excuses (times 2)

Posting this blog post made me concerned with the privacy of the girl who allegedly humiliated me a couple of years ago. It shouldn’t. From my ramblings above it must become absolutely clear that I’m an inexperienced, frustrated, frightened kid who has barely grown beyond the emotional maturity of a toddler. A toddler with an ego that’s so big and sensitive that you need a map and a team of European diplomats to avoid collisions. The only thing you prove if you choose to dislike said girl after reading this is that you’re even more pathetic than I am. Seek help. Or, instead of flaming her, flame me. I like being flogged. It’s what I’ve always been avoiding, scared as I amwas of you and your cute, little opinion. But not anymore. Time has come for practice. Bring it on! If you still don’t understand, let me simplify: “Pushy, needy guy with emotional issues doesn’t want to hear ‘no’ and thinks it so romantic to open up and give everything anyway. He is then disappointed when things don’t go his way. Sooo sad. Also, his dick hurts, but not so much as his ego.” If this reflects badly on anyone but myself, I do apologize, because, although I sure as hell do mean it, it certainly isn’t justified. Now, fuck off and let me play with myself!

Using ROT13 to circumvent Gmail’s .exe filter

Wiebe reminded me by mail to send him a Windows executable. I use Gmail. Gmail doesn’t allow me to send archives containing .exe files. Something to do with viruses on Windows. Wiebe doesn’t use Windows. He uses Wine. I just want to send the damn executable.

Last time I wanted to do this, I emerged net-mail/email. But that just wasn’t very cool. A while ago someone also suggested using a password-protected zip file, but I find that even less cool because I hate zip files. (I usually prefer bzipped tarballs.)

ROT13 is a variation of ROT3, the Ceasar Cipher, which is as old as it is insecure. For computer use ROT13 is even cooler, because you can decrypt just as you encrypt. Decrypt and encrypt are the same. Let’s grab the simplestshortest C implementation we can find, rot13-shortest.c:

main(a){while(a=~getchar())putchar(~a-1/(~(a|32)/13*2-11)*13);}

Compile it and use it as a filter to encode a file:

rot13-shortest < suspicious.tar.bz2 > suspicious.tar.bz2.r13

To decode (to “decrypt” is too grand a verb), just swap the input and output files:

rot13-shortest < suspicious.tar.bz2.r13 > suspicious.tar.bz2

Now, it’s time for me to hand in my Geek Card. Firstly, I confused ROT13 with ROT3 (even spending some time trying to find a ROT3 implementation). Secondly, I had never used ROT13 before, not even to by-pass a forum filter or to make a joke which is funnier if you wear a pen-protector. EBG13 wbxrf whfg nera’g shaal.

xwd, the best X11 screen grabbing tool

xwd (1) is my favorite screen capture program for X Windows. Usage is simple:

xwd|xwdtopnm|pnmtopng>/tmp/screen.png   # Or:
xwd|xwdtopnm|pnmtojpeg>/tmp/screen.jpeg

Entering one of these commands, will give you a special pointer to click on the window you want to capture. That’s how simple it is to grab an X window with xwd.

You can also grab the whole screen with -root or exclude the window borders with -nobdrs. The manual page contains more options.

I was pretty elated when I first discovered xwd. I didn’t like having to invoke the GIMP, just for taking a quick screenshot. KDE and GNOME come with screenshot utilities, but sometimes I prefer other window managers (e.g.: this machine has been running WindowMaker from day one). Also the GNOME utility lost the option to exclude the window borders (in GNOME’s noble quest to become an appliance). All in all, I was glad to learn about a tool that I could count on to be available on most machines that have X Windows installed. Except, Gentoo has stripped many of these useful, little tools from the base install:

emerge x11-apps/xwd

WordPress 2.7 administration panel changes

I really, really liked the new style of administration panel that was introduced in WordPress 2.5. In all the time since I’ve upgraded (and increasingly with every update), I’ve started to like it more and more. I hadn’t thought it possible but everything just felt at exactly the right place, while before 2.5, the whole always felt like it had been thrown together by a blind child. Had I written it myself, it would have at least felt as being thrown together by an adult (chimpanzee).

So I was happy. And I’m still happy. Yet, this time, it does take getting used to it. That’s a bit sad. Probably, it’ll be for all the better, with more space for more (plug-in) features and everything. Still… I will miss the old interface.

Creating a custom device node for specific hardware with udev

Sometimes you want specific hardware to get a specific device name in /dev. For example, I want my backup hard disk to have the same device name. I can’t automate anything if sometimes the device is sdc and other times it’s sdd.

To do that, you need to create a specific udev rule. I put this one in 10-local for my backup hard disk:

BUS=="scsi", KERNEL=="sd*", SYSFS{vendor}=="ST325062", NAME="usbhd%n"

Everything with dual equal sign it uses as match, and I assign a different name at the end with a single equals sign.

You can look up the specific attributes to match in “/sys/bus/scsi/devices/[devicenumber]/”. The file “vendor” contains the “ST325062” I match for. My internal drives have vendor ATA (for whatever reason), so there will never be a conflict.

After having made the rule, you can use “udevstart”, “udevtrigger”, “udevadm trigger” or whatever your distro uses to test it.

Edit, this has been deprecated. Now it’s:

SUBSYSTEM=="scsi", KERNEL=="sd*", ATTR{vendor}=="ST325062", NAME="usbhd%n"

Clonezilla as disk imager

I was always using partimage to make backups of the hard disks of workstations. When trying to restore one the other day, it just started giving CRC errors. After recreating the image and running a simulated restore, it gave CRC errors again. So, apparently, it’s not incidental. It must be due to the experimental NTFS support. So, I set out to find a new tool. And that’s how I found Clonezilla, which gives me a very good first impression.

Clonezilla is a wizard-style live CD. It uses several tools, including partimage. However, it prefers ntfsclone over partimage at it’s default settings. Besides its handy interface, it has some very cool features: It doesn’t only create the image, but also some other useful files, such as the MBR (first 512 bytes of a disk), the data between the MBR and the first partition, an sfdisk dump of the partition table and some files with info about the PCI devices and other hardware. All this ensures you can properly restore the image.

Also, it has support for leaving out the page- and hybernation files on Windows systems, which can save you several gigabytes of space. And, to top it off, it calls “sync” when everything is done. They must have read my backup article :).

And the last major thing: it allows you to remove the CD when rebooting or halting. It is so incredibly annoying when live CD’s don’t do that…

A must have live CD for any sysadmin, I would say.

Gentoo update: Portage configuration confusion

During the first gentoo update session for this machine, I didn’t get very far. I already mentioned the problem I had with e2fsprogs, but this was not the first or the last problem that I had.

Until a few moments ago, I actually thought I made a bit of a fuck-up. I was meaning to make regular snapshots of /etc/portage files for a while now, because I was always just an echo something >> /etc/portage/package.keywords with one >-symbol too few away from destroying my configuration. Despite this fear, I thought I had already started deleting entries from /etc/portage/package.keywords and /etc/portage/package.unmask without backing up first.

Luckily, it turns out that I did make a dated copy of /etc/portage/package.keywords before starting on my modifications. I didn’t do so for /etc/portage/package.unmask, but I recovered a recent enough version from a recent full system rsync backup. So, everything is good. Still, I’m glad that I now use Git to track all changes in /etc/. All this goes to show that my methods are sometimes a bit more organized than my mind, which, I suppose, is a good thing. 😕

The point of this post—yes, there is a point—the point is that once you start mixing stable and unstable stuff, your system becomes, ehm, unstable. I have this huge amount of crap already in /etc/portage to cater to my wish to run stuff that I know to be quite stable but that isn’t yet marked as such in the Gentoo porttree. Now, after many months, I want to remove everything from package.keywords and package.unmask that is no longer necessary.

I was going to write about all the complicated upgrades, downgrades and conflicts suggested by Portage (mostly related to me removing KDE 4 stuff from package.keywords and package.unmask), because I was confused about what changes I had made. With the relevant backups readily available for comparison, I am no longer in a hurry to untangle my thoughts and I’ve moved the preliminary notes to a new draft for when I’ll actually update KDE 4.

Actual justification for this post

I’m trying to get into a blogging style were I post a lot more rubbish like this that can’t possibly be of any use to anybody except myself. I have plenty of reasons/excuses for this (about which I’ll likely post in the future), but I shouldn’t actually need any. That Ryan wanker who thinks I publish this blog for him should really shut the fuck up. Sure enough, he isn’t talking about this blog but I still think he’s a big-time asshole. Fuck you, Ryan!

« Older posts

© 2026 BigSmoke

Theme by Anders NorenUp ↑