Categories
Linux / Gentoo Linux

Getting Evolution to go native on KDE4

Right now I’m trying to get Evolution to work and fill the void that the removal of KitchenSync from KDE 4.2 has caused: the possibility to synchronize your phone, PDA, calendar, contacts and email using one central point.

Installing Evolution is only the start and please note that I am running Gentoo so if you are on another linux distributions things might turn out different.

We start with the basics: when you try to install synce and you have the ‘kde’ use flag – it will try to pull in ‘synce-kio-rapip-0.10-r1’ or similar. If you are truly running KDE 4 (and ditched KDE 3 and Qt3 – like me) the ebuild will fail because it needs KDE 3. There is a new package called ‘kde4-kio-rapip’ (currently at version 0.2) which should work for KDE 4. I decided I don’t want the deprecated KIO slaves and should I need direct access to my Windows Mobile 2003 PDA I will rather install the FUSE driver for it.

To make Evolution look like the KDE applications you need to get GTK2 to use the Qt4 engine – which will theme everything like the rest of KDE. There are 2 or 3 choices at the moment but ‘x11-themes/gtk-engines-qt‘ is currently your best bet (at version 1.1-r1 right now).

After installing it, open up System Settings -> Appearance -> GTK Styles and Fonts and select "Use my KDE style…" and "Use my KDE fonts…" and hit apply. Now log out and back in and Firefox, Thunderbird, Evolution and any other GTK program should look like KDE applications.

The next obstacle was the fact that Evolution is missing its icons despite that the theming of the interface itself is working. This is because the normal parts of the program interface are rendered by Qt4 but the icons are not a part of the standard Qt4 theme. To fix this we need to tell GTK which native theme it should use. Not to skin the program but to provide the icons.

Unfortunately I can not figure out what is going wrong as some icons are picked up and others are not while the console of Evolution stays quiet. Running the program itself from a console shows these messages:

Bonobo-WARNING **: Could not find GNOME pixmap file (null)

Because reinstalling seems to do nothing I might try to downgrade Evolution to see if that works…

Categories
General blog entries

Autoupdate for Joomla 1.5.x

One of the annoying things about Joomla sites it the fact you have to manually upload any update for the system. The result is painfully obvious: uncountable websites running unsafe installations because nobody feels the urge to upgrade (unless stuff goes wrong ofcourse).

It seems that Joomla 1.6 is getting auto-update support which means that updating a website is a mere press of a button. It looks like they wan’t to make it even fancies to allow plugins and components to check for updates to be sure that you are running the latest version of everything.

For those who can’t wait for fancy features like that by the end of 2009, you can get Advanced Tools for 1.5 now. This component has some cool tools but the real candy here is the Updater which auto-updates Joomla itself .

Note that you need to have write access to your entire Joomla site for this to work or you could use a small script to temporarily change ownership.

Categories
How-To's

Windows 2003 Server and 404 errors in reporting

I’ve ran a few times into a strange phenomenon when dealing with clean installed Windows 2003 SBS servers. In particular Windows 2003 SBS R2 with SP1 – but I’m sure other versions are affected as well.

The symptoms: A clean installation of the server refuses to show the Backup overview and Server Performance and Server Usage Reports. Instead you get a 404 error telling you the page can not be found. If you send reports by mail, those users will see the same thing.

When you navigate to http://localhost/Backup or http://localhost/Monitoring or http://localhost/Remote – all 3 sites give you a 404 error while for example http://localhost/ClientHelp and http://localhost/exchange work just fine.

Please note that if you can’t see these last 2 pages as well or you do not get error 404 but something else, you probably have a different problem.

The problem:
Windows SP1 and consecutive updates pull in updates for Microsoft ASP.NET and add ASP.NET 2.x to the server. The defaults then become to use ASP.NET 2.x instead of 1.1. The reporting modules do NOT work with ASP.NET 2.0 or higher.

