Sep 27 2007

Fixing Comment Counts in Wordpress

As I’ve just migrated to using Wordpress for my blog, I thought I’d add some useful information in my first post.

Wordpress caches comment counts for each individual article in wp_posts.comment_count. If for some reason these cached values don’t match up to the real comment counts per article, you can fix this using the following SQL. This applies to Wordpress 2.3. I don’t know if it will work for anything else.

UPDATE wp_posts
  SET comment_count = (
   SELECT COUNT(*)
     FROM wp_comments
     WHERE wp_posts.ID=wp_comments.comment_post_id
     GROUP BY wp_comments.comment_post_id
   );

Sep 20 2007

Bad user…

# uptime

  2:05pm  up 49 day(s), 20:17,  45 users,  load average: 7938.89, 5199.82, 1657.09

Aug 9 2007

A few months on…

It’s been a few months since I bought my Mac now. It’s really become my main operating system at work and I use it fairly frequently at home, so I thought I’d list a few of the applications I’m using frequently:

  • iTerm - iterm.sourceforge.net.

    An enhanced terminal application. I was used to gnome-terminal on Linux and the tabbed window feature was something I missed in the Apple supplied Terminal. One minor gripe was some broken keyboard mappings, but I fixed that.

  • VMware Fusion - vmware.com/products/fusion.

    Basically this is VMware Workstation for Macs. The Unity feature is excellent, allowing me to embed Windows applications on to my OS X desktop without having to have an entire Windows desktop running in a window. My main requirement for this is to run Linux and also for Windows XP (my work use Microsoft Live Communication Server - Windows Messenger is the only client that I can use to talk to it and the Mac version doesn’t seem to work). I’ve always been really impressed with VMware’s products and Fusion also excels.

  • MacFUSE - code.google.com/p/macfuse.

    FUSE for Macintosh. It allows me to mount filesystems on machines just using SSH. Another great piece of software which I was used to from Linux.

  • Azureus - azureus.sourceforge.net.

    A cross-platform Java BitTorrent client. I’m not too keen on what they are doing with v3, but v2.5 is ok. I’ve also been using Transmission - tranmission.m0k.org, although sometimes it doesn’t have some features that I want to use.

  • VirtueDesktops - virtuedesktops.org.

    Virtual Desktops for OSX. If you used Virtual Desktops before you’ll find this to be a really nice implementation with some clever features that allow you to use the tilt and light sensors to change desktops (although they’re more of a gimmick than anything else). Development of VirtueDesktops has stopped as it is about to be out-moded by the inclusion of a Virtual Desktop feature ( Spaces) in the next release of Mac OSX. Until then, VirtueDesktops is great.

  • Firefox - getfirefox.com.

    The best web browser out there for my purposes.

  • MissingSync for Palm OS - www.markspace.com/missingsync_palmos.php

    Decent synchronisation for my Treo 680 phone.

  • SpanningSync - spanningsync.com.

    Synchronises my iCal Calendars with Google Calendar. I’m not usually that keen on “Subscription Software”, but this application seems to work reliably.


Jul 5 2007

Remember kids

Every time you send an HTML e-mail, a fairy dies.


Jun 18 2007

Google Streetview

Well “explore holmfirth” has been offline for years now. Me and beezly started thinking about how we could bring it back in form of a dynamic community driven photo navigation system, …but never quite got round to it.

For a long time Geograph has been the closest anyone has come to my idea (Well that’s the most impressive UK example of photo-location tagging at least)

But the big G has just launched a new extension to their maps…

Google Streetview

Takes a while for all the fancy javascript to load, but give it a try. Cool hey? Might have to wait for a while before they add Holmfirth coverage though!


Jan 30 2007

Someone asked me the other day…

… how many computers do I use. They meant, at work and at a home, how many do I use on a day to day basis.

It took me a while to work out, but here’s a semi-detailed answer;

  • monkey. monkey is my main home workstation. I use it when I am working from home, or for playing the odd game, although I’m not much of a gamer (though recently I’ve been playing Speedball 2 - a game from the early 90’s I used to play). I’ve had monkey, in various forms, for the past ten years, although I suspect the only original part is the floppy disk drive.
  • coal. coal is my main home file server. It stores all my files, music, videos and all the other tat you keep. It also acts as a DNS server, LDAP replica and shares out music via DAAP (iTunes).
  • diamond. diamond is my firewall and wireless access point.
  • moon. moon is my test box. At the moment I am trying out Nexenta on it so I can run my home directory on ZFS (over NFS).
  • gold. gold is a big machine that I have (14 CPUs and 4.5GB RAM). It is currently turned off as it uses quite a lot of electricity. I use it if I need a large SMP machine (which is rarely).
  • rock. rock is my PVR machine for recording and watching TV. It is currently turned off.
  • tintin. tintin is my Mac laptop. I use it when I am out and about - or lazing in bed!
  • terrapin. terrapin is my main workstation at work
  • tortoise. tortoise is my work NFS and test server. It has also been known to share music out via DAAP (iTunes).

That brings the number to 9. 6 at home, 1 laptop and 2 at work.

That’s not right.


Dec 13 2006

First Thoughts on Firefox 3 Alpha 1

Firefox 3 Alpha 1 is available, although only recommended for developers and crazy people.

The first thing I’ve noticed is that rendering of pages, especially those using lots of Javascript and AJAX goodness is much, much quicker.

I’ve also noticed that it crashes a lot - but it is an Alpha release, so that’s to be expected.

That is all.


Nov 7 2006

Loosing Time

Looks like fiordland.ubuntu.com (the default ubuntu time server) is loosing time (highlighted in red)…

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 fiordland.ubunt 193.79.237.14    2 u   17   64    1   86.350   30.454   0.001
 71.237.179.90   140.142.16.34    2 u   16   64    1  199.342    4.298   0.001
 ntp1.ja.net     193.62.22.98     2 u   15   64    1   25.256   -5.517   0.001
 ntp2.ja.net     .GPS.            1 u   14   64    1   23.713   -4.287   0.001
 ntp0.ja.net     .MSF.            1 u   13   64    1   20.058   -4.979   0.001
 LOCAL(0)        LOCAL(0)        13 l   12   64    1    0.000    0.000   0.001

Sep 26 2006

Shell history meme

cs1ajb@bootsy:~$ history|awk '{print $2}'|awk 'BEGIN {FS="|"} \
  {print $1}'|sort|uniq -c|sort -rn|head -10
     78 cd
     73 ls
     60 ssh
     43 sudo
     24 apt-cache
     22 vi
     16 script/server
     13 ps
     11 dpkg
      9 sqlite3

Yup, I’ve been doing some Ruby On Rails development.


Sep 19 2006

Vim users rejoice

Today I found an awesome new vim feature;

vim scp://<remotehost>/<remotefile>

Oh yes. It is good.

Sorry to those of you who haven’t a clue what I’m talking about.