BenV's notes

Archive for 2010

Humble Bundle Part 2!

by on Dec.16, 2010, under Software

Obviously when something is really successfull there will be a second version of it.
Whether the motive is pure profit or for the greater good of $omething, I can only applaud it.
Especially when they promote DRM free games on linux. (and they provide the mac and win32 versions with it as well)
So The Humble Bundle is back with part 2!

This time the games offered are: Braid, Cortex Command, Machinarium, Osmos, Revenge of the Titans.
Just Machinarium alone is worth the money (if you like puzzle games and artsy graphics), and the others that I’ve played so far are good as well.
Some games are still being developed (Revenge of the Titans), but you’re eligible for future updates. (last time they even added the bundle to Steam after a while).

Like the previous Humble Bundle, YOU get to choose how much you want to pay them.
This obviously means that if you’re a windows user you pay less than when you’re a mac or linux user 😉
And then you get to decide how much of that money goes to charity (EFF / Child’s Play) and how much of it goes to the developers. (and how much the humble bundle guys get… for bandwidth etc I’m sure).

So go get it!. Even if you don’t care about the games, you can give some money to the EFF instead 🙂

Leave a Comment :, , , , more...

W3 Validator bookmarklet

by on Dec.14, 2010, under Software

After messing around with JQuery and friends for quite a while at work and sometimes even for hobby stuff more and more pages turn into the AJAX jungle.
Fine for the user, but there’s one little thing that always annoys me: it becomes very hard to make sure you’re still creating valid (x)html.
Especially when you start using dynamic tabs!

Opera has this nice feature that when you hit CTRL-ALT-SHIFT-u it will upload your current webpage to the W3 Validator. (w3, w3c… what’s up with that…). However, when AJAX molests the entire page (and I’m not talking about soccer fans ;))… or worse, the entire page is loaded through AJAX this method of validation falls flat on its face. Don’t ask me why opera is so stupid, but it will upload the original html, and not the AJAX molested version. An option would be nice there.

So today I was fed up with html errors and made myself a nice little bookmarklet to validate your page. With verbose output. And stuff.
This is the current version, it will probably get shorter / better soon.

