Using vi as hex editor

There are many things vi can do, for instance invoke other commands to process files. That’s pretty cool.

Since installing Okteta isn’t always an option, here’s a small snippet on how to work simple capabilities into vi:

vi -b myfile
[in vi]: %!xxd
[to return to previous view]: %!xxd -r

Pretty easy, pretty handy. Something to keep in mind. Another thing to keep in mind: Always open binary files with the -b switch, otherwise you’ll damage the files when saving them with vi.

Autohiding Panels in KDE 4.2

It’s been possible for some time now to auto-hide panels. Now you don’t even need to mess in the configuration files anymore — thanks to a new panel settings menu. Absolutely awesome.

I have to say that I can’t really understand why someone would be unhappy with the way the menu is implemented right now. It’s easily accessable and easy to comprehend (in terms of what it does). If one wants to nit-pick: There’s no way to access the Desktop/Activity properties (wallpaper, Plasma theme etc.) from systemsettings. Boo-boo.

Making the NX Client portable

NX is great. I’m deeply in love with it. Sometimes it’s acting like a real jerk, though. The NX Web Companion is installing a lot of crap into the active user’s profile. The NX client writes stuff in the active user’s profile. Both isn’t really convenient for me.

I prefer to have all my settings with me on a USB thumbdrive. So, in the spirit of PortableApps I’ll show you how to simply turn NX into a portable application.

First thing to do is installing NX client on a machine, if you have installed already – that’s fine. Copy the entire program folder to a new directory structure like NxClientPortable\App (I’ll follow the PortableApps schema here). In NxClientPortable create a new directory named “Data” and a batch file with the following contents:

@echo off
set USERPROFILE=%CD%\Data

App\nxclient.exe %*

reg delete /f /va "HKCU\Software\Cygnus Solutions"
reg delete /f /va "HKLM\Software\Cygnus Solutions"

That’s it. Start the batch file and you’ll be fine. No need for installations, no files in some stranger’s profile. Everything goes back to your thumbdrive neatly.

This example also demonstrates why batch still isn’t dead: The USERPROFILE variable will be changed just within the scope of our batch file, all other applications will still use the path specified in the “global” instance of the variable.

Bleh

Seems Defensio kind of blocked more than I initially intended by simply crashing and throwing all comments down the pipe. Until the problem is sorted out, I’ve simply disabled the plugin completely. Sorry for the inconvenience.

On a bright note: Recent Firefox nightly builds allow for proper, stable windowless Flash. Yes, that means Flash doesn’t crash anymore. Whoopy-doo. Be sure to use this nifty extension when using nightly builds. And don’t forget that you can edit your existing /usr/bin/firefox to simply use the new prefix (i.e. /opt/firefox) which is especially handy.

New nVidia Linux driver speeds things up

The end of the world must be near: nVidia released a new version of their GNU/Linux driver that fixes some of the annoyances regarding RENDER performance. Given you apply some manual adjustments to the configuration the new driver performs in a somewhat usable manner.

It is still far from the beauty that ATI users can enjoy (in terms of performance) but it’s an immense improvement over the old, totally unusable slideshow.

Fixing the “null” date problem in WordPress

If you’ve been a constant reader of my blog (and of course I know you are 😉 ) you could hardly have missed the ugly “0” date in the archives. Turns out that this 0 date was caused by all the old drafts I had saved but never published. Deleting the drafts would help, but simply assigning them a date seemed like a more sane solution. Voila, problem solved.

Making Cygwin portable

One of the very packages I always install when I have to work with Windows is Cygwin. Being able to use my beloved GNU tools really makes things easier. Often I don’t have the option to install it. I grieved a little bit about the fact that some problems could be solved with just 2 commands that were — of course — missing from Windows’ horrendous command prompt. So I snooped around and built the following batch that’ll start a full-blown Cygwin session from i.e. portable harddisk:

@echo off set PATH=%CD%bin;%CD%sbin;%CD%usrsbin;%PATH set HOME=%CD%homePortable mount -bfu %CD%/ / mount -bfu %CD%bin /usr/bin mount -bfu %CD%lib /usr/lib cd %HOME% bash ----login -i

Easy, huh? All you have to do to make it work is renaming your /home/Username to /home/Portable (or simply adjust the setting in the batch). Pretty neat stuff.

Building recent Mplayer SVN + CoreAVC For Linux

As Michael points out there’s a slight problem with the CoreAVC For Linux patchset that enable Mplayer to take advantage of CoreCodec’s h.264 decoder — with recent changes in the sourcecode the old build_patch.pl script doesn’t produce usable output anymore.

There still is a way to compile Mplayer with the modification, though: Mithun Diwakar altered a patch to work against current subversion checkouts. How long this one will hold… we don’t know. But I think it would be preferable to fix up the patchbuilder. Maybe I’ll hack around on it during the weekend (no promise 🙂 ).

Wuala goes beta, Badges to celebrate

Along with the public beta of Wuala there’s also a new website.

Aside from the plethora of new information, a feature to install/launch Wuala straight from the browser and mucho polished bling, Caleido offers a few badges to advertise Wuala and link to your own shared files (very welcome indeed!)

Unfortunately all of those badges are… big. Many people (including myself) use the common 80×15 badges with the common layout icon on the left, text on the right.

That’s why I quickly threw together two small badges in the standard form-factor. Use them as you like 😉 .

Nice global environment variable additions

Since my vacation is coming to an end I thought I’d leave a nice little trick on how to administrate a number of environment variable additions for all users on the system.

Sure, there is the /etc/environment file but it seems rather limiting to me. I needed a little more control, so I came up with the following the little scripting:

Create a new folder /etc/environment.imports, in the folder just have a ordered/leveled number of scripts (i.e. 01_qt, 02_java). Add the following code to your /etc/profile:

# Custom PATH and LD_LIBRARY additions
xdg_source_list=`echo /etc/environment.imports/*`
for source_file in $xdg_source_list
do
 Â Ã‚ Ã‚ Ã‚ Ã‚ Ã‚  source $source_file
done

Now you can just export all the necessary additions through the files in /etc/environment.imports:

#!/bin/sh
export LD_LIBRARY_PATH=/opt/wine/lib:$LD_LIBRARY_PATH
export PATH=/opt/wine/bin:$PATH
export PKG_CONFIG_PATH=/opt/wine/lib/pkgconfig:$PKG_CONFIG_PATH

export XDG_DATA_DIRS=/opt/wine/share:$XDG_DATA_DIRS

This way it’s extremely easy to maintain a large number of custom-prefixed software for a complete system without touching the user’s custom profile.