SEO-friendly titles in WordPress with Atahualpa theme and Headspace plugin

The Atahualpa theme for WordPress is a really powerful theme with lots of settings. But it doesn’t give you full control over the titles of posts and pages the way the Headspace plugin does.
How the titles of your blog posts look like is important for search engine optimization. If you want your post to be higher ranked in the search result (and who doesn’t?) the title is one of the most important factors to consider.
The Atahualpa theme and the Headspace plugin doesn’t work together without a minor modification to one of the helper php-files in Atahualpa. Look in the functions directory of the theme for the file called bfa_meta_tags.php. Open it in an editor and look for the line that says:

<title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>

Change it to:

<title><?php wp_title(''); ?></title>

Now you can enable the Headspace plugin and go to Settings -> Headspace and define exactly how your titles should be generated.

Standard

Building a working web service in 24 hours – straight


Happy business campers!

It’s the middle of the night and I’m in a big hallroom full of people all of them hacking on their computers.

The event is called 24 hours Business Camp and the goal is to bring 90 entrepreneurial people together and have them build a service in 24 hours.

There are 52 teams (although it’s not a contest, there’s no winner) and the ideas are ranging from tampon subscriptions to Youtube wrappers.

Building a service in such an extremely short timespan has been (is, there’s still 9 hours left!) a learning experience, primarly about the importance of focusing on what’s really important.

A little too tired to write anything more right now but let’s just say that without my framework of choice, JBoss Seam, I wouldn’t have been as productive as I have been. A couple of hours have been lost doing stuff like configuring Apache proxies on my server or fixing Hibernate errors. Still, it’s really amazing how much you can do with all the frameworks and open APIs out there. Everything is in turbo speed compared to a couple of years ago.

But now I should get some sleep.

Standard

Copying a VirtualBox VDI file running Ubuntu Server and getting Drupal running

Sigh. Things are never as easy as you want them to be. 🙂

I have two computers on my desk. My MacBook and my Asus EEE B202 running Windows XP. I wanted a development environment for Drupal (a php content management framework), so I tried running PHP on my MacBook.

It worked fine, but the first problem appeared when I tried to run Drupal. The PHP GD library was missing (used by Drupal for graphics). This is a known problem and requires a recompilation of PHP. The problem is, the Apache web server installed on the MacBook is used by OS X and may change in future updates to the OS by Apple. It also seemed a bit cumbersome to get it all to work as it should. So, I figured, why not in stead run a virtual machine with a developer setup in linux and get a clean separation between my day to day OS (OS X) and my developer server.

I decided to use VirtualBox, a free software provided by Sun, and run it on my XP machine (the B202). I installed Ubuntu Server 8.10 on the virtual machine.

If you haven’t used a software like VirtualBox or VMWare before, I can only say that it’s much easier than it sounds like. If you can install an operating system you can use VirtualBox. It’s a very slick and easy to use program.

But, there are of course a few problems.

The first problem was that Ubuntu Server was also missing PHP GD (not because of VirtualBox of course, but still). This time I only needed to do a:

apt-get install php5-gd

and voila, Drupal was running.

Now everything should have been fine and dandy if it hadn’t been for the bluescreens that suddenly started to occur on my EEE-box. After running VirtualBox and Ubuntu Server for a couple of minutes, maybe half an hour, XP decides to just crash. This happened over and over again.

Finding the cause of a bluescreen is never fun but it was clearly due to the VirtualBox setup.

But, hey, I’m in the virtual world here. So, I simply copied the .vdi-file (the file that VirtualBox uses to store the operating system on – it’s like a virtual hard drive) to my MacBook and set up a virtual machine with the vdi-file.

Everything worked as it should, except networking (I’m using hosted networking, making the virutal machine appear just like a third computer on my network – very neat, when it works).

The problem is that, although the environments are similar, the virtual network adapter gets a new MAC address. So, the Ubuntu OS gets confused and can’t find the network adapter. This is easily fixed by simply deleting an autogenerated file:

rm /etc/udev/rules.d/70-persistent-net.rules

and rebooting.

Now I have Ubuntu Server 8.10 running on my MacBook. I don’t have any desktop environment set up, making it rather slim (I use 384MB RAM and the full OS only takes about 1,5GB hard drive space). You probably want something like Webmin to make configuration a bit simpler. Here are instructions for setting it up.

