How To: Fix the Shadow Warrior startup DBUS address error on Linux

I picked up the Humble Indie Bundle 14 the other day, which included Shadow Warrior – so I’m all keen to give it a shot on Linux, but when I launched it, I got this DBUS issue:

I’m running 64-bit Arch, and I noticed there was a lib folder – so I thought that would be a good place to start experimenting, and I was right! =D

To get Shadow Warrior to launch, you need to remove the libSDL2 and libOpenAL library (.so) files – but have your Linux distro’s versions installed. I did this by renaming the lib folder to old-lib, creating a new lib folder to take its place, and then trying to launch, getting an error, and copying a lib from the old-lib to the lib folder, which by the time the game would launch gives me:

I have libSDL2 and all lib32-sdl* packages installed, but I have only the native 64-bit version of OpenAL installed (which did not get copied into the remastered ‘lib’ folder) and not the lib32 variant – and yet the game launches and works! So give that a shot – works for me =D

Shadow Warrior - working!

How To: Fix X.org Black Screen with Nvidia drivers and Linux Kernel 3.10+

I’m running Arch Linux with a Nvidia graphics card, and after doing a system update back in March 2014 any kernel past 3.10.x would cause X / Xorg to fail to start; instead there’d be a black screen and the fans on the graphics card would spin up to full speed so my machine sounded like a hovercraft. I initially got around this by running the linux-lts (Long Term Support) kernel, until that too exhibited the exact same issue and I was forced to boot the system from USB, chroot into it and switch out the nvidia driver for nouveau (the open-open source, 2D accelerated nvidia driver).

However, as I happen to quite like accelerated 3D graphics and occasionally playing games, I’ve been digging around for a fix for this for ages – and it turns out that the fix (which is now added to the Arch Nvidia wiki page) is to add the following kernel parameter to your bootloader’s kernel line:

If you’re using GRUB, when menu shows up just move the selection to Arch or your Linux distro exhibiting the issue, then hit the e key to edit the line, and change the linux kernel loading line from, for example:

To include the rcutree kernel parameter, something like this:

At which point you can hit F10 (again, assuming you’re using GRUB) to boot using your newly added kernel parameters. Don’t worry if your kernel loading line identifies your partition by UUID value instead of plain ‘ol /dev/sdx – that’s fine and mine does too (I changed it to /dev/blah to make the line shorter) – just add the parameter and try your luck – hopefully your distro will now boot into X without issue, and you can stop swearing and cursing like a drunken sailor. Or perhaps that was just me.

Further reading about the issue on the nvidia development website: https://devtalk.nvidia.com/default/topic/567297/linux/linux-3-10-driver-crash/4/.

Cheers!

P.S. If you need to chroot into your Arch system to change the drivers also, then here’s a quick run-down of the process. Make a bootable USB from the Arch ISO (I could only get this to work by using the dd command from another Linux distro – Rufus and UNetBootin would make a USB I couldn’t boot from – google or search this site for “dd iso usb” for instructions), then, when you’ve booted into the live USB/CD-ROM or what-not, run the following commands (the “<---- optional" lines are optional, don't actually enter that into your files, obviously!):

With any luck you'll have now transitioned the drivers successfully and have a fully working system - fingers crossed, good luck!

Stray random quotes plugin refresh fix

Pre-Amble

Back in the day, I decided to use the stray random quotes plugin to place a random quote at the bottom of each page. It worked, and still does. Only, if you clicked on a quote it didn’t refresh – instead it said ‘Loading…’ and then placed an error in my web server log like this (not that it looked like you could even click on a quote anyway – the mouse cursor didn’t change to the ‘pointy-finger’):

I’ve known it didn’t work for ages, but not especially cared, and then this morning I’m putting off doing actual work, so I fixed it.

The Fix

The problem was that like many people, I’ve moved the file wp-config.php outside of the web-facing folder, so instead of living in /var/www/ it actually lives in /var/. Stray_random_quotes tells you that if you’ve moved your wp-config.php then you need to provide the modified path in stray_ajax.php itself, right near the top – so do so!

The first two lines of stray_ajax.php should now read:

That should do ‘er – now, stray_ajax.php should be able to call wp-config, which will allow it to call get_stray_quotes().

Further

When monkeying with wp-config, I saw that it was calling wp-settings, but the call was failing because they expect to be in the same folder, only as mentioned – wp-config.php is up a level from wp-settings.php (which holds no credentials), so, to fix this:

– Edit /var/wp-settings.php and right at the bottom, change the path to the wp-config.php file to be:

How To: Downgrade libcairo2 in Debian (and fix Evince)

Evince crashing with a libcairo segfault like this?

It’s a libcairo2 1.12.2-2 issue – which you can thankfully fix by downgrading libcairo2 to a 1.10.2 incarnation – here’s how…

Check package availability

First check you have an alternate version to downgrade to. To do this in Synaptic select the libcairo2 package then click on the Versions tab at the bottom, or you can do the same check via a swift apt-cache policy libcairo2 as shown below:

In this case the older (but functional) package 1.10-2-2ubuntu2 is available. Let’s assume there’s an older package you can use – if not, go get one from elsewhere.

Uninstall and force a different version

Uninstall libcairo2 using any manner you like – this will also force removal of things like Evince as dependencies, unless you see anything spectacular that you know you need just let it.

Then in Synaptic, search for libcairo2, select it (i.e. click on it), then from the Synaptic menu choose Package > Force Version and choose the older, working package, and install it.

Next, you’ll want to lock to that version so it doesn’t get upgraded (at least until there’s a newer working version), so again from the menu just select Package > Lock Version.

Reinstall libcairo-using things

Finally, reinstall what was ailing ya and everything should work fine. In my case at least, this means I can reinstall the Evince PDF viewer and it’ll now print to PDF without segfaulting – Huzzah! =D

I’ve no doubt you can do this entire process from the command line, but it’s easy and works through Synaptic so I’ll leave that as an exercise for the reader.

As an added bonus, if you’re experiencing slow display and/or corrupted text in Iceweasel or Chromium then the downgrade should fix that up too. You can read more about which here.