Categories
Programming

Adding Gravatar to Joomla!

After stumbling upon Gravatar, a site serving your avatar globally, I looked for an easy way to add this functionality to Joomla!. After ditching Gravatar/Avatar for needing some other plugin to work in the first place, I installed gAvatar.

This plugin worked without dependencies and gAvatar is dead simple to set up. Just enable the plugin, change the rendering mode and you are done.

The only thing that can go wrong (and did for me) was the fact that you can choose for a floating avatar (which ended up floating in the text), a table avatar (using the default Joomla header style – which this site doesn’t use) or advanced templating.

That last option seemed like a good solution except that nowhere was described what it did or how it worked. A quick dive in the source showed me everything I needed to know: gAvatar adds a ‘avatar’ parameter to the article object. To use it, find the classes generating the article layouts and modify those.

To find those class files, I used the following in the template folder:

fgrep "article->text" * -R

And add the following (for example) to insert the avatar:

<?php if (isset($this->article->avatar)) : ?>     <div style="float: right"><?php echo $this->article->avatar; ?></div> <?php endif; ?>
Categories
How-To's

Debugging upload problems on JoomGallery

After installing JoomGallery and writing a migration script to migrate from Menalto Gallery2 (G2) , I finally got to uploading photos. But for some mysterious reason, every attempt to upload images would fail.

The manual upload did not work (blank page), the FTP upload did not work (blank page), the batch upload did not work (blank page or session timeout sending me back to the login) and the Java upload did not work either: 

wjhk.jupload2.exception.JUploadExceptionUploadFailed: wjhk.jupload2.policies.PictureUploadPolicy.checkUploadSuccess(): The string "JOOMGALLERYUPLOADSUCCESS" was not found in the response body

Categories
Linux / Gentoo Linux

Fixing XML-RPC’s in KDE4

After posting that Bilbo worked out of the box, I was bound to run into a world of trouble – and so I did

You see, when I was trying out KBlogger, I ran into the “Invalid request payload xmlrpc element STRING cannot be child of DATA” error you find in some KBlogger related posts. After playing around a little I realised that the error prevented me from posting anything and I ditched KBlogger as being buggy as hell (which it actually still is).

But when I installed Bilbo, I ran into the same problem! Only this time I knew that it should work as I posted before using Bilbo. After investigating a bit I found the culprit: KBlog. This backend library handles the communication with the server over the XML-RPC protocol. The error is produced on the server side and to be exact it is PHP XML-RPC that generates the error.

Because the XML-RPC library on the server is very strict (and probably error free), I turned to see what Bilbo actually sent to the server. The problem appears to be in the category structure that is generated. In my first posting, I did not select a category to post to. But when you select one or more categories, a QStringList object is populated with the category names. This is converted into XML somewhere in KDE (I haven’t figured out where yet).

After talking to the Bilbo devs for a bit they pointed me to the WordPress API in KBlog. For some reason, that one generates a string holding the XML for the server. And in that class, the metaWeblog.newPost function is called using a properly constructed category array.

Alas, switching to the WordPress API did not help: “STRUCT cannot be child of PARAM” and whether I used categories or not, the error remained. A quick inspection showed where that error comes from: the ‘struct’ element should not be directly put inside a ‘param’ element. The XML-RPC specifications state that the ‘struct’ should be placed in a ‘value’ element first. After fixing this and recompiling Bilbo, everything is working now!

Well, not everything as the metaWeblog API is still broken. I have filed a bug report with KDE upstream so they can add my fixes to the WordPress API and hopefully someone with more KDE programming experience can fix the metaWeblog API. Or rather, fix the conversion from a QStringList to proper XML-RPC compatible XML.

On a side note: while debugging the XML-RPC protocol I discovered that the Joomler XML-RPC plugin for Joomla! did not apply the categories that are sent along. I’ve modified my (already heavely patched) version of Joomler and once I’ve tested it a bit more, I’ll send the patches to the Joomler devs. Hooray for open source I guess ^^.

Categories
General blog entries

Bilbo, the new blogging program for KDE4

The experimental ebuild for Gentoo worked like a charm: I am typing this on Bilbo. The editor seems to Just Work ™, the previews are functioning (both rich text and the website preview) and the account creation worked out of the box.

The only thing that took some time to figure out is the fact that the auto-config option did not configure my site. In fact it started looking for a xmlrpc.php file to talk to, which results in a 404 as Joomla! does not have a file but rather a folder with that name. So after setting it to the correct location and switching to the metaWeblog API in the Advanced settings I hit ‘Fetch blog ID’ and voila, we are up and running.

