Apache and PHP on Snow Leopard
Wednesday, December 29th, 2010 | Author:

Yes, I have a new Mac. There may be fewer Ubuntu posts for a while.

To get Apache and PHP going for the first time, the following files need changing:

  • /etc/hosts
  • /etc/apache2/httpd.conf
  • /etc/apache2/extra/httpd-vhosts.conf
  • /etc/apache2/users/<username>

To create a new virtual host, the following files need changing:

  • /etc/hosts
  • /etc/apache2/extra/httpd-vhosts.conf
  • /etc/apache2/users/<username>

There are more details here:

I just know I’ll forget about that last file if I don’t record it here.

Category: Web Development  | Tags: , , , ,  | Leave a Comment

I discovered that any directory I created on a vfat file system in Linux whose name consisted solely of uppercase letters, and was 8 characters or less in length, was being converted to a lowercase name.
This was causing problems of J2EE war files being created containing both directories “WEB-INF” and “web-inf”.

The fix was to add the shortname=winnt option to the file system mapping in /etc/fstab, and then reboot.

So the line in /etc/fstab would be, for example:

UUID=483E-D7D6 /data vfat shortname=winnt,utf8,umask=000,gid=100,uid=1000 0 1



After turning my application running under SpringSource Tool Suite into a web app, then trying to run pre-existing junit tests, I started getting the error:

Plug-in org.maven.ide.eclipse.jdt was unable to load class org.maven.ide.eclipse.jdt.internal.launch.MavenRuntimeClasspathProvider.

An error occurred while automatically activating bundle org.maven.ide.eclipse.jdt (810).

The fix was to delete all the existing Run configurations (Run As / Run Configurations… / select m2 custom Run Configurations and delete them).
Restart STS (may not be necessary), and it now works!

Tips for Successful Corporate Blogging
Sunday, March 21st, 2010 | Author:

A recent boagworld podcast contained a segment on “Why corporate blogs fail”.  I’m going to summarise the content here, but the podcast itself contains loads of useful extra information and asides if you want more detail.  Most of it applies to any blog, not just organisational ones, and there’s a lot here I can learn from.

What Paul (Boag) said was that the most common reason for corporate blogs to fail was very simple: people stop blogging.  They stop blogging partly because it takes time to build a following and people give up too soon, and they also stop because blogging is hard.  It takes time to blog and it takes time to think of ideas.

But why blog in the first place?  Here are some reasons:

  • It improves your search engine visibility.
  • It attracts users to your site.
  • It results in increased links to your site.
Some principles to bear in mind when blogging:
  • Not all posts need to be long posts.
  • Keep a list of blog ideas wherever you are, rather than sitting at a computer hoping for inspiration to strike.
  • Vary the type of blog post (see below).
  • A post doesn’t have to be perfectly written.
  • Don’t assume that if you know something, everyone else does too.
Some possible types of blog post:
  • Ask a question
  • Cover an event, with a preview or review
  • A commentary (i.e. a response to someone else’s blog or article)
  • News in your sector, not just in your own organisation
  • An interview, possibly posting it in video or audio form
  • A case study, focussing on how a problem was solved, rather than self-congratulation
  • A review of a book, a service, or anything else
  • Hints and tips
  • A tutorial, include video, imagery, etc. if possible
  • Lists, e.g. a “top ten” list – easy to digest and popular
  • Resources, i.e. links to interesting articles
  • Predictions, can make you look like a visionary!
  • Debates, i.e. put forward someone else’s point of view, even if (or especially if) you don’t agree with it.
Yes, all useful stuff, and a reminder to me to do more than just hints and tips!
Category: Marketing  | Tags: , ,  | Leave a Comment
SpringSource Tool Suite Buttons
Tuesday, February 23rd, 2010 | Author:

After installing SpringSource Tool Suite 2.3.0 on Ubuntu 9.10, various IDE buttons were not working. The fix is to set the right value for GDK_NATIVE_WINDOWS before running it, e.g. have a file in /usr/bin that looks something like:

