Archive for the ‘GNU/Linux’ Category

Blogging for LGP

Friday, February 13th, 2009

I’ve just written my first blog post for Linux Game Publishing on the new LGP blog.

The post is about the LGP community. You can head over to the LGP blog to read it.

Simply checking my web

Monday, February 2nd, 2009

I’ve been doing some web development lately, and the old question of testing has of course come up (and some might say, of course I had to roll my own solution).

I wanted a simple way to sanity check a site, to ensure that my article changes didn’t suddenly break comments on images (lagacy apps are strange beasts). So I ended up writing SWEC, the simple web error checker. It’s a basic app that goes through all links in a site (or “webapp”) as long as those are present in the HTML (ie. it doesn’t run any JS, so its use in JS/AJAX/AJAJ-heavy webapps can be somewhat limited). It parses all pages it downloads, looking for known errors and then reports those. For instance, if you run it on a site based on Catalyst (perl) and catalyst crashes with its standard backtrace, SWEC will return which page it happened on, which page referenced it and a quick line about what happened. Ie. if it’s an exception it’ll say “Exception in Catalyst controller”.

It uses a very simple file format for writing tests (which is well documented in SWEC’s manpage). It has several different types of tests, but the most common one looks something like this:
[SWEC_CATALYST_CONTROLLER_EXCEPTION]
type = regexs
check = Caught exception in.*Controller.*Request.*Catalyst
error = Exception in Catalyst controller
sortindex = 11

What’s between the brackets [ ] is the name of the test. All tests that are shiped with SWEC are prefixed with SWEC_.
The type defines which “type” of test it is. This one is “regexs” which is a ’smart’ regex, a standard perl regex that swec modifies during runtime to easier match HTML. The check is in this case a normal perl regex that is applied to the entire html document. As the type is regexs, swec will modify the regex to this during runtime: Caught(\\s+|&nbsp;|<[^>]+>)+exception(\\s+|&nbsp;|<[^>]+>)+in.*Request.*Catalyst

The error is the string that will be returned, and the sortindex is used for prioritizing tests, the lower the better (bundled tests will always be positive, so one only needs to give tests a negative index to ensure they will be run before bundled ones).

By default the bundled tests (default.sdf) and the user-specific rc file ~/.swecrc will be loaded. The user-specific one can disable bundled ones easily, and you can disable them on the command line on an individual basis.

SWEC supports sessions, where SWEC remembers previously checked URLs, and previous errors and can then either check pages that used to have errors before the others, or only report ‘new’ errors that did not exist before. This will also remember all settings that you set so you don’t have to type it every time (although it’ll allow you to do that as well). It has cookie support so it will run just fine as a logged-in user, though you probably don’t want to run it on a live database, but rather a test one, as it’ll click on any link it sees (with a few exceptions, it tries to avoid ‘logout’ and ‘delete’ links, additions to the exceptions list is welcome).

It’s GPLv3, so feel free to hack your own things into it. I’ll accept patches for the app itself, as well as new tests to be bundled. As long as they are either specific to a language, web server or framework, I’ll happily add more bundled checks (or fixes to existing ones), however I will try to avoid app-specific checks as that might just get a bit too much.

Happy hacking

New Linux Game

Saturday, May 3rd, 2008

Linux Game Publishing has announced a competition where one can win the first copy of their new unnannounced game for Linux.

The winner will be the first person to guess which game it is, based upon the slowly revealing image on http://competition.linuxgamepublishing.com/.

The chance to know what new game is coming out for Linux and the chance to win the first copy of it produced. Yay :).

If you want Linux games already released, head to TuxGames. (Yes that’s my referral link ;)

Day Planner 0.9, and looking forward

Saturday, May 3rd, 2008

Day Planner 0.9 has been released. It is available for download as a Mandriva RPM, Ubuntu deb, Debian deb, generic installer and source tarball.

