Venturing into KDE4… and back.

Since anything I would write in long paragraphs would be nothing but a rant, I’ll keep it brief and half-way composed:

Blablabla, complaining about how much plasma agravates me right now (including theme, sound scheme is nice), blablabla, don’t care about all the other applications but fix the base desktop stuff, blablabla.

Blabla, not enough configuration options for the end user, blablabla, plasma settings for desktop don’t get saved on-the-fly but on logout, blablabla, zoom-out does happen without my written consent, blablabla, panel width dialog doesn’t allow typed vales > 1024, blablabla, Marble = great , blablabla, development speed has to be godlike to fix all this ’till 4.1. Blablabla, so for now I’m back on the proud 3.5.9.

It’s like KDE4 tries hard to look cool and stuff but when you ask it to dance it looks at you with big eyes and falls straight onto it’s pretty face. That’s the feeling I get.

Blablabla. Personally I think the devs are still the coolest kids on the block. Even if I can’t select multiple files on my “desktop”.

Did I forget anything… ah yes, blablabla.

Limit CPU consumption of applications on Linux

One of the more frequent questions in support channels: How do I limit a specific application to not consume all my cpu time?

While it is generally a bad idea to limit applications in that department, it is indeed quite easy…

Install the tool cpulimit (most modern distributions should have a package ready in their repositories!) and launch it with the correct parameters:

cpulimit -P /usr/bin/foobar -l 10

The command above would wait for program /usr/bin/foobar to be started and limit the CPU consumption of the application to a maximum of 10%.

Note that without further configuration you’ll need to sudo cpulimit or start it as a root. The specified application can be started in a normal user context, though.

Moving folders to the server side

Wow, the second Windows-related post today? Something horrible must be happening to me right now…

Anyway, you may know a situation like this: Many clients, one server and a terribly stubborn application that just wants to write into that one pesky folder on the local hard disk. Needless to say that thanks to your policies that won’t last a reboot.

So, how can we tame applications like that? People want their data to be available across the network, in a central location/database. If the application’s data is not transaction-dependant you’re in luck.

Unix-lovers know hard-, soft- and symlinks. Hardlinks are available on Windows XP as well, but the truly wonderful stuff comes in on Vista: You get the two other missing types.

That doesn’t mean that XP users are left in the cold, you can download the necessary tool from various sources on the net for free and give it a shot.

So, what is this mysterious tool? It comes with Vista and is called MKLINK. Just use it like this:

mklink /D "Damn local database folder" "\\SERVER\DatabaseFolder"

Yes, we can actually point to a UNC path and — given the client users have sufficient rights — will be able to browse the folder just like any other folder on your file system. That’s pretty sweet and incredibly useful for ol’ haggy applications.

Don’t forget that this operation (just like everything fun) requires elevated access to do!

Temporarily register fonts using a normal User account

As you may know Windows is quite stiff sometimes. You can’t add additional font directories like you’d do on Unix. Another stiffy problem is that Windows requires an elevated account for operations like installing/removing fonts from the system. That’s quite troublesome at times.

This is exactly when my little tool jumps in. With RegisterFont you can add a number of fonts to your font cache without using an elevated user account. The downside is that all the changes persist only ’till the next reboot; Windows will rebuild it’s cache and the changes will be lost.

Anyway, the archive contains a binary as well as the C# sourcecode to this small utility. Use it like that:

RegisterFont.exe add font1.ttf font2.ttf font3.ttf … font1000.ttf

Easy, huh? If you don’t want to add fonts but remove them, substitute the “add” parameter with “rem” and you’ll be set. I didn’t bother to link up to the MSDN entries explaining the API, this is just a quick and dirty tool I wrote because we were in need of a quick solution to a problem 🙂 .

Update 2010-08-27: dcpurton wrote a tool in C to accomplish the same goal but without the .net dependencies. Best of all: Sourcecode is also available 🙂 .

Mandatory profiles w/XP

Mandatory profiles are an ideal way of keeping a complete set of workstations in sync in regard of their visual appearance and settings.

One thing I was stuck at: Whenever I copied a profile and renamed the NTUSER.DAT to NTUSER.MAN the profile simply wouldn’t load the preferences from it, resulting in ugly window decorations, empty start menus etc. Why is that?