#!/bin/sh
export GDK_NATIVE_WINDOWS=1
/usr/lib/springsource/sts-2.3.0.RELEASE/STS

That’s it for now.

Upgrade Rails Database in Production Environment
Tuesday, February 16th, 2010 | Author:

To upgrade a database which is not in the development environment, use the RAILS_ENV parameter to rake db:migrate.

For example:
$ rake db:migrate RAILS_ENV="production" VERSION=9

Ubuntu wifi cannot obtain ip address
Sunday, November 22nd, 2009 | Author:

After I upgraded to Ubuntu 9.04 I could no longer connect to secured wifi networks.
6 months later, I have found a fix! Here’s how I did it…

Open wicd, then
Preferences / Advanced Settings
Change WPA Supplicant Driver from ndiswrapper to wext.

I had to click on “Connect” to the wifi network 3 times before it connected – the first 2 times it connected then immediately disconnected.

Maybe the WPA Supplicant Driver was wrongly set because the upgrade to 9.04 replaced ndiswrapper with a better driver, but didn’t update this setting, but that’s pure speculation. Anyway, it now works!

Category: Ubuntu  | Leave a Comment
Ubuntu 9.10 Firefox 3.5 fonts
Wednesday, November 18th, 2009 | Author:

After upgrading to 9.10, the fonts in Firefox were too big and blurry. I fixed it as follows:

cd /etc/fonts/conf.d
sudo mv 10-hinting-slight.conf 10-hinting-slight.conf.original
sudo ln -s /etc/fonts/conf.available/10-hinting-medium.conf /etc/fonts/conf.d/.
sudo ln -s /etc/fonts/conf.available/10-sub-pixel-rgb.conf /etc/fonts/conf.d/.
sudo dpkg-reconfigure fontconfig

Restart Firefox.

Thanks to Carlo Hamalainen for providing the fix.

Category: Ubuntu  | Tags: , , , ,  | Leave a Comment
Ubuntu 9.10: Disable “shut down after 60 seconds”
Tuesday, November 17th, 2009 | Author:

In 9.04, Ubuntu introduced the ridiculous default of waiting 60 seconds after you clicked on “shut down” before actually doing it. Presumably in case you changed your mind. Yeah, really useful.
Upgrading to 9.10 re-introduced this “feature”, but it’s now even less obvious how to turn it off. Here’s how:

  1. Press Alt-F2
  2. In the Run Application window, type the following then click on Run:
    gconf-editor
  3. In the Configuration Editor window, go to Apps/indicator-session, check the suppress_logout_restart_shutdown checkbox, then close the window.

Nice.

Category: Ubuntu  | Tags: , ,  | Leave a Comment
Ubuntu 9.10 mounts cannot yet be mounted
Tuesday, November 17th, 2009 | Author:

I just upgraded from Ubuntu 9.04 to Ubuntu 9.10.
On day 1, startup worked just fine. But that was because I went to make a cup of tea while it was starting up.
On day 2, I got this message during startup:

One or more of the mounts listed in /etc/fstab cannnot yet be mounted:
/: waiting for /dev/disk/by-uuid-...(lots of letters and numbers here)
/tmp: waiting for (null)
/boot: waiting for /dev/disk/by-uuid-...(lots of letters and numbers here)
/data: waiting for /dev/disk/by-uuid-...(lots of letters and numbers here)
/windows: waiting for /dev/disk/by-uuid-...(lots of letters and numbers here)
Press ESC to go into a recovery shell

It was because I hadn’t made a cup of tea!
Seriously though, It’s not an error message, just a horribly worded message implying that ESC should be pressed, which it shouldn’t. Just by doing nothing and waiting (e.g. by going and making a cup of tea), Ubuntu eventually starts up completely OK.
Please Ubuntu, change this! My friend saw the message and now sees Ubuntu as less credible.

I’ll be posting more on Ubuntu 9.10, mostly whinges and fixes to problems, which is grossly unfair. I’m sure there are loads of great improvements too…

Category: Ubuntu  | Tags: , , , , ,  | Leave a Comment