New tool list

November 7th, 2009

I’ve added my tool list to the sidebar. This is a collection of free tools and software that I absolutely have to have on all my computers (there’s a few of them).

jQuery Blink plugin

October 8th, 2009

I love this Blink plugin by John Boker. Not because it’s something that should ever be used (I don’t think that was the intent). It’s just a good, simple reference plugin.

Subversion on a USB stick

September 27th, 2009

I use Subversion for version control at work, so I wanted to use it for a couple of websites and projects that I play with at home. I’ve been thinking about buying a cheap server or NAS that I could set up but couldn’t justify the cost and electricity just for want of version control.

As it happens, my Subversion client of choice TortoiseSVN can create and access local Subversion repositories. Probably all SVN clients can do this, and this is just a feature of the system, but when I’m used to seeing the version control purely as a client/server configuration this was a bit of a surprise. TortoiseSVN integrates nicely with Windows Explorer which makes it extremely easy to work with. If I had to load a seperate SVN client just to commit changes I would most likely put it off and/or forget about it. TortoiseSVN makes working with Subversion so easy that it is the main reason I keep giving up on Linux for my development machines.

One of the attractions of version control is that the project is portable – I can check out (make a local copy of) a website on my home PC, make changes, commit the changes to the server, then update the site on my laptop, without having to worry about copying files (and having different versions of files in the one place). That requires the Subversion server to be accessible on both machines, and if I don’t happen to have internet access for any reason that may not be possible.

Setting up a repository on a USB stick gives me most of the benefits of the typical client/server setup. The biggest downside is a lack of backups, which is something that needs to be maintained on a server anyway, and should be worked around by making backups of the repositories on the USB stick. In any case even if the repository fails I still should have multiple working copies on various machines. Not ideal but at least the files won’t be lost.

So how to do this? First install TortoiseSVN. I’m going to assume familiarity with SVN, and with TortoiseSVN in particular.

On the USB stick, make a folder to store the repositories. I called my folder svnrepos. Inside that folder, make another folder for the first repository. This is the name of the repository so call it something sexy, like bentest. Right click the folder, go to TortoiseSVN, and Create repository here. Wheels will turn, and a message should appear saying the repository was created.

Now go to your development folder, or wherever you want to check out a working copy of the project. Right-click the development folder (eg C:\Development\www) and select SVN Checkout.

The URL of repository is the path to the local repository that you created, as a file URL. Mine is file:///E:/svnrepos/bentest (note there are three slashes after the file: part). The checkout directory is where the working copy will be created. It should be automatically filled in when editing the repository URL, but can be changed. Mine is C:\Development\www\bentest. Click OK and you should have revision 0 of the repository ready to create trunk, branch and tag folders and add content.

Version control. Distributed backups of your precious work. No reliance on internet access and access to private Subversion server. Beautiful.

I haven’t experimented with this so far but I suspect there may be issues if the USB drive comes up on another driver letter. The repository url will probably need to be changed in the working copy. That should be possible via the Relocate command in TortoiseSVN’s context menu.

UPDATE: Relocate is indeed the command to use. TortoiseSVN throws up a warning about corrupting your working copy, but as long as the path entered is the new path to the same place in the repository (eg from file:///H:/svnrepos/bentest/trunk to file:///F:/svnrepos/bentest/trunk) this is the best/only method.

Moving das blog to a subdomain

August 3rd, 2009

OK so I’ve recently moved my blog to a subdomain and noticed that this broke all of the Google search results that I’ve got (dude it’s like 3 hits a month!). No really, search for subversion comments (in Australian pages only) and I’m the sixth result. So to set up the subdomain on my shared host I just used cPanel. That part worked fine, but it meant that all requests to http://www.belfryimages.com.au/2008/03/18/editing-past-log-comments-in-subversion/ got redirected to http://blog.belfryimages.com.au. This was due to the generic .htaccess file that was generated.

To get the old links working I had to rewrite the .htaccess file. This lives where the blog used to be (at belfryimages.com.au/.htaccess):

RewriteEngine on
RewriteCond %{HTTP_HOST} ^belfryimages.com.au$ [OR]
RewriteCond %{HTTP_HOST} ^www.belfryimages.com.au$
RewriteRule ^(.*)$ http://blog.belfryimages.com.au/$1 [R=301,L]

The joy is made in the last line. The ^(.*)$ part is a simple regex that just copies the entire request part, and the $1 in the http… part copies the request into the address of the new redirect.

– fixed the google assert ;-)

New Hash Tool

July 29th, 2009

Latest installment in the Tiny tools I can write rather than sit on Facebook or watch Masterchef series. I’ve just made a new Hash tool. This takes an input and applies a hashing algorithm. This is useful for example when inserting a password directly into a database. Like the other two tools this one is open source via Creative Commons and source is available here. Not that it’s brain surgery, but it’s my own little code garage sale.

Updated password generator

July 28th, 2009

I’ve added fake GUID and hexadecimal-only options to my uber-cool password generator. Yay.

An IP address tool for teching around the internet

July 11th, 2009

I’ve added a super simple tool that just returns the requester’s external IP, which is useful when debugging and for tech support. No biggie, there’s a heap of other tools around the place, but I can never remember the right variation.

The tool is at myip.belfryimages.com.au.

Password Generator

July 8th, 2009

I just made a quick tool for generating strong passwords quickly. It’s hosted at http://pwdtool.belfryimages.com.au. Now I should probably have written something to remind me where I left my keys… hmm….

Forgetting

May 21st, 2009

Auto-mounting partitions in Ubuntu

May 9th, 2009

I’m trying Ubuntu again, as I’m sick of Vista and Windows 7 doesn’t look much better (although I am dual-booting for games). It still just doesn’t seem suitable for a user with advanced Windows knowledge but only intermediate Linux experience. Some things just don’t work out of the box, which is fine except that finding the solution usually involves googling the answer rather than searching through the config menus or hitting F1.

Case in point is auto-mounting NTFS partitions. I know that Ubuntu automatically mounts the partitions in the Places menu when you select them, but I’ve set /var/www to be a symlink to a folder in /media/sda4 (an NTFS partition that I also use in Windows) which means that Apache fails until /media/sda4 is manually mounted. Ubuntu’s built-in help system isn’t any help, searching for ‘automount’ yields a page about Gnome Display Manager and some date format thingy.

Make Tech Easier – How To Auto-mount Your NTFS Partition In Ubuntu contains the correct instructions but basically you need the Storage Device Manager. Open a terminal:

sudo apt-get install pysdm

Once that’s installed, under System/Administration is the Storage Device Manager. It’s not the nicest app (the UI could use some work, like adding the type and partition size to the list of partitions) but it gets the job done and is much easier than editing .init files or whatever.

I’ll leave the Ubuntu vs Windows rant for another day… till then sticking to Ubuntu…