Archive for the 'Techy' Category

Production and Staging with Capistrano

Sunday, August 31st, 2008

For the benefit of googlers, should you happen to be wanting to use the very good Capistrano to deploy your project, and want to switch between staging or pre-production and live or production environments, the best way to handle the switch is using the Multistage facility in capistrano-ext.
It’s basically just ‘gem install capistrano-ext’, then at [...]

Java on Debian Etch

Monday, July 7th, 2008

I got a bit confused when googling how to install java on Debian 4, but this business seems to work:
vim /etc/apt/sources.list
add non-free to the ftp.debian.org entry:
deb http://ftp.debian.org/debian/ etch main non-free
deb-src http://ftp.debian.org/debian/ etch main non-free

Then
aptitude install sun-java5-jdk
I’ve always been a bit crap at Debian, it never quite works how I expect it to!

VMWare Shared Folders

Friday, May 30th, 2008

I wanted to add a shared folder to a linux VMWare image in VMWare player, and got thoroughly nowhere. Thanks to the magic of EasyVMX though, I know now the secritz. In the .vmx file of the VM , add:
sharedFolder.option = “alwaysEnabled”
sharedFolder0.present = “TRUE”
sharedFolder0.enabled = “TRUE”
sharedFolder0.readAccess = “TRUE”
sharedFolder0.writeAccess = “TRUE”
sharedFolder0.hostPath = “D:\projects\”
sharedFolder0.guestName = “share”
sharedFolder0.expiration = [...]

Tunelling SVN & mod_proxy

Wednesday, April 9th, 2008

Mr Gray and I have recently been working on a project where the subversion repos is IP restricted, and we’ve been tunelling over to a machine that is in the IP allow list to get access. Because the repository is accessed via WebDAV, it either means putting our local web servers on another port than [...]

Dodgy Hax

Friday, September 28th, 2007

I recently upgraded to WP 2.3, and an old hack I’d done came back to bite me in the arse. What I had was:
$link_cats = $wpdb->get_results(”
SELECT
Distinct
C.cat_id,
C.cat_name
FROM
$wpdb->link2cat As L2C
JOIN
$wpdb->categories As C
On C.cat_id = L2C.category_id
WHERE
C.cat_id <> (category id was here)
“);
But link2cat has been removed. I replaced this, after a bit of hunting, with the (much more sensible):
$link_cats [...]

Surrogate versus Natural Primary Keys

Friday, August 10th, 2007

Warning: Random SQL related musings
I broadly agree with this article on primary keys in database design - in effect saying that autoincrement/serial/identity columns are a Bad Thing. There are some cases where I don’t think there is any realistic option though, and some cases where an artificial primary key is more pleasant.
Firstly, the effectiveness [...]