Well, kind of: the plugin I use to provide the blog API on the site is incomplete. I have been tweaking it for months now, adding missing functions as I went. So when I wanted to select a category, I got an error stating that the XMLRPC function was not found.

After enabling the debug info on my server, I saw that Bilbo tried to access metaWeblog.getCategories – which is unimplemented in the original version of the plugin. So after adding the missing function, everything came to live and here we are…

Now if you excuse me, I have a virtual machine to dispose of as I can retire Windows Live Writer now ^^

Categories
Linux / Gentoo Linux

Bilbo: Finally a decent blogging program for KDE?

Bilbo interface While the development on KBlogger has somewhat picked up and some features have been pushed back to allow for a semi-working release, I just found a little gem hidden on the big wide web.

In a mailing list post on the development on KDE, someone is suggesting to take a look at Bilbo instead of KBlogger for the ‘extra-gear’ package. Of course, I was expecting a simple blog editor similar to all the other projects out there that never quite made it. Boy, was I in for a surprise!

Bilbo has the features I need in a blogging program (similar to the Windows Live Writer interface) and even better, it should be in working order!

I will report back once I get it to install on KDE 4.3 using Gentoo.

Categories
How-To's

SATA Hard disc showing up as a Removable Drive

After spending the better part of a day trying to reinstall my neighbors computer using his old Windows XP Home disc (no service packs installed) and burning 4 slip-streamed discs – in an attempt to get the pesky nForce4 controller on the ECS motherboard to play nice – I finally got the system up and running again. Mind you, not using the custom Windows XP CD’s. No, for some reason after the slip-stream, the CD key is no longer accepted (thanks Microsoft for that one).

No, the reinstallation involved the slow and painful upgrade of Windows XP from the vanilla version to SP3 with every upgrade known to man. Of course this process failed once when I tried installing every driver and tool during eachothers installation (and probably during the service pack upgrade) so I wound up with a system which threw a BSOD on each boot and forced me to start all over again. *grmbl*

Now, after everything is up and running again, the only problem that remained was the fact that the SATA hard drive is showing up as a Removable disc. This is probably because the initial installation was using a legacy IDE emulation interface on the nForce4 controller. But as soon as I installed the SATA driver, the full 250GB became available (it showed up as a 128GB disc during the text mode setup) and Windows switched to the faster SATA interface.

My guess is that Windows for some reason now detects the SATA drive as a new drive and assumes for some reason that it is hot-swappable (it should be in theory but still should not show up as such). To fix this, you need to tell the nVidia drivers to stop marking SATA drives as removable. As such, the trick described below might not work if you do not have a nForce SATA controller.

WARNING: Messing with the registry can destroy your Windows installation. If you know what you are doing you should be fine, if not, please stop now.

  • Go to ‘Start’
  • ‘Run’
  • Type ‘regedit’ and hit enter
  • Find the following folder ‘HKEY_LOCAL_MACHINE\CurrentControlSet\Services\nvata’
  • Some people might have a 64-bit installation, they should have a ‘nvata64’ folder instead
  • On another computer of mine, the folder was called ‘nvatabus’ instead of ‘nvata’
  • Create a new DWORD value in this folder (by right clicking and selecting ‘New DWORD value’)
  • Name the new value ‘DisableRemovable’ and set the value to 1 (decimal or hex doesn’t matter)
  • Close RegEdit and reboot your computer

If everything worked out, you should no longer see the hard disc showing up as a removable device. Don’t forget to reboot to make the changes active!

Categories
Linux / Gentoo Linux

Kblogger coming to KDE 4.3

In a previous article I wrote about KBlogger and its nomination for a vapor-ware award. Most of the commits up until then seemed like KDE global search and replace changes, rather than actual work on the KBlogger application itself.

On the Kblogger page on kde-apps, an anouncement was made that the 3rd alpha was released in Febuari 2009. After installing and playing around for a bit, it felt more like a working blogging tool than it did before.

The downside was the numerous features which didn’t work:

  • Settings autodetection leaves you hanging and makes setting up a blog account more of a guess than anything else
  • If kwallet is not installed or activated (the service needs to run), kblogger crashes
  • If you try to read the category list on a Moveable Type API site, you get a ‘Method not supported’ error
  • Reading previously posted articles works (sort of) unless you have media attached in which case it crashes

The biggest problem is not the continuous crashing of the application but rather that I haven’t been able to post one article on any of my sites using Kblogger – it truely is an alpha quality application, if that.

It seems like the development is still going, even if the kde-apps page and homepage seem to be dead. Hopefully, they will work out the crashes and get it going in some form before KDE 4.3 ships out in June 2009.