The release focused primarily on fixes and cleanups. A bunch of minor bugs were fixed, and I rewrote most of the iCalendar back-end. It should be faster now and preserves files better than it used to.

This release includes a dummy maemo interface. It can currently fully display a Day Planner calendar, and has a UI quite similar to the desktop edition. However, it can not edit or add any events, and is as such not as useful as it might have been. The plan is for the maemo port to be ready for 0.11.

0.10 will (among other things) feature a new HTML exporting module (which has been in the works for quite a while), a cleaner, object-oriented version of the add/edit event windows (to simplify their use and maintainance. The current code that handles it is a bit ugly).

The major user-facing change will be the addition of a GUI for calendar subscriptions. 0.9 includes support for them (though it isn’t really announced because the feature isn’t ready), but one has to manually edit the config file.

Microdia (0c45:624f) webcam on Linux

Sunday, April 27th, 2008

(Re: Proprietary Webcam driver wonders).

I recently discovered a free driver for my GF’s builtin Microdia webcam. It works very nicely (better than the crappy proprietary one did when I tested the “trial”). So if you’ve got a Microdia webcam, at least the 0c45:624f one, now you can have it working properly, with good quality without paying a load of money for a one-time one-kernel one-arch license for a proprietary one.

git clone http://repo.or.cz/r/microdia.git
cd microdia
make
sudo insmod ./microdia.ko

Then just launch Cheese or your favourite webcam program and off you go.

Thanks a lot to those that took the time to develop a proper driver. If you’ve got a paypal account, I’ll donate some money for your hard work.

Update: the module is now named sn9c20x.ko, so the last line becomes sudo insmod ./sn9c20x.ko

Update 2: According to brandon in the comments, the kernel module is in the upstream kernel as of 2.6.31.6

Automated Day Planner development snapshots

Friday, April 25th, 2008

I’ve added automatic development snapshots of Day Planner to the Day Planner homepage. There are currently three different branches (trunk, next stable, current stable) being built, in two flavours (tarball and installer). The snapshots are updated twice each day and are available at http://www.day-planner.org/index.php/download/snapshot. Feel free to take them for a spin.

Day Planner’s second anniversary (and a development snapshot)

Saturday, April 19th, 2008

Today is the second anniversary of the Day Planner project. So hurray for Day Planner, and here’s to all the great releases to come.

In other related news, I’ve just released a development snapshot of Day Planner 0.9.
It is available at http://www.day-planner.org/index.php/download/devsnapshot. It contains all of the developed features for 0.9 (including the unfinished maemo port), but is not yet stable enough to be labelled stable, so If you’ve got time and feel like it, give it a spin and report any bugs you find. The whole iCalendar back-end has been almost completely re-written for this version, which is why I want some additional testing before I release a stable version.

Please do not package this release or submit it to news sites, it’s just a svn snapshot.

History meme

Tuesday, April 15th, 2008

Everyone else is doing it!

[0 zerodogg@firefly ~]$ history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
279 cd
185 vim
117 ssh
75 screen
74 svn
66 wget
64 ls
60 perldoc
59 rm
58 cget

Best gift certificates ever

Sunday, April 6th, 2008

Today (6th of April) is my birthday, and my GF, being rather artistic, decided to go a different route when it came to the gift certificates she gave me.

This one is for TuxGames (well, this was /really/ from the cat (Junior) and the hamster (Tuxine)):
TuxGames gift certificate

This one was for Aetolian credits (Aetolia being a MUD):
Aetolia gift certificate

And the final one was for Wii points in the wii shop channel:
lhs_wiipoints.png

Got plenty of great presents (not going to list them all here, just wanted to note the cool gift certificates), its been a good day.

A bunch of new stuff

Wednesday, March 19th, 2008

I’ve finally taken the time to prepare a website for all the various programs and scripts I’ve got in use here that the world might also find some use for. The address, right now, is http://random.zerodogg.org, though once I find some more imaginative name I’ll probably move it, but for now it’s random.
Everything mentioned is either GPLv3 (most of it) or GPLv2 (some of it).

