Google to disable site scraping feed service

For ages, I had been requesting a site monitoring feed for sites that don’t have an rss feed. It’s not so difficult, keep track of changes and post the diff in an RSS feed (kind of 😉 ). In the beginning of this year, google finally implemented that! I didn’t expect it.

Anyway, short joy: google has announced it will discontinue this service. 🙁

Here is a tip for people like me having hundreds of feed to find back those special feeds more easily: go to manage subscriptions and filter on “webfeed”. All those site scraping feeds start with “http://www.google.com/reader/public/atom/webfeed/”. Happy page2rss migration. 🙂

I <3 libpcap

A few years ago, I wrote a small app showing the open network connections (announcement following shortly). I never figured out how to measure transfer rates over the connections since the kernel does not seem to provide this info through the /proc filesystem (only some data queue length which is related to kernel mem usage).

Today we all know and love iftop, but where does it get that info? Simple: pcap! Out of curiosity, I checked out the libpcap docs to see how hard it would be to get started. Turned out to be pretty simple! There are a few excellent tutorials which get you started real fast. In about half an hour I made this very simple sniffer which accumulates the received bytes and packets per second and prints it out when the second changes. Each line contains the timestamp (sec), KB/s and number of packets received in that second. Here you can see me watching a youtube vid 🙂

Opening device eth0
ts = 1285276934, load = 0.7 KB/s (4)
ts = 1285276935, load = 0.3 KB/s (1)
ts = 1285276939, load = 0.9 KB/s (4)
ts = 1285276940, load = 14.4 KB/s (44)
ts = 1285276941, load = 294.9 KB/s (764)
ts = 1285276942, load = 608.9 KB/s (1505)
ts = 1285276943, load = 1164.4 KB/s (2882)
ts = 1285276944, load = 1242.6 KB/s (3064)
ts = 1285276945, load = 1166.6 KB/s (2880)
ts = 1285276946, load = 69.9 KB/s (179)
ts = 1285276947, load = 140.1 KB/s (363)
ts = 1285276948, load = 139.9 KB/s (361)
ts = 1285276949, load = 139.7 KB/s (358)
ts = 1285276950, load = 139.7 KB/s (358)
ts = 1285276951, load = 139.3 KB/s (358)
....

It is a good test to see if the calculated payload is correct. The initial burst of ~1.2MB/s confirms that. 🙂

Project announcement: Win7 RC auto reset alarm

Okay, this is becoming a bit outdated since windows 7 has been released for quite some time now, but you never know there are some other poor lads like me out there still using the RC. =)

Why I am using the RC is quite a story actually.. About a year ago, I bought this really beefy game rig. I tried some games using wine and although in general I managed to play them, I found it a bit silly that I wasn’t enjoying my new box for a 100% since there was always some direct3d feature not implemented yet or subpar framerate. So I decided I’d buy a game console software, aka Windows. But XP was almost EOL, Vista was a mess and Seven wasn’t released yet. So I figured I’d install the release candidate and see how it went from there.

All went well! And for the first time in many years, I even felt Microsoft was back on track. All my games ran very well. Until the day of doom, March 1st 2010. 🙂 On that day, Microsoft started to reboot all windows 7 rc’s every 2 hours. And by reboot, they don’t mean clean shutdown, they mean hard reset! Fair enough, it’s not like I paid for it.

Anyway, since I use Wintendo only for games, I realised it was actually a good thing that windows made me take a brake every few hours. It’s a good time to reassess the situation and maybe conclude to stop and do something else. 😉 No matter how I tried, I would always lose track of time and end up with game progress not being saved, steam stats not updated/lost, etc. So that’s where my little “windows 7 rc auto power off alarm” comes in. =)

This little utility will give an audible warning every minute when 1h45min have passed by. 10 mins later it will warn you with an additional sound, every 2 secs, that now the time really has come to finish your current mission/save your progress and do a proper shutdown. It is advisable to put this program in your startup folder so that it automatically starts when you log in, although it does not really matter when you start it as it initializes the timers using the boot time and not the time the program is started.