Solution:
Open up server management, expand on the left pane the ‘Advanced’ section. Next, expand, ‘IIS’, ‘YourServerName’, ‘Websites’ and finally ‘DefaultWebsite’. Click on ‘DefaultWebsite’ and the right pane should show a listing of components in your default site.

In the right pane, do for each broken service (‘Backup’,’Remote’ and ‘Monitoring’) the following: right mouse click on the name and select ‘Properties’. In the popup select the tab called ‘ASP.NET’ and look for the selected ASP version. Most likeliy you will see something like ‘2.0.x.y’. Switch the version to ‘1.1.x.y’ and click ‘Apply’ and then ‘OK’. You now switched that folder to the correct version, now repeat for the other broken services.

Check if you can now open up the pages that previously gave you a 404 error – they should work. Note that displaying them can take a while because they have to parse the Windows event logs to show you the reports.

Categories
How-To's

HighPoint RocketRAID 1742 in CentOS 5.2

After having a bit of a fight with CentOS and its broken Realtek 8169 driver (called r8169 and which also claims Realtek 8168 devices but screw up when detecting the link status) I finally got to play with a RocketRAID 1742 controller from HighPoint. Where Promise dropped the ball with supporting hardware RAID on linux (basically you get 2 or 4 extra SATA ports but the RAID controller plays dead), HighPoint promised us true RAID under linux without any wonky software drivers.

Note that the RPM package for the DKMS rr174x driver is attached on the next page.

Categories
How-To's

Network login script for Windows XP Home

I just needed a script to log in on a Windows 2003 Server from Windows XP Home. Of course you can enter your password each time you need to access the shares – or you could just drop this little script in your Startup folder (call it ‘network_login.vbs’ for example).

network_login.vbs:

{codecitation class="brush:vb"}’ VBScript to map a network drive. And provide a message box
‘ Author Berend Dekens http://www.cyberwizzard.nl/
‘ Based on code from Guy Thomas http://computerperformance.co.uk/
‘ —————————————————————–

Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, bSaveMapping, strUserName, strPassword
strDriveLetter = "Z:"
strRemotePath = "\\192.168.100.1\sharename"
bSaveMapping = true
strUserName = "yourname"
strPassword = "mysecretpassword"
‘ Purpose of the script to create a network object. (objNetwork)
‘ Then to apply the MapNetworkDrive method. Result Z: drive
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, bSaveMapping, strUsername, strPassword
‘ Extra code just to add a message box
WScript.Echo "The networkdrive "& strDriveLetter & " is now available"
WScript.Quit
‘ End of MapNetworkDrive Example Logon Script. {/codecitation}

Categories
General blog entries

KBlogger moved to KDE 4.3

And yet another epic fail for KBlogger, the new blogging tool that was supposed to be in KDE 4.0. After KDE-PIM was not ready for the 4.0 launch, it was postponed to KDE 4.1 – understandable but as anyone running a blog and a PC using KDE4 knows, we don’t have any decent blogging tool on linux.

After an early alpha (which was a step in the right direction) is became very quiet around KBlogger. So when KDE 4.1 was released I was surprised to see the lack of info about the new blogging tool.

When I found KBlogger on the KDE 4.2 release schedule I sighed – another half year to wait on a decent replacement for Windows Live Writer (which is still – in my opinion – one of the best blogging tool out there, even when used in VirtualBox).

Now, at the dawn of 2009 and the coming of KDE 4.2 I found it weird that the beta of 4.2 lacked a preview of KBlogger.

I just found these mail conversations on the KDE mailing list pushing KBlogger to KDE 4.3…. which is supposed to come out end 2009. Once again a huge let down for the KDE fans.

Despite the statements that KDE 4 is feature complete it keeps lacking vital programs: KDE PIM has a screwed up Kitchsync support (which in itself is half broken if you ask me), power management just arrived in 4.2 (Powerdevil) and KBlogger is still not here (even though its core component KBlog – a WYSIWYG editor – is working pretty well for some time now). I am still using KDE 4.x but so far the thrill has become quiet the waiting game. Yay for open source I suppose…