(function(){var h=document;var b=h.doctype;var e="\n';var g=h.documentElement.outerHTML;var f="http://validator.w3.org/check";var i={prefill_doctype:"html401",prefill:0,doctype:"inline",group:0,ss:1,st:1,outline:1,verbose:1,fragment:e+g};var a=h.createElement("form");a.setAttribute("method","post");a.setAttribute("target","_blank");a.setAttribute("action",f);for(var j in i){var c=h.createElement("input");c.setAttribute("type","hidden");c.setAttribute("name",j);c.setAttribute("value",i[j]);a.appendChild(c)}if(navigator.appCodeName=="Mozilla"){h.body.appendChild(a)}a.submit()})();

Or right click here and select “Bookmark Link” to put it in a bookmark.
Or left click it if you want to find out how terribly wordpress fails at it 🙂

* Tested a bit on Opera 11, Firefox might also work.
* Note2: work in progress. Bookmarklet last updated at 14-12-2010.
* Known bugs: Opera seems to post some tags without the closing tags.

Leave a Comment :, , , more...

Splitting up a PDF file

by on Sep.30, 2010, under Boring

If you have colleagues like mine you’ll eventually find an email in your inbox that’s about 20MB because of some PDF file attached to it. Apparently it’s some manual of a device that we work on, but I only care about 5 pages out of the 400-ish pages in the pdf. (continue reading…)

Leave a Comment :, , , , more...

Monitoring your systems: Nagios and Check_MK

by on Sep.22, 2010, under Software

If you have one or more servers, you probably have a few things that you want to be up and running all the time. And when they aren’t working for some reason, you want to know about that as soon as possible and not 2 weeks later when you finally find out the hard way because your raid array has crashed completely.
Basically you want some kind of software that monitors the state of your services/servers. Well, most competent system administrators already have this up and running.
Nagios is capable of doing this. (continue reading…)

6 Comments :, , , , more...

KDM/KDE on Slackware64 13.1

by on Aug.29, 2010, under Software

Actually, it’s slackware64-current, but it’s pretty much the same for today’s issue.

Don’t ask me why, but for some reason my girlfriend wanted to start KDM/KDE.
(probably because enlightenment now completely abandoned their piece of garbage login manager ‘entranced’).
So she ran a ton of updates – “slackpkg update ; slackpkg upgrade-all” and rebooted.
KDM came up fine. Then she tried to login and was greeted by:

Cannot open ConsoleKit session: Unable to open session: Launch helper exited with unknown return code 127

After clicking this away KDE started to load but stopped shortly after that and KDM was greeting her again. (continue reading…)

Leave a Comment :, , , more...

Blast! It’s Boost! (Slackware64 and Deluge / libtorrent-rasterbar)

by on Aug.29, 2010, under Software

Obviously I didn’t mention this issue enough yet since google didn’t return my blog for this issue as well as I’d like.

Today’s task with a problem: upgrading to Deluge 1.3.0-rc2 from rc1. Just for reference, I ran into this problem before. Since we’re upgrading Deluge, I’m upgrading the torrent library first. The latest version seems to be libtorrent-rasterbar version 0.15.2.
The problem:

benv@machine:~/libtorrent-rasterbar-0.15.2$ ./configure --prefix=/usr # And some more options, but nothing with boost
# Some configure junk and then:

Checking for boost libraries:
checking for boostlib >= 1.36... yes
checking whether the Boost::System library is available... yes
configure: error: Boost.System library not found. Try using --with-boost-system=lib

… don’t you just hate it when your computer hints you to try something trivial? (continue reading…)

6 Comments :, , , , , more...

Opera + Squid -> slow?!

by on Jul.28, 2010, under Software

This tiny issue showed up a while ago, and I’m not quite sure when exactly it started. It sure was very annoying.

The problem:
Start opera, then load a ton of stuff at the same time. (your 25 tabs that have to be restored for instance). What happened was that after loading a few pages
partially, the rest would completely stall.

After some cursing I found out that it only happened when I used my squid proxy. (you know, to filter out ads because they slow the stuff down).
First I figured it must be squid. Then I realized that it would be weird, since nothing really changed. Maybe the blocklist? Nope, all looked fine.

Apparently Opera only uses a limited amount of connections to the proxy, so when a few of those requests are slow (you know, because google analytics takes 6 years to get through) the requests stack up and completely halt the process. Brilliant.

Finally I found the solution in some obscure configuration panel. Look for Enable HTTP 1.1 for proxy and make sure it’s enabled. Thanks for messing that up for me opera!
Oh well, now it’s fast again. phew.

1 Comment :, , more...

CMSMadeSimple

by on Jul.14, 2010, under Software

One of our customers has a website with some custom-made CMS made in php.
The customer asked us to fix some things, but since I hate touching pleuris-hoeren-product code, especially when the original coder is prutser and has never heard of templates (which is really weird, considering this is a CMS… maybe it’s just lazyness… then again, the echo "blabla\"escaping\"quotes\"is\"so\"much\"fun\n\n\n50 more lines here"; style really doesn’t show much intelligence…)

Anyway, I figured I might as well move the entire thing to an open CMS project that I’ve heard some good things about and already implements everything and more that the customer could ever want. That’s CmsMadeSimple.

Converting the old website to the new one was trivially easy. Copy/paste the stylesheet (first mistake), edit the basic template with a menu section, create the pages (copy/paste, copy/paste).
After fixing the html errors that were in the source the page looked like a pixel-perfect copy of the original.
Except for the places where the HTML errors were fixed that is. (the center class now actually worked for instance)

However, when adding the print links I ran into an interesting issue.
Adding print links is also a trivial thing, simply put {print} somewhere in the template, and possibly add some options to show an image instead of a text link etc.
However, the links were kinda broken, they gave empty pages. So I figured “duh, the print template still needs to be fixed”. However, as soon as I added the {content} tag to the template, I got a nice internal server error. WTF.

Checking the logs I could only find nice reports of this:

php-cgi[2530]: segfault at bf04b3f0 ip 08348d32 sp bf04b3f4 error 6 in php-cgi[8048000+6e9000]
php-cgi[2564]: segfault at bf639750 ip 08348d32 sp bf639754 error 6 in php-cgi[8048000+6e9000]
php-cgi[2804]: segfault at bf200230 ip 08348d32 sp bf200234 error 6 in php-cgi[8048000+6e9000]
php-cgi[2896]: segfault at bf00cbb0 ip 08348d32 sp bf00cbb4 error 6 in php-cgi[8048000+6e9000]

Well… .I expect nothing less from php. Pleuris-hoere-product. But how the heck… just because I added content to the print page? What’s so special about that?

After digging around (enabling logs etc) and enabling fopen for php (which I had disabled for security), I noticed this:

[Wed Jul 14 12:22:29 2010] [error] [client 123.611.204.37] PHP Warning: file_get_contents(http://some-site/oncmsmadesimple/) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required\r, referer: http://some-site/oncmsmadesimple/
[Wed Jul 14 12:22:29 2010] [error] [client 123.611.204.37] in /www/vhosts/some-site/cmsmadesimple/modules/Printing/Printing.module.php on line 96, referer: http://some-site/oncmsmadesimple/

AHA!. Apparently the printing module fetches the content (or at least, tries to) from the webserver, fails, and then segfaults php. Excellent code guys!
The reason for the failing is obvious from the logs here, I require authentication for the website since this is a test location that shouldn’t be public. Quick fix, allow the server to skip the login (vhost config):


AuthType Basic
AuthName "Testsite CmsMadeSimple"
AuthUserFile /lala/passwordfile
Require valid-user
Allow from 127.0.0.1
Allow from 192.168.1.1
Satisfy Any

Problem solved. (Hint Printing Module: render your own shit, don’t cheat with fopen/curl)

Oh yeah: CmsMadeSimple rocks for these simple websites where your customer wants to “change some texts and add a picture”. If they can handle word, you can make them handle this (but show them how!).
Give them permissions to add pages and nothing else, write a decent template for them, done.

Leave a Comment :, , , more...

Missing /dev/sd* in slackware 13

by on Jul.11, 2010, under Software

I’ve bashed my head into this problem at least three times now, so after finally running to google …. it made me search more than I liked.

The problem descriptions:
* Your system boots fine (maybe because it’s running on software raid), but your /dev/sd* files are gone.
* Your system doesn’t boot anymore, complaining about not finding your boot device when booting your custom kernel, but the stock kernel does work.
* Mounting partitions doesn’t work anymore, saying stuff like mount: special device /dev/sda does not exist

Reason:
* Your custom kernel has CONFIG_SYSFS_DEPRECATED enabled. To find out:

benv@uil$ zcat /proc/config.gz | grep CONFIG_SYSFS_DEPRECATED
CONFIG_SYSFS_DEPRECATED=y

Since udev version 151 (or something close to that) this will sparsely populate /dev. Yay.

If you don’t believe it, check out /usr/share/doc/udev-*/README:

- Udev will not work with the CONFIG_SYSFS_DEPRECATED* option.

Another problem solved.

Leave a Comment :, , more...

WordPress 3.0 update!

by on Jun.18, 2010, under Software

Since I was in another update mood I decided to take a quick look at my notes.
The admin page mentioned something about the new 3.0 version.
Obviously I immediately became very excited and ran to the bathroom.
After screaming for half an hour I made a backup of the wordpress dir and sql and wondered if the auto-upgrade button would work.
Always a surprise…. but it worked! It actually worked! (continue reading…)

Leave a Comment :, , , more...

Archives

  • 2016 (1)
  • 2015 (7)
  • 2014 (4)
  • 2013 (11)
  • 2012 (27)
  • 2011 (26)
  • 2010 (25)
  • 2009 (68)