When the program is started, it sits in the system tray. Clicking on it will show you how much time is left. If you have a second monitor you can also use the pie chart countdown widget to have a visual indication on when to shutdown. Activate it by right-clicking on the systray icon and click “Show timer”. It shows green and should turn red when 0-hour is approaching. Click and drag it to move it around, scroll on it to scale.
Win7RCAutoShutdownAlarm desktop widget Win7RCAutoShutdownAlarm systray icon

Source is on gitorious, binaries can be download from qt-apps.org.

That’s it!

Configuring numlock indicator in KDE4

My brother has this really neat wireless keyboard with built-in trackball for his mediacenter. There is only one downside: it doesn’t have a numerical keypad and you never really know if the numlock is on or off. I think it is off at boot, but after turning it on and logging on, it is off again, unless you did a reboot.. or something like that.. Anyway, since it can be quite a challenge to enter passwords correctly, I started looking for a numlock plasmoidish solution.

First thing that turned up in the searches was the Keyboard Status applet. However, in the comments someone rightfully asks why it doesn’t use the keystate DataEngine. Great idea, because this is already packaged with vanilla kde. So I started searching for a general LED plasmoid which I could connect any datasource to using some mapping. No such luck. But then I wondered: why would someone write a plasma DataEngine and then not use it? 🙂 There must be some existing plasmoid! It turned out to be the Key State plasmoid which is currently hosted at gitorious.

Since it is a javascript plasmoid, you can install it as follows:

git clone git://gitorious.org/keystate/keystate.git
plasmapkg -i keystate

Done! It should now be in the list when adding plasmoids under the name “Key State”. You can configure a custom color for each special key. There are some advanced options as well which I didn’t try out. Here is what it looks like:

Key State plasmoid

A simple rectangle shows my numlock is active. I know, nothing fancy but it’s all we need and it does the job! Thank you Martin Blumenstingl. 🙂

Telemeter plasmoid update

This week I’ve been plasmafying my telemeter widget. I’m documenting the stuff I learn along the way in my personal page over at the kde community wiki.

Here’s a first screenshot of the plasmoid in action in its natural habitat:

Telemeter plasmoid

Notice the change in looks (ditched the qneedleindicator in favor of a native plasmoid widget Plasma::Meter). I’ll do a blog post later to detail the changes. It shows a fetch error as it accesses the webservice with invalid credentials.

Tip of the day: boot your computer using keyboard

About a year ago, I assembled a new main rig. I put (almost) all hard drives I had into it with the idea to make a “global backup”. This meant I had to leave my super-silencing case open until the backup was done. However, a year later, I’m still “in the process”. 😉

dsc01173.JPG

Since I also removed my front panel for some eSata modding, I have to turn my computer on using a pointy device aka “nail” (on the corner of the white table above). After doing that for a year, every day, knowing that my motherboard supports booting by key stroke, I decided to turn that feature on yesterday. Pressing spacebar boots my computer now. You should try it too, you’ll be surprised how much satisfaction it gives. 🙂

Project announcement: Telemeter widget / plasmoid

Lately I’ve been running low on my internet download/upload quota. Although my ISP (Telenet) trippled my quota, a combination of new suse release, new steam games and my isp failing to reset my quota (bug in upgrade process I guess), I managed to reach its limit inadvertently at 200 MB left. Since a) my ISP offers a webservice to access your usage data, b) I always wanted to write a useful plasmoid and c) wanted to try out soap services using Qt, I contemplated to write a quota monitor widget / plasmoid. This evening I gave it a shot.