The reason lies in the permissions on HKCU. To circumvent this undesired effects you can use Computer -> Properties -> Advanced -> User Profiles -> Copy To… — and now comes the thing — before clicking OK also click the button on the bottom of the form to set permissions. I used DOMAIN\Everyone but as usual… results may vary.

This way it worked fine, though.
It’s a shame that this little click isn’t mentioned in 90% of the quick’n’dirty guides on the net, it really does make a difference.

My new favorite toy

…hardware-wise is probably the M-Audio KeyRig 49 MIDI Controller. What, you might ask, Tsukasa and music?

Yeah, that’s quite a shock. But I really enjoy venturing into new stuff and doing application development all the time is wearing me out a little. So I thought… what the hell, time for something totally new.

I guess I should read into stuff like what a melody is and how to work the keys on a keyboard effectively… at this point I’m barely able to play Meister Jakob — but a kickass Meister Jakob, I swear 😉 .

Of course I’m using the Keyrig from within FLStudio, thankfully the device comes with a USB port attached so I can easily plug it into my notebook and start hammering out terrible noises (I’m really good at that, too!).

So if you should ever be in need of a terrible annoyance to piss off your neighbours — just give me a shout 😉 .

Winforms in Mono

I hope I don’t have to emphatize how much of a Mono fanboy I am at this point 🙂 . Today I had one of these “Wow” moments Microsoft wanted me to give with Vista (they failed miserably, btw) when I did some poking at Winforms in Mono and were able to run my fairly sophisticated installation program example I wrote a while back unmodified on Linux (and it basically worked out of the box):

I was especially impressed by the fact that the program was aware the user level it was running in. I started it with sudo and got the result you can see above, program reports “elevated” status. Now this is very cool, more so because this was originally written for Windows Vista! One thing I’d love to implement, just for the sake of completing a nice installer demo, is awareness of what operating system the installer is being launched on/what features are available in the CLR it is running in. Also some smaller things like getting rid of improper path delimiters and casing where files should go depending on the system. Wycked.

Workaround for nVidia Linux driver TV-out scaling problem

If you’re using a GeForce 8×00 graphics card and the binary blob from nVidia you’ll may notice that the picture on your TV is slightly larger than the area the TV can display; a part of your desktop will be invisible.

That is pretty annoying, especially when watching movies with subtitles and half of the subtitle is unreadable just because of that.

Now, the following is a little something that works fine at least for Mplayer…

Mplayer provides the command line switches -screenh and -screenw which you can use to rescale the movie on the TV a little bit. For me, the following command line works out pretty fine:

mplayer -screenh 725 filename.mkv

Give it a try, play with the values and let’s hope nVidia will fix this nasty issue one day…

Adobe Air for Linux

A test version of Adobe’s Air for Linux is available for public consumption now. Tweet-r as well as the Pownce client work fine, there are some visual problems with alpha channels, though.

It is great to see that Adobe does release a Linux version, this should help adoption of this technology a bit. Even better, of course, would be a simultanous release on all platforms.

Fruitless?

Composing music can be a very fruitless and hard thing to do.

Especially so when all your music talent lies in being able to play the pianica a bit, but that’s about it then. Thankfully there are several programs out there that will cheerfully make up for one’s own misses and provide easy and intuitive tools.

In the past I’ve been using Myriad’s Melody Assistant. It’s a very capable program for writing and rendering music. You can import Midis, change their notation, the instruments and render your stuff out to an MP3 if you want to.

Recently I started tinkering with music creation again after a long recess, I’ve been using FLStudio and it’s absolutely great. It has all the features of Melody Assistant plus a some real stuff for quickly producing and editing songs. There’s a waveform editor that allows you to do slicing, looping and sampling from within the program, a bunch of drumkits, VSTi support and support for soundfonts. It’s a real treat to be able to do work so swiftly, especially when you’ve got a basic knowledge only. There are several versions of the program out there starting from about 50$ up to 300$. Still, that’s pretty cheap if you consider the costs of applications like Reason.

And things get better from here on: FLStudio works fine with Wine on Unix. It does have the expected amount of visual glitches and minimizing is a no-no but apart from that the application works flawlessly. That’s not only cool for FLStudio and Wine but also for Linux 🙂 .