I’ll write a quick word on the various new projects, and note those that I have moved from older websites to random.

New stuff:

Audio Utils
This is just a collection of scripts I’ve had in use (and had uploaded for the world to download previoulsy, but never together nor on a proper website) that assists in various audio-related tasks. These are:
aac2ogg – a quick and dirty aac to ogg converter, using mplayer, faad and oggenc
wma2ogg – the same for wma, using mplayer and oggenc
reencode – a quick and dirty bash script that lets you re-encode an mp3 file to another bitrate. Useful for clearing up space on “mp3 players”, especially if you’re into audio-books, which can often have their bitrates drastically reduced and still be in a fairly decent quality.

GRandomWallpaper
This is a wallpaper randomizer for GNOME/Nautilus. It takes a list of wallpapers (a directory) and selects a random one. This can be done on a timer, or just once. It keeps a hitlist for how many times a wallpaper has been shown, and is more likely to pick those that have not been shown as often. It also lets you ban wallpapers, which will cause it to always ignore the wallpaper in question.

LatexB
This is a quick script that assists in building LaTeX files. It can call latex or pdflatex, automatically spawn xdvi(k) or evince after building, and detect bibtex. It’s merely a utility script so that I can do “latexb file.tex” to build the LaTeX file properly in one go (it calls latex multiple times to ensure that everything is referenced properly).

MonitorGrowth
This is a simple perl program that lets you monitor how fast a file is growing, displays information similar to that of download utilities like wget.

mussort
This program sorts your music collection. It puts them into nice directories (artist/album) and renames the files, so that everything is consistent. It can also let you delete dupes. It works on MP3, and OGG Vorbis-files.

SPGal
This is my first python project. It builds a static XHTML-gallery from a set of images. It can work as a drop-in replacement of iGal and jGal.

Old stuff, new website:

MagicPO
This is a program that helps you translate PO-files from one similar language to another. Right now it can do automatic translation of for instance Norwegian Bokmål to Norwegian Nynorsk (you only have to read through them afterwards).

PDFtoPNG
This is a quick program that lets you convert PDFs into a set of PNG files. It can also build HTML-files to go with the PNGs, for easy reading in a browser.

SLX-Dict
This is a simple command-line program that lets you look up words in the Norwegian computer translation dictionary. It’s useful if you don’t want to open firefox and search for words there all the time.

SSHMan
SSHMan is a simple ssh agent helper, along the lines of keychain. It does persistant management of ssh agents, will only ever prompt you for adding keys to the agent once, does not slow down logging into X and does not start when you’re logging in via ssh.

Day Planner maemo port under way

Thursday, February 14th, 2008

Okay, I gave up on the point of getting the perl bindings for gtk2 going.
It was just too much work, and would not only require getting the gtk2 bindings going, but also writing bindings for hildon, the maemo-specific stuff.

So I went to plan B, which was to reimplement a maemo-specific GUI in python that just talks to a perl back-end which takes care of all of the actual data processing. This is now well under way. A working prototype of the GUI in python is now in SVN, it can read and display calendar data, but has no edit capabilities yet. The back-end portion is just about finished, it is a mixture of code from the dayplanner perl client and the dayplanner-daemon, what’s missing there is more configuration file handling (which can’t be done yet, because I’m not quite sure what config options the maemo UI actually needs) and synchronization code.

This has helped make Day Planner even more modular. I split out some code that is useful elsewhere into a DP::CoreModules module. That module now has code that for instance handles the configuration files, parses date strings, creates config dirs, runtime module loading, summary string wrappers and localtime() wrappers. All code that can be shared (and doesn’t merit having their own module) will be put there.

I expect the maemo port to have initial editing capabilities within 1-2 weeks, depending on my workload.

N810!

Tuesday, February 5th, 2008