Now, let’s just hope my MacBook doesn’t bluescreen.

Standard

Setting up PHP and web server on OS X 10.5 (Leopard)

Your shiny Mac comes preinstalled with a web server and php but you need to set it up to get going. Starting the web server is as easy as enabling “Web Sharing” under networks settings. I did this but the server did not respond at http://localhost. So, what was wrong?

Well, I recently upgraded my hard drive to a 500GB version and I used Time Machine to restore my operating system. The problem is that this is not a clone of my previous setup but a copy and it leaves out certain files that Time Machine ignores to save space. One of those folders is the apache web server log folder which is required by apache at startup. Unfortunately OS X doesn’t tell you anything about this error when you enable Web Sharing, it just doesn’t work.

Anyhow, simply create the folder:

sudo mkdir /private/var/log/apache2

and you’re good to go. You might have to disable and enable Web Sharing again to restart the process.

So, now the web server is running. What about php? Edit the apache config file located at /etc/apache2/httpd.conf and remove the ‘#’ (comment) from the line that says:

LoadModule php5_module

Now you can test that it works by adding a file called helloworld.php to the folder /Library/WebServer/Documents. Add the following code snippet to the file:


< ?php echo 'Hello World!'; ?>

And point a browser to http://localhost/helloworld.php. Now three things can happen. 1) no response. Did you restart the server? 2) The exact content of the file is shown in the browser. This means the PHP module is not loaded. Make sure the httpd.conf file has the comment character removed as described above and then restart the web server by disabling and then enabling web sharing again. 3) Hello World! (and nothing else) is printed in the browser. Success!

The next step is probably to set up MySQL. Here are some resources for doing that. Good luck and happy PHP hacking.

Standard

Upgrading RAM memory on Asus EEE B202, Eee Box

A short video I made showing how to replace a memory chip on the Asus EEE B202 desktop computer:

Read this post for further details on how to perform the surgery. Removing the side cover was the most tricky part but putting it back together was done in a snap:

The B202 supports 2 GB RAM and has two sockets. I only use one socket with a 2048MB DDR2 PC2-5300 667MHz memory module.

The B202 is a nice little machine. Cheap, virtually silent and with low power consumption but still fast enough to use as a developer machine.

Standard

Running JBoss 4.2.3 on OSX

A simple gotcha, but anyway… If you get an exception like:

java.lang.NoClassDefFoundError: javax/ejb/Stateless
at org.jboss.ejb3.EJB3Util.isStateless(EJB3Util.java:42)

When trying to run jboss 4.2.3 on OSX, it’s because you’re using java 1.5 in stead of 1.6. Follow the instructions here to change.

Updated:…and then of course Eclipse stops working. Here’s how to update.

Standard

Share keyboard and mouse between OS X and XP


(It’s more fun when you’re two. Photo by me.)

While I love my Macbook there are still a few programs I need Windows XP to run, especially when you’re doing MIDP development as I happen to be doing at the moment.

So, I had to dust of my old PC and put it beneath my rather small desk. The problem then is that I don’t have room for two keyboards. What to do?

Synergy to the rescue!

Synergy is a program that lets you share mouse and keyboard between two computers using the network. It works really nice, even with simple copy-paste between the OSs.

The installation is not quite as straight forward as one might like so here’s a video showing how to set it up.

Standard

Learning a new language


(Photo by me).

I just started reading a book about Cocoa Programming for OS X. (This one). Cocoa uses Objective C, which is somewhat different from C, C++ or Java that I’m more familiar with.

Learning a new programming language is really like entering a new world. You are naked. You don’t know how to solve even the most basic task. It’s a bit scary but also refreshing. You’re being forced to think out of your ordinary little box.

I should do this more often.

Standard

Legal email characters regexp

I use GMail for most of my mail. They have a cool feature with which you can add a string to your username part of the email address by ading a +-sign, like this: myusername+astring@gmail.com. Email sent to this address will go to myusername@gmail.com.

This is perfect when you register your email at many sites since you can sort the incoming mail based on the email address given.

The problem is, many email forms have validators that don’t allow +-signs in the email address. I just tried registering at developer.sonyericsson.com but they wouldn’t accept my email.

There’s really no reason for this. There are regular expressions available that do a correct validation. Here’s one example.

Standard