Categories
General blog entries

Configuring custom remote buttons for XBMC

When you are the proud owner of a MCE remote, you are set for use with XBMC. However, if you are using a custom remote (like the one that came with my Thermaltake DH-101 MediaLab kit) – you might wonder how you are going to get all the buttons to work. Short answer: you won’t by using the Lircmap.xml file.

I configured my remote using Lircmap.xml like it stated on the site and it worked fine. I modified the bit in both Lircmap.xml and Keymap.xml until the point came where you want to add buttons that are not on the standard remote.

I figured, I could just add another button to the section of Keymap.xml – in my case XBMC.EjectTray() but although XBMC started fine, you wind up with this:

ERROR: Remote Translator: Can't find button eject

This is because XBMC uses a fixed map to determine which buttons are valid. Instead of simply adding buttons by name, they have identifiers for each button so adding your own buttons won’t work.

At this point, you have 2 options:

First, if you only have a few buttons you could recycle unused buttons. Open up http://xbmc.org/trac/browser/trunk/XBMC/xbmc/ButtonTranslator.cpp and look for the function called ‘CButtonTranslator::TranslateRemoteString(const char *szButton)’; ctrl+f it if you can’t find it, right now it is at line 777. See the lines following it? Those are the valid button names. For example: ‘if (strButton.Equals(“left”)) wButtonCode = XINPUT_IR_REMOTE_LEFT;’ – in this line the name ‘left’ is specified. Look for buttons you are not using and override their action in Keymap.xml.

The second option is a bit trickier. First, create ‘advancedsettings.xml’ in de userdata folder and put ‘true’ inside the file. Restart XBMC and start monitoring the XBMC log (by default under /var/tmp/xbmc-user.log’).

Start pressing all remote buttons and note which obc code they produce. Add all these codes to Keymap.xml under the tag – create it if you have to. A valid piece would look like:

[keymap]
[global]
[universalremote]
[obc30]XBMC.EjectTray()[/obc30]
[/universalremote]
...

Note that I replaced the tag start and endings with ‘[‘ and ‘]’ because my site seems to eat the correct ones.

Good luck taming XBMC and if you can’t figure out how to read the source file with the button names, you can look at this wiki article from the XBMC website. Note that it is usually out of date.

Update: the OBC codes only worked when I was using my universal remote with the XBox setting – unfortunately, this does not seem to work for specific remotes. Drat.

Categories
General blog entries

Download videos from Crunchyroll

With Dattebayo dropping Naruto Shippuden because CrunchyRoll will legaly release just hours after TV Tokyo airs, I decided it was time to write some magic to download the videos from Crunchroll. You see, I have a HTPC in my living room and I don’t really fancy watching Naruto in a browser when the time comes.

Disclaimer: this will NOT allow you to download paid shows without paying. Personal use only, don’t be an **** and distribute the video.

This will only work in FireFox – also, it will only work on the H264 videos. Put the following code in a file and install it into GreaseMonkey:

crunchroll_video_download.js

// ==UserScript== // @name           Provide download link on Crunchroll videos // @namespace      http://www.crunchyroll.com/ // @description    This script extracts the file name from the player code to allow the user to download it. // @include        http://www.crunchyroll.com/media-*/*.html?h264=1 // ==/UserScript== // Get the div holding the player object var div = document.getElementById('showmedia_left_col_new'); // Grab the script in that div which constructs the player var script = div.getElementsByTagName('script')[0]; // Extract the configuration array from the script content var config_str = /"config":"([^"]+)"/.exec(script.innerHTML); // Decode the URI encoding which is used on the config parameter, we now have some XML structure var html = decodeURI(config_str[1]); // Grab the file tag from the XML content var filename = unescape(/([^<]+)/.exec(html)[1]);  // Find the message box on this page var msgbox = document.getElementById('message_box'); // Remove the style which hides it msgbox.setAttribute('style',''); // Get all divs inside the message box var divs = msgbox.getElementsByTagName('div'); // Set this to the div which should hold the message var msgdiv = null; // Loop through all found children to find the right one, with a class name 'message-list' for(i = 0; i < divs.length; i++) { 	if(divs[i].className == 'message-list') { 		msgdiv = divs[i]; 		break; 	} }
Categories
How-To's

