BigSmoke

Smokes your problems, coughs fresh air.

Page 43 of 52

My Window Maker “desktop” configuration

During the ten years of my love-hate relationship with X-Windows, I’ve often tried and enjoyed using full-fledged desktop environment (starting with KDE and later sometimes GNOME too), but, given time, I always gravitate back to WindowMaker.

XTerm

I’m not so big on the whole desktop metaphor thing. The longer I’ve been using Unix-like systems, the more dependent I’ve become on the command-line. My current Window Maker configuration is a testimony to this. If you look at my Main Window Maker Workspace, you’ll notice that I actually use an Xterm instead of a desktop. Also, I don’t have a wallpaper. No wallpaper, no icons: I just want my prompt, in a nice font.

I despise graphical file managers. It feels like having to type without fingers. I’m not advocating the use of a command-line shell for new users or anything but for somebody like me who is used to calling programs “by hand”, a GUI is pure torture. With a GUI, I end up having to find a specialized program for a lot of mundane tasks which can be accomplished in Bash with a simple loop and a few filters. Renaming a few hundred files springs to mind.

My Main Window Maker Workspace

My Main Window Maker Workspace

GNU Screen provides for “tabs” in my XTerms and some other features I’ve come to depend on. That’s why, upon login, my Main Workspace appears with xterm -e screen already started. The Windows Key + T fires up another XTerm with a fresh screen session. If I want to attach to a previous Screen session, I use Window+Shift+T. This starts an XTerm without Screen.

Starting applications

I don’t like the applications menu, but I’ve added a few applications to it anyway to be able to bind short keys to them (Win+F for Firefox and Win+T for XTerm). When I want to start any other application, I use the run dialog (bound to Win+R) or I execute the app from an XTerm window. I don’t usually start applications by clicking their App Icon.

File viewers (such as Mplayer, Gliv, Okular, xlview, and wordview) are always started from an XTerm or from Firefox, because that’s where all my file arguments originate. These apps don’t need App Icons, especially because I don’t see them as belonging to any particular workspace.

All keyboard shortcuts

Instead of Alt, I use the Window key (Mod4) a lot for my keyboard shortcuts.

cat /home/bigsmoke/GNUstep/Defaults/WindowMaker |grep -i key|sed -e 's/^\s*//'|sort
CloseKey = "Mod4+Q";
FocusNextKey = "Mod4+Tab";
FocusPrevKey = "Shift+Mod4+Tab";
HideKey = "Mod4+H";
HideOthersKey = "Shift+Mod4+H";
HMaximizeKey = None;
LowerKey = "Mod4+Down";
MaximizeKey = "Mod4+M";
MiniaturizeKey = "Mod4+period";
ModifierKey = Mod4;
MoveResizeKey = None;
NextWorkspaceKey = "Shift+Mod4+Right";
PrevWorkspaceKey = "Shift+Mod4+Left";
RaiseKey = "Mod4+Up";
RootMenuKey = "Mod4+A";
ScreenSwitchKey = None;
ShadeKey = "Mod4+minus";
ToggleKbdModeKey = None;
WindowListKey = "Mod4+W";
WindowMenuKey = "Mod4+Escape";
WindowShortcut10Key = None;
WindowShortcut1Key = "Mod4+1";
WindowShortcut2Key = "Mod4+2";
WindowShortcut3Key = "Mod4+3";
WindowShortcut4Key = "Mod4+4";
WindowShortcut5Key = "Mod4+5";
WindowShortcut6Key = "Mod4+6";
WindowShortcut7Key = None;
WindowShortcut8Key = None;
WindowShortcut9Key = None;
Workspace10Key = None;
Workspace1Key = "Mod4+F1";
Workspace2Key = "Mod4+F2";
Workspace3Key = "Mod4+F3";
Workspace4Key = "Mod4+F4";
Workspace5Key = "Mod4+F5";
Workspace6Key = "Mod4+F6";
Workspace7Key = "Mod4+F7";
Workspace8Key = "Mod4+F8";
Workspace9Key = None; 

One annoyance is that, when switching through the Windows in the current Workspace (in my case, with Win+Tab and Win+Shift+Tab), doesn’t disappear unless an additional key press is given (such as an extra Tab).

Another annoyance is in my configuration. My keyboard has some space after every 4 function keys. Also, like always, the function keys are a bit far removed from the home row on the keyboard. So, I should consider switching through workspaces with Win+1 through Win+7 instead of Win+F1 through Win+F7. I’ve now bound the Win+<number> keys to a Window 1 to 10, but this seems to be terribly broken anyway in Window Maker (I can only switch to the first window in the first workspace this way). Also, I probably wouldn’t use it even if it did work, unless if they displayed the window numbers on the app icons or something and if they did the numbering on a workspace basis instead of globally. So, I’m probably going to change this soon.

My Window Maker Workspace for Audio

My Window Maker Workspace for Audio

Workspaces

One of the things I’ve always like about X Window Managers is the support for multiple virtual desktops, called Workspaces in Window Maker. I use topical workspaces, one workspace per application category. It’s possible to configure app icons to always start the application in the correct workspace regardless of where it is started from. My Workspaces are called Main, Audio, Video, Down, w3dev and Image.