It’s finally here, and I’m loving it so far :).
Tried some basic stuff, installed ssh+scp and tried ScummVM on it. All running nicely.
Now I’m about to move to the hard part, getting Day Planner actually ported to the thing.

The gtk2 perl bindings still don’t have a maemo port. I’m going to have a go at those first to see if I can get them running half-decently without too much work, if not I’ll have to look at other more dirty hacks. Though if I can get the bindings themselves running that would be much better and would make the port a lot easier to maintain. Here’s hoping!

Proprietary webcam driver wonders

Monday, December 10th, 2007

My girlfriend has a builtin webcam on her new x86_64 laptop.
The webcam has no free drivers, but there is a proprietary one available on linux-projects.org.

Pay 10EUR and you get the driver. Okay, doesn’t sound /so/ bad. But the driver is only available for x86 ubuntu gutsy, no other arch, no other distro, no other kernel. If you want it for /your/ kernel you have to pay 100EUR. Wonderful. There’s no way I’m paying 100EUR for a proprietary webcam driver. Buying a new, working, webcam would even be cheaper! She runs x86_64 so there’s no way to get that driver working there, without paying that 100EUR. The camera is Bus 005 Device 002: ID 0c45:624f Microdia.

If someone does decide to write a free GPLd driver for it, I’ll donate some money to that person (I don’t have 100EUR to give away, but I can do at least 30-50EUR).

This again goes to show the pain of proprietary drivers. I don’t mind *paying* for drivers, but when the drivers cost more than the device did, and a device working equally well would be cheaper than buying the drivers it has gone too far. I would have easily donated money if the page said “here’s the driver, it’s GPL so do what you want, but please donate 10EUR if you can” (and I have donated to FOSS projects before).

Update, see: http://blog.zerodogg.org/2008/04/27/microdia-0c45624f-webcam-on-linux/

Maemo (Nokia N810) device program application accepted

Saturday, November 10th, 2007

Yay!

I’ve been picked as one of the lucky 500 that will recieve a Nokia N810 at a heavily discounted price.

My initial plans will be to investigate ways of porting Day Planner to maemo. Because there are no Gtk2 perl bindings for Maemo at the moment, as far as I know. I’m going to have a look at how hard it would be to port the current Gtk2 perl bindings to Maemo, and if it’s rather simple I’ll just bundle them along with Day Planner., or create a package for them. They might even run with little effort, who knows (heres hoping). Even if they don’t work 100%, as long as the methods DP uses work adequately I will be able to use them. If not, well, then I’ll have to look at other options, which include writing a dumb UI in python that talks to a perl-backend.

In any case I will need to figure out how to best integrate the daemon+notifier functionality. The platform probably needs its own notifier, if it is to have such a thing at all, though I’m hoping the daemon can work without major changes.

And now I just need to wait for it to be released so I can get it.

Day Planner packages available for Debian and Ubuntu

Saturday, November 10th, 2007

Day Planner debs are now available on http://www.day-planner.org/. Both for Debian and Ubuntu (in addition to the already available Mandriva RPM and generic installer).

Creating a deb was interesting, as I had never done that before – used to rpm packaging, though I got a lot of help by Morten Werner Olsen.

The packaging also uncovered quite a few limitations in both the default tarball and the Makefile, which should not only make the deb possible, but also improve the RPM.

I’m hoping to get Day Planner into Debian too, but I’ll have to write a proper deb for Date::HolidayParser first. Debian, like Mandriva, wants to have modules available as seperate packages, and as Date::HolidayParser isn’t *really* Day Planner-specific it makes sense distributing it seperately. The current debs has it bundled, and I might be inclined to continue to have the ones on the website bundle the module (the RPMs on the website does this, even though the package in Mandriva does not), so that there is only one package to install to get Day Planner installed.

In other (somewhat) related news, I’ve changed the URL structure on the Day Planner website. It previously used ugly looking index.php?page=foo&type=bar URLs. It now uses clean index.php/foo/bar URLs, which incidentally was rather simple to implement once I found which variables to parse and PHP functions to do it with.