Because of the current state this seems doubtful but according to the plans, it is still a part of KDE 4.3 PIM-libs – although it was on the schedule for 4.0, 4.1 and 4.2 as well.

In a desperate attempt to make the KDE 4.3 deadline, the current Kblogger feature plan seems to have dropped support for media management. This means that a lot of the current issues become a problem for later on and the core of the program (the blogging engine) is the only thing that needs to be fixed.

Lets hope this June we get a pleasant surprise but I am currently putting my money on KDE 4.4 or even KDE 4.5 as a release platform. On the bright side, perhaps the SVN versions become stable enough to use in the mean time.

On a side note, I am still looking for a blogging program for KDE 🙂

 

 

Categories
Gentoo Linux

QuickCam Communicate STX on Linux

Looking for instructions to get your latest Logitech webcam to work on linux? Your in the right place! Need a replacement for gspcav1 or spca5xx? Have no clue what I just said but you need a new webcam driver? Please, read on…

Categories
How-To's

Antec Fusion with SoundGraph VFD under Ubuntu

After deciding to upgrade my Ubuntu Intrepid to Jaunty a million things broke – most of which were flimsy solutions at best – making me spend hours to figure out how to fix them.

One of those little gems is the LCD on my Antec Fusion case, or rather it is not an LCD but a VFD. Even better, SoundGraph is the original producer of these gems but seems to think that the entire IT industry is only using Windows as they don’t support linux. At all. Nice.

Of course, most of these devices work alike so if you figure out the guts of one you pretty much have the recipe for all of them. I had installed my HTPC over 6 months ago and after trying a million patches I finally ended up with a Lirc 0.8.3 installation with a patched lirc_imon driver which managed to drive the display as well as work with all the buttons, knobs and the remote.

Sure, I had to tweak the patch a little to get the right payload and replace semaphores with errrr…. something else, but who can complain when it finally works?

So after finding all the previously ‘helpful’ sites again, and people sending each other around in loops for instructions, I figured out what to do. Ignore all the guides out there. There you have it.

So, the instructions? Easy, LIRC 0.8.5 will have native support for the iMon devices and it already works better than any patch out there. Go to the LIRC website and follow the instructions to compile LIRC from CVS. As a hint, if you are running Ubuntu: as soon as you pulled in the CVS tree, run ‘./autogen.sh’ followed by ‘./configure –prefix=/usr –with-driver=imon’ and finally ‘make’ followed by ‘make install’.

Thats all there is to it, now load the lirc_imon driver and to test, configure LCDd to connect to ‘/dev/lcd0’ and behold, your GraphMon VFD works! Lets hope the fine folks at LIRC decide to push the next release out the door soon so everyone can just get the vanilla package from their distribution vendor.

Categories
Programming

Release of new utility: Bacula Reports 0.9

I write a lot of code, most of it unsuitable for release to the public but this little gem is worth a public release.

After using Bacula to backup all my servers (both Windows and Linux) for some time, the large number of mailings you get when using it on a small server park drove me insane. Even when using filters to sort out new mail, it is hard to see if everything is going as it should be.

Enter Bacula Reports: a mail aggregator for Bacula 2.x and 3.x.

Bacula Reports consists of a faux mail command (which does not send out reports by mail but rather analyses and stores them) and a report generator which aggregates all the stored reports into one mailing with an overview and some HTML styling to make it more readable (if you don’t want HTML, modify the template to generate plain text).

By integrating the scripts into the Bacula configuration at 2 points (a mail command used for sending out reports and a job to send out the combined report), the storm of daily mails changes into one neat report at the end of the backup cycle.

Normal error messages and operator messages are unaffected and will be delivered as they used to be, only the backup reports per job are redirected to Bacula Reports.

Requirements:

  • A linux server (32 or 64 bit, tested on CentOS 5.2 and Gentoo 2008)
  • A working Bacula 2.x or 3.x installation
  • PHP as a command line interpreter (run ‘php –v’ to see if you have it)
  • 10 minutes of your time to set everything up

The cool thing of the scripts is that they require only 2 small changes in the director configuration to reroute the status mailings and if you don’t like it or run into trouble, reverting is normally a matter of simply commenting out the modified lines and restoring the old ones.

One drawback for some people: it requires PHP on the command line (as stated before). The reason for this is very simple: I want to use the same code in the future for a web GUI and my unix-scripting skills are virtually non-existing compared to PHP or Java.

Even though its PHP, the scripts have a small footprint and run very fast – they should be easy to add to any existing Bacula environment.

{jd_file file==5} {jd_file file==6}