Compiling Courier 0.60.0 into RPMs for CentOS 5.2

In this article I will explain how to build RPM packages from the tar.gz packages on the Courier site in order to install Courier and/or its components using the RPM based installer in CentOS.

Server crashes always come when you least expect them. My trusty server just came down with a bad case of broken SATA controllers (don’t know how to cure that). Of course, the socket A cpu (Athlon 2600XP) motherboard is long out of fashion and so we wind up with the purchase of a new server (technically an HTPC but I’ll post something about that later on).

One of the key packages I use for years is Courier MTA. This software is supported fine by Gentoo but because the number of servers that I need to maintain is steadily growing, the drive for cutting edge kernels and software is fading as upgrading Gentoo systems can be a time consuming process.

So in the reinstall I decided to drop the mail, web and ftp services into a virtual CentOS machine so I could move the server to a different computer in case of the physical host failing.

The first thing that became obvious was the lack of Courier RPM’s out there, simply because the Courier package from the site can be converted into RPM’s with ease. If you are reading this then you probably have not compiled packages before and you need some help.

Disclaimer: I am using a setup which uses MySQL based authentication so I will remove the other database packages as soon as I am done – if you need those, be sure to omit those commands.

Start out by installing ‘rpmbuild’ as we will use it to build the packages:

yum install rpm-build

Next, get the latest source tarball from here.

As a normal user (running as root will give you an error so don’t bother) run the following:

rpmbuild –ta courier-0.60.0.tar.bz2

In my case I got this error telling me I don’t have enough permissions to write where the rpmbuild tool wants to put its files:

error: Failed to rename /usr/src/redhat/SPECS/rpm-spec.uykL0j to /usr/src/redhat/SPECS/rpm-spec.uykL0j: Permission denied: No such file or directory

This is a bother because Courier requires you to be non-root and rpmbuild requires you to be root. I solved this by temporarily changing the /usr/src/redhat owner to be me:

chown berend:users /usr/src/redhat –R

Running rpmbuild again now shows us a list of missing dependencies, in my case I had to install:

yum install expect libtool-ltdl-devel gdbm-devel pam-devel gnutls-devel mgetty-sendfax pcre-devel openssl-perl gamin-devel

One of the missing requirements is the ‘/usr/lib/ltdl.h’file – this is part of the libtool-ntdl-devel package. Another is ‘/usr/include/fam.h’ which is provided by gamin-devel.

The primary missing package however, is courier-authlib-devel. We can solve this by going back to the download page and downloading the courier-authlib tarball. After grabbing it, run rpmbuild on it:

rpmbuild –ta courier-authlib-0.61.1.tar.bz2

On my system the following was required to be able to build the RPM:

yum install libtool libtool-ltdl-devel openldap-devel mysql-devel zlib-devel postgresql-devel gcc-c++ redhat-rpm-config

Note that if you skipped installing the dependencies for courier itself, some of those packages are needed for courier-authlib as well.

After calling rpmbuild again on the courier-authlib tarball, the compiler should kick in and the build will complete on its own. After the build is complete, install courier-authlib-devel to be able to build Courier itself (you can later remove this if you don’t need it), you need to run this as root:

rpm –i /usr/src/redhat/RPMS/i386/courier-authlib-0.61.1-1.i386.rpm rpm –i /usr/src/redhat/RPMS/i386/courier-authlib-devel-0.61.1-1.i386.rpm

