Archive for January, 2011

Ubuntu upgrade breaks LIRC

Saturday, January 8th, 2011

I recently upgraded my Ubuntu 10.04/XBMC based media center box (not a dist. upgrade, just a sudo apt-get upgrade).  After the update finished, I realised that the remote control (StreamZap) wasn’t working any more.

Quickly scanning the relevant files (i.e. /etc/lirc/* and /dev/lirc*) didn’t show up any obvious issues.

It turns out, all that is required is to run the following reconfiguration on lirc:

sudo dpkg-reconfigure lirc

Select your appropriate control and (if this doesn’t fix everything) then reboot and the remote should be working again.

UPDATE:

Unfortunately this seems not to be a permanent fix.  After rebooting, more often than not, the remote is not working again.  Performing the step above does seem to fix it for the current boot though.

A bit of further research found this post.  The post explains, that when the lirc_imon module is loaded (i.e visible when running an lsmod) the remote doesn’t work.  Performing the dpkg-reconfigure as stated above actually ends up removing the module lirc_imon – this is what actually fixes it.

So, to make the fix permant, you need to add lirc_imon to your modules blacklist.  The cleanest way to do this is to create another file called blacklist-lirc.conf in the /etc/modprobe.d/ directory with the following content:

blacklist lirc_imon

This will stop the module loading on boot, and your remote should remain working.

Install WordPress on Ubuntu/Debian (or where’s my WordPress install and why isn’t it working)

Wednesday, January 5th, 2011

I recently wanted to play with a local instance of WordPress (I am running Ubuntu 10.04 i386, but this should apply to all Debian based distros). I already had apache2, mysql and php up and running so decided to just try:

sudo apt-get install wordpress

WordPress installed and everything looked promising. But I could not find a URL that worked, or any configuration files in the /etc/apache2/conf.d directory (where most web applications usually put them).

It turns out there are a few more manual steps required. Hopefully this will be automated on later packages, but it doesn’t hurt to understand what’s going on under the hood sometimes. There are two main steps that need to be done:

Create apache configuration

Following the examples of other web applications, we can create a file in /etc/apache2/conf.d called wordpress.conf. This file should have the following (or similar) content:

Alias /blog /usr/share/wordpress
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
</Directory>

You can change /blog to whatever you want your WordPress install to be served under. As it is, you will find it at http://localhost/blog. Following this, restart apache to load the new configuration.

sudo /etc/init.d/apache2 restart

Run the mysql setup script

Next we need to run the setup-mysql script to create the right database users, tables etc. To do this, change directory to the /usr/share/doc/wordpress/examples folder where you will find the setup-mysql script. If you run:

sudo bash setup-mysql

you will get a simple explanation of how to use the script, as shown below:

setup-mysql [-n NAME] [-h | -d | -b] FQDN

Creates by default a WordPress mysql configuration depending on required fully
qualified domain name(FQDN).

Options:
-n name for the mysql user and database
-h help
-d destroy and purge
-b backup

Example: You want your blog to be served from http://blog.example.com
for user ‘wordpress’.

Then run:
sudo bash setup-mysql -n wordpress blog.example.com

Following this lead, you can just run:

sudo bash setup-mysql -n wordpress localhost

Assuming everything works without issues, navigate to http://localhost/blog and step through the 1 step process of the WordPress web based setup.

Connecting to MySQL database from OpenOffice.org Base

Sunday, January 2nd, 2011

Quick one here… if you want to connect to a MySQL database from OpenOffice.org Base, you need to install the openoffice.org-mysql-connector package:

sudo apt-get install openoffice.org-mysql-connector

After this is complete, make sure OpenOffice is completely restarted (i.e. not just the Base app, if you have a Writer window open, this needs to be closed too). Then just follow the prompts for connecting to an existing database (choose “MySQL” and “Connect directly” as you work through the wizard).