Ubuntu/Mandriva comparison

Tuesday, October 30th, 2007

I know you’re probably sick and tired of these comparisions. If so, don’t continue to read, and definetely don’t troll in the comments :).

I had so many various problems with 2008.0 that I felt it might be prudent to try some alternatives (I’ve upgraded to 2008.0 on 4 boxes so far, with not a single one going smoothly without issues). My choice fell on Ubuntu. Was considering to try out Debian too, but I know Debian is good – but not quite end-user desktop-friendly.

I live on the commandline. So just about all I do is identical on all distros since I just carry my configs with me. However I still see hw-detection and general usability and integration. So, I’m going to just start with a little comparison, and we’ll see where we go from here. The comparison is seperated into positive (+) and negative (-) comments.

This is all my personal opinions.

Ubuntu (7.10):
+ Live installer works very well. Especially nice that it removes unneeded locales and downloads missing ones during installation.
+ GNOME default desktop
+ sudo-only actually works quite well
+ Very well integrated into GNOME (ie. 3d-effects can be set up in the appearance applet in GNOME)
+ Clean, empty GNOME desktop by default
+ apt-get is great and shows how much it needs to download
+ aptitude looks good
+ integrated distribution-upgrade system
+ detected all the HW and worked nicely
+ Quite polished
+ Appears quite stable
+ gnome-app-install is pretty
+ Firefox patched to use native package manager to find plugins
+ Totem automatically finds missing plugins
+ More progress shared with other distros (ie. networkManager)
+ Progressbars when installing software (always in the GUI)
+ Ability to see verbose installation messages in the GUI
- Missing some translations
- Some of the translations isn’t of the best quality
- Synaptic is very ugly
- For some reason when I removed evolution, the menu item didn’t get removed (not even when using apt-get purge)
- Uses a white mouse pointer by default (I don’t like it, but luckily that can be easily changed)
- No profile.d
- Told me it needed to reboot after installing the nvidia driver

Mandriva (2008.0):
+ urpmi is also good
+ Well translated
+ Good hw detection
+ Has a tool for /everything/
+ PLF
+ RPMDrake is good (better than synaptic, not close to gnome-app-install)
+ Great perl module packaging
+ MP3 playback by default
- GNOME Live CD not published along with the rest of the distro
- GNOME Live CD not advertised for new users, they only get the option of KDE
- No beta of the GNOME Live CD
- Not as well integrated into the DE
- The tools aren’t as “polished”. Ie. when a drak* tool needs to install something it pops ups 3-4 small windows informing about what it’s doing – none of them has a progressbar, and sometimes they say the same. Also the windows aren’t refreshed as often, but block and become unresponsive.
- Although urpmi got improved it still doesn’t say how much it needs to download. Something other distros have had for ages, and that I opened a wishlist bug for in 2005
- I haven’t installed one 2008.0 machine without various issues (sound stopping to work, performance bad, sound not working properly, X driver not set up properly)
- Live CD set up autologin by default without asking about it
- No Mandriva Flash GNOME (except GUADEC edition)

Trolls and flames in the comments will be deleted.

Update:
Note that I made no conclusion on which distro was better. I’m simply attempting to write a simple and incomplete comparison. The comparison is also mostly based upon first impressions, and should be treated as such.

I’m also not saying I’m switching camps for those wondering ;).

Concerning GNOME Flash. Well, maybe that isn’t really fair. Flash is good, and GUADEC flash is good. However I did get annoyed that only a KDE was made available.
Also, no, the point isn’t /really/ that Mandriva prefers KDE for LiveCDs – it so happens I prefer GNOME and thus see GNOME as a plus.