If I want to look at my downloads, I know that I just have to switch to Workspace 4 (Down) regardless of what I’m downloading. The same goes when I want to switch a song (be it in Mplayer (in an XTerm) or in the Last.fm Player): I press Win+F2.

Here’s a list of all the app icons divided over my different workspaces:

  1. Main: Window Maker Preferences, Google Earth, Skype, Filelight
  2. Audio: Rosegarden, Audacity, Hydrogen, Last.fm, Grip, Ardour, ReZound, Gnaural
  3. Video: Cinelerra
  4. Down: BitTorrent, uTorrent, Transmission
  5. w3dev: MSIE, Konqueror
  6. Image: Krita, Inkscape, GIMP, Color Schemer Studio

I have a widescreen laptop, so I display all these per-workspace icons (with the Clip) vertically at the top left. At the bottom left I display the “Icon List”. This is used by WindowMaker for icons that are not already in the Clip or in the Dock.

At the right I display the dock with the XTerm icon and the Firefox icon. There’s also an Emacs icon there from the time that I wanted to learn Emacs. (Sadly, I know VIM too well to change.)

Below that, also at the right, are the Dock Apps: wmsystray, WMWiFi, wmmixer, WMitime, wmbattery, and of course wmMoonClock.

Why Window Maker

With all this reluctance to click on icons, you’d wonder if I wouldn’t be better of trying something more keyboard centric such as StumpWM (the successor of Ratpoison).

If I will, I’ll let you know.

Mounting a MediaWiki installation with WikipediaFS for FUSE

Another one of those I-wish-I-had-blogged-about-this moments: I wanted to bulk-edit some pages in my Dutch Hardwood Wiki and I knew I had previously done some scripting using a FUSE filesystem for MediaWiki. However, I didn’t remember the name of the filesystem I had used before. Searching for “mediawiki fuse” didn’t help in any way.

I found the link again in the Wikipedia meta-space. Now that I know that it’s called WikipediaFS and not something like MediaWikiFS, I remember that this was the exact same problem as the last time when I was looking for this. But, alas, I’ve blogged about it now, so now I can safely forget the name again. 🙂

Extracting the MP3 stream from a Flash Video (flv) file

I wanted to convert an Flash Video (flv) file from YouTube to MP3. The first tip I found essentially streamed the original file into a different file:

ffmpeg -i filename.flv -acodec mp3 -ac 2 -ab 128 -vn -y filename.mp3

This is a bit awkward, because not all flv files have the same quality (some are mono, for example). I don’t want to have to look up the number of channels (-ac 2 in the example) for each file that I need to convert.

Luckily, most flv files include an MP3 audio stream and ffmpeg can simply copy that stream to a new file:

ffmpeg -i filename.flv -acodec copy filename.mp3

This works perfectly and is much faster than the other method.

MediaWiki problems with MySQL VARBINARY padding

I have been wanting to protect a certain page on my Dutch 15Monkeys wiki for weeks. I could install the ReCaptcha extension already (the best Captcha there is), but it’s just that one page that’s being spammed. So far, I’ve been unsuccessful in regaining my Sysop right for that wiki. I need these rights if I’m going to protect these pages.

In the previous post about this problem, I reported how there appeared to be padding problem caused by a MySQL upgrade. Fixing the padding didn’t solve the problem, however. If I look at the user list in MediaWiki, I notice that MediaWiki doesn’t seem to like it that MySQL returns all the \0x0 padding characters on SELECT:

15Monkeys MediaWiki NL user list with unrecognized characters

15Monkeys MediaWiki NL user list with unrecognized characters

The same problem in the EN wiki

The same problem in the EN wiki

BigSmoke ‎(bureaucrat������, sysop�����������)

Repair was suggested by the check operation in phpMyAdmin. (CHECK TABLE `mw_nl_user_groups`) I couldn’t find a repair operation (only OPTIMIZE), so I tried that and I was told that it went ok. In the database structure view, the repair option was available ; when I tried to repair all the tables belonging to this installation, I was told for this particular table (and one other) “The storage engine for the table doesn’t support repair”. I found out that the reason this error didn’t appear the first time because it appears quite randomly. Sometimes it just silently fails in true MySQL style.

Googling for the error message produced the advice to dump and recreate the table. Then, when recreating the table from my backup didn’t work, I found out that REPAIR really isn’t supported for InnoDB. Only CHECK is. If you want to repair an InnoDB table, you use OPTIMIZE or you have to restart mysqld with the innodb_force_recovery option enabled.

Then, it turned out that I misinterpreted the MySQL documentation for the VARBINARY type, although I still can’t figure out how I am supposed to deduce this from said documentation. Anyway, if I UPDATE the rows, all I can achieve is that whitespace is converted to \0 characters. But, if I reinsert them without the padding, it does work. 😕 Go figure…

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
« Older posts Newer posts »

© 2024 BigSmoke

Theme by Anders NorenUp ↑