After comparing available c++ toolkits for web services, I stuck to gSOAP rather than QtSoap as gSOAP seems the de facto standard when it comes to soap and cpp. gSOAP has some handy JAXB-ish utils to convert your wsdl into proxy classes. For a moment, I was afraid I would have to give up the nice and easy Qt network support (proxy, ssl,..) but it seems gSOAP has abundant support. All in all, in a few hours I had it up and running. Actually, I lost most of the time finding the relevant webservice url (you have to subscribe to a private wiki although eventually someone mailed it to me through a fairly private mailinglist I found on a user forum). In the meantime I found that putting a #define in my main is not the same as adding it as a compiler flag even when you rebuild everything. 😉 Adding a compiler flag the right way using qmake, goes like this:

QMAKE_CXXFLAGS += -DWITH_OPENSSL

When I finally could connect to the webservice, I received bogus data, all 0 usage! Only to find out that this was a problem with my account only. Btw, I good and cross platform tool to try out / debug webservices is SoapUI.

To keep it a little sexy, I threw in the QNeedleIndicator I recently stumbled upon on qt-apps.org and adapted it a bit to my needs and voila, we have an alpha:

Telemeter widget

It is not a plasmoid yet and credentials are hardcoded so it’s not useful to anybody but I couldn’t wait to blog. 😉 Note that in the screenshot I seem to have plenty of quota left. That’s only because it shows my parent’s account usage. 🙂

It is currently developed as a Qt app but I definitely plan on wrapping it in a plasmoid. Maybe I’ll keep the Qt app alive for some poor windows users. After I clean it up a bit I will post the code on gitorious.

Fullscreen games and Nvidia TwinView

Today, I decided to play a game on my suse box for the first time since I have my “new” game rig. I didn’t play any games under linux lately since Microsoft gave us a free windows 7 RC. 😉 I decided to play some Urban Terror but a few hurdles needed to be taken first.

First one: some time ago I managed to screw up my glx acceleration, yielding a “Unable to create SDL screen: Could not create GL context” error. So I installed the latest nvidia binary driver which detected the screw up and fixed it for me.

Second: I have 2 monitors connected: one CRT on the left and one LCD on the right. The LCD is the primary (which confuses some apps). Anyway, when starting an SDL game like Urt, it only sees one monitor (the “beauty” of nvidia twinview 😉 ) and projects its graphics somewhere half-way the primary screen with all the rest left black. I.e. unusable. As I understand it’s an Nvidia problem as they do not obey the rules of the game (meaning xrandr and consorts) for which they had their reasons too (at least back in the day).
Anyway, to solve it, let’s have a look at my original xorg config, or rather the relevant metamode line:

Option "metamodes" "CRT: 1280x1024_85 +0+0, DFP: 1680x1050_60 +1280+0"

We can see there is one mode defined with my crt on the right and my LCD on the right (+1280). The solution is to simply add a second mode in which we disable the CRT and to switch to that mode using the mode cycle shortcut ctrl+alt+”+” before starting a game. When you’re down switch back to your first mode.

Option "metamodes" "CRT: 1280x1024_85 +0+0, DFP: 1680x1050_60 +1280+0;NULL,DFP:1680x1050_60"

You can add as many modes as you want for your different gaming setups. 😉 It’s not ideal, but it does the trick and it even maintains my full desktop resolution (so apps don’t get confused or icons get misplaced) which you can access by “scrolling” on the side.

Third problem: no matter how I tweaked the framerate cap, vertical sync or other graphics settings, I didn’t achieve the smooth framerate I’m used to from Windows or previous linux installs. Somehow the framerate was really high but not entirely smooth. I tried playing online and had a horrible aim. If I didn’t know it ran flawlessly on my old suse box with ATI radeon 9800 pro, I would have stopped looking. Then I realised: let’s try disable desktop compositing. Problem solved! Smooth framerate, 0wnage ensued.

btw: nowadays, Urt’s master server is down. I created an autoexec.cfg in ~/.q3a/q3ut4/ with the line:

cl_master master.urbanterror.info

Last problem solved. 🙂