If did everything right, calling rpmbuild on the courier tarball will now fire up the compiler on courier itself, resulting in a neat pile of RPMs in ‘/usr/src/redhat/RPMS’ – most of which have self-explanatory names or are dependencies of each other.

Before installing Courier, lets clean up the mess we had to make to get here, run this as root again:

yum remove libtool libtool-ltdl-devel openldap-devel mysql-devel zlib-devel postgresql-devel gcc-c++ redhat-rpm-config gdbm-devel pam-devel gnutls-devel mgetty-sendfax pcre-devel openssl-perl gamin-devel courier-authlib-devel  chown root:root /usr/src/redhat –R

Note that we omit ‘expect’ from the remove command as it is needed by courier and its packages.

And there you have it, a complete guide to building your own Courier RPM packages on CentOS 5.2. All that is left is to actually install the RPM’s and set up Courier but that is beyond this little howto.

Categories
General blog entries

Restoring Windows 2003 SBS R2 Exchange

Windows 2003 SBS was always a bit weird for me. I’ve been playing with computers all my life and I know Windows Vista and earlier versions like the back of my hand but when it comes to server software on Windows I always have this unnerving feeling.

You should know that most of the time my presence is required when a server is almost dead or acting strangely so my experience shows that an unstable Windows server is usually ‘fixed’ by a complete reinstall – something I have never had to do to my linux servers.

Right now I am installing Windows 2003 SBS R2 for somebody I know. Their previous administrator never felt the need for finishing the setup or actually buying the license so when I came in, all I could do was reinstall the whole system.

I created a backup using NTbackup from the Exchange Store (which was half disabled on their server) and now I am trying to restore it. Guess what: it won’t.

I hate Microsoft for its poor practices and this is one of them: supplying backup tools that work within a very very confined space. In this case a fresh install will kill the option of restoring it without extensive Google-ing.

To be exact: I unmounted the Mailbox Store, marked it for restoration in the properties and fired up NTbackup to restore the backup. After setting a temp path (C:\temp) I hit restore and immediately see the whole thing fail. Of course NTbackup can’t tell me jack so I need to dig in the Application Log and I find this:

Event Type:  Error Event Source:  MSExchangeIS Event Category:  Exchange Backup Restore Event ID:  9635 User:  N/A Computer:  WIN2003 Description:  Failed to find a database to restore to from the Microsoft Active Directory.  Storage Group specified on the backup media is 581cb7ee-5fec-4d93-8f71-dcfe55a73319.  Database specified on backup media is Mailbox Store (SERVER1), error is 0xc7fe1f42. 

After searching high and low I finally get a blog post from someone who solved this. The error is in fact so simple, they should execute the team that thought that this was a funny way to describe it.

The names don’t match. Seriously.

In the Server Console –> Advanced –> Exchange –> Servers –> Win2003 –> First Storage Group you will find a store called ‘Mailbox Store (WIN2003)’ – assuming your server is called win2003 – whereas the backup has a store called ‘Mailbox Store (SERVER1)’. NTbackup can’t fathom the possibility that we actually want to restore to a store on this server without the exact name match so it fails.

Solve this by right-clicking on the store, renaming it to the old name and restarting the restore. It will run now.

On a side note – this was not the end for me. I got event id 1088 after I managed to restore it: Distinguished Name is not the same for the Store and the server. I can’t grasp why them Redmond idiots haven’t made it possible to simply rename the DN of the store to make it work in case of a migration like now.

I tried renaming the legacy DN using the ADSI editor and the LegacyDN tool from the site. I couldn’t get it to work after trying 50 guides so finally I tried to uninstall the server software. This failed (of course) and left me with a system in which I couldn’t resume the setup. So after a new installation and 2 hours of waiting/babysitting I am back where I started, ready to restore my Exchange backup…