When I talk about “better” integration, what I mean is basically that Ubuntu is more centered around the desktop environment than Mandriva is (which can be good and bad I guess).
In Mandriva to configure stuff you would use drakconf, in Ubuntu most is in the GNOME System menu. Granted, some stuff from Mandriva is available there too, but Ubuntu has everything.
However, Mandriva has, like stated, tools for just about everything. Ubuntu does not. They’re quite differently structured. The Ubuntu tools look like they are /made/ for GNOME and part of GNOME (which I guess they are). The Mandriva tools look like a seperate app, which they are, and is probably also good considering the wealth of tools available. It just feels a bit easier to just System -> Administration and select whatever you want to do there. Don’t get me wrong, Mandrivas GNOME is good. Kudos goes to Mandriva for giving a GNOME LiveCD, I’d just like to see it better marketed (not like on mandriva.com right now where you only get the option of KDE. KDE is good but imho you should be able to chose, as Mandriva One now appears to be the preferred version to download).

Concerning autologin, if I recall correctly, the previous versions of Mandriva One did not activate autologin by default, which is why I reacted negatively to that this time.

Update 2:
Yes, urpmi displays how much it needs to /install/. But it doesn’t (and can’t, since the information isn’t available in the current hdlist formats) display how much it needs to download. Which is often a good deal less than what it will take when installed.

drakSimpleConf

Saturday, September 16th, 2006

I’ve been thinking of a method of creating simple configuration UIs.

Take the following config file:
RunMode = Inetd
AuthMode = Closed
Restricted = true

To create a simple configuration GUI for this I would write something like this:
filename is /etc/example.conf
setting RUNMODE can be (Inetd, Daemon)
setting AUTHMODE can be (Closed, Open)
option RunMode is RUNMODE with name "Run mode" and tooltip "Which mode to run in"
option AuthMode is AUTHMODE with name "Authentication mode" and tooltip "Which mode to use for authentication"
option Restricted is BOOLEAN with name "Enable restriction" and tooltip "Enable this if you want to enable restriction of user rights"

The initial filename option selects which file the config file is.
The first “setting” defines a type of entry in the config file that can be either of the value “Inetd” or “Daemon”. This would create a drop-down widget where you can select “Inetd” and “Daemon”.
The second setting defines the same for “Closed” and “Open”.
The first “option” defines that the option in the config file “RunMode” is of the type “RUNMODE” and the name of the option that is displayed in the GUI is “Run mode” and it has a tooltip saying “Which mode to run in”
The second is the same.
The third one defines that the option “Restricted” is of the predefined type “BOOLEAN” (which is predefined to be true/false, this creates a checkbox instead of a drop-down box).

Now begin your slaughtering. This is still just an idea. There is no code yet. What do you think of the concept of creating a whole configuration GUI for an app using a single file like this? I’m thinking it would be okay for daemons and such.
What do you think of the syntax? I just grabbed it out of my head today and thought it might work. I want the syntax to be simple and human-readable. The point is that you should be able to hack together a GUI for any program with a simple configuration file in a few minutes.

Flame me.

Italian ssh tips translation

Wednesday, January 18th, 2006

Now this is quite cool, Davide Duina (I think I spelled it right! :) of http://mandrakeitalia.org/ has posted an Italian translation of my SSH tips and tricks.

Original at: http://zerodogg.iamaturtle.org/index.php?type=docs&page=sshtips
Italian at: http://www.mandrakeitalia.org/modules/wfsection/article.php?articleid=151

Where is the madness police?!

Friday, December 16th, 2005

Okay, I was just made aware of the Brazillian Mandriva store by Claudio. The DARNED THING USES ASP! AFAIK it isn’t Mandriva that runs it (duh), but STILL!
For a little more clarification:

[0 zerodogg@drizzt html]$ HEAD mandrivastore.com.br
...junk...
Server: Microsoft-IIS/6.0
...junk...
X-Powered-By: ASP.NET

Someone tell me I’m dreaming! *cries*

*yawn*

Friday, October 14th, 2005

Sooo, plane leaves in ~2 hours and I’ve had, let me see, 0 hours, 0 minutes and 0 seconds of sleep this night. Mmm…