tuskdesign web site design and development http://www.tuskdesign.com imagemagick command line problem<p>problem: convert: error while loading shared libraries: libMagickCore.so.2: cannot open shared object file: No such file or directory</p><p>solution: export LD_LIBRARY_PATH=/usr/local/lib</p>http://www.tuskdesign.com/blog/imagemagick_command_line_problemWed, 21 Jan 2009 20:02:00 +0000mod_rewrite<p>remember:</p><p class="code">AllowOverride All</p><p>in the site configuation file when using mod_rewrite</p>http://www.tuskdesign.com/blog/mod_rewriteFri, 07 Nov 2008 13:09:00 +0000Smooth Ubuntu fonts in Firefox<p>Just a quick note to myself on how to get fonts looking better than Windows on Ubuntu (especially in Firefox). </p><p>First install the msttcorefonts package and then change the default fonts (in System > Preferences > Appearance > Fonts in Intrepid Ibex) from Sans, Serif etc. to their Bitstream Vera counterparts.</p>http://www.tuskdesign.com/blog/smooth_ubuntu_fonts_in_firefoxTue, 04 Nov 2008 22:03:00 +0000Using cron & curl to monitor the status of your site<p>I wanted a method of automatically checking every so often if a site was up and running and came up with the following method that uses <a href="http://en.wikipedia.org/wiki/Cron">cron</a> to run <a href="http://curl.haxx.se/">curl</a> on an arbitrary page on the website. For example:</p><p class="code">curl http://www.tuskdesign.com</p><p>Now in its default behaviour this will output the content of the page (i.e. the html) to standard out, or if there is an error to standard error. In both cases this is usually the terminal if you are using curl from the command line, or if it is in your crontab it will email you the output. But ideally we want to be emailed only if there is an error - having an email sent on success will mean that not only will you be inundated with emails if you run it regularly but you will have to open the email to see what the result was. So let's redirect the standard output to /dev/null so we only get an email if there is an error:</p><p class="code"> curl http://www.tuskdesign.com >/dev/null</p><p>Unfortunately this is not enough as if there is no output curl displays a progress meter which will still get emailed to you. Using the -s flag makes curl silent so that you get no ouput whether there is an error or not. This is also unsatisfactory as you will never get an email now in either case. However using the -s flag in conjuction with the -S flag solves that problem:</p><p class="code">curl -sS http://www.tuskdesign.com >/dev/null</p><p>The -S flag is the 'show error' flag which will display any errors even in silent mode. So we have achieved our desired result. Now all we have to do is put this in our crontab with a line such as:</p><p class="code">0 * * * * curl -sS http://www.tuskdesign.com >/dev/null</p><p>This will run the command at the beginning of every hour.</p><p>It is important to realise that an error in this case means that the site is unavailable for some reason. If you are getting a 404 status code for example (i.e. the site is up, but the page is unavailable), curl will interpret this as a success because something has been returned from the request. If you require more information than this such as when you get a response code other than 200, you will probably need to create a script of some kind to look in the return headers for the appropriate code.</p>http://www.tuskdesign.com/blog/using_cron___curl_to_monitor_the_status_of_your_siteThu, 07 Aug 2008 23:06:00 +0100BBC Music Beta launches<p>The BBC backstage project continues to produce some great stuff with the newly launched <a href="http://www.bbc.co.uk/music/beta">BBC Music</a> (beta). Contains the play list stats for the main BBC music stations in much the same way as last.fm does for your own playlist and then ties in the artists with data fed from the <a href="http://musicbrainz.org/">MusicBrainz</a> api. This is all then wrapped in their own api for further development. Cool stuff!</p>http://www.tuskdesign.com/blog/bbc_music_beta_launchesWed, 30 Jul 2008 22:09:00 +0100