Archive for the 'OS' Category

New tool list

Saturday, 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).

Subversion on a USB stick

Sunday, 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.

Auto-mounting partitions in Ubuntu

Saturday, 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…

Tip: list all actively listening ports on a Windows machine

Friday, November 7th, 2008

Finding out what ports are open on a machine is something I often need to do, and I usually stuff around for ages trying to figure out whether a particular port is open. The fastest way I’ve (just) found is by opening a console and running netstat -a, or netstat -an to show IP and port numbers rather than machine and service names.

Now that I know that the port’s definitely open, I’ve just got to figure out why the service still isn’t working

zomg! a tux racer arcade game!

Wednesday, February 27th, 2008

At Movieworld there’s a Tux Racer arcade game! Pictures after the fold!

(more…)

Displaying Contacts in Microsoft Outlook Address Book

Tuesday, December 4th, 2007

If you can’t get your contact list coming up in Outlook, here’s a how-to that works well. Two things to look out for are Outlook not closing properly (it may run as a notification button, open Task Manager and kill the Outlook process off just to make sure) which seems to stop the fix from working, and the fact that right-clicking on the Outlook icon to get to mail settings doesn’t work if the Outlook icon is a shortcut (ie 99% of the time). To get into mail settings, open Control Panel then Mail once Outlook is shut down.

Security error when impersonating a user in an ASP.NET application

Thursday, July 12th, 2007

I was trying to get security impersonation working in an ASP.NET app so that database access would work correctly. For reference, to impersonate a user, add this to the web.config file:

The password is stored in plain text format, this is a bit scary but that looks like the way to do it. There must also be a way of using IIS to do the impersonation but I couldn’t get that up.

Now that the app is impersonating the MyDatabaseUser account, it no longer has access rights to the temporary ASP.NET folder. This gives a yellow screen of death with the following error:

Access to the path "C:\\Windows\\Microsoft.NET\\Framework\\v1.1.4322\\Temporary ASP.NET Files\\MyApplication\\XXXX\\XXXX\\hash.web" is denied.

To resolve this, the account needs to be given write permission to the temporary folder. Browse to "C:\[windows]\Microsoft.NET\Framework\[.net version]", open properties for the Temporary ASP.NET Files folder and go the Security tab. Add your database user account and give it the same permissions as the NETWORK SERVICE user (full control). Once this is applied the user (and therefore the application) will have access to the temporary folder root. Now you can move on to the next YSOD.

svchost.exe keeps crashing – module msi.dll faulting

Monday, May 28th, 2007

I just had a spanking new Dell start crashing. svchost.exe kept giving an application error on bootup:

svchost.exe … the instruction at “0x???” … the memory could not be ‘read’

In the application log & finding the error report for svchost.exe it reports that msi.exe (the Windows installer) was faulting.

This is an issue with an automatic update breaking the Windows installer. There is an update available from microsoft (I think it’s this one) but the page I found (Tech Blender: Windows Update Broke My Machine (svchost.exe — application error), and How to Fix It) gives a solution that works:

  1. Turn off automatic updates (right-click on My Computer & go to the Automatic Updates tab)
  2. Reset the computer
  3. Go to Windows Update (in the Start menu or go to update.microsoft.com), use Express Updates and install the fix
  4. Reset your computer again once the update is installed

From the looks the machine is working now. Thanks, Microsoft

See you on the other side

Wednesday, April 4th, 2007

I managed to switch my motherboard _and_ my video card the other day, and keep the same installation of Windows going. I had to do a repair install, which was very tricky, using an original XP disk with an SP2 installation. So I went from SP2 back to vanilla XP with the repair install, installed drivers for absolutely everything, upgraded back up to SP2, installed DirectX 9, and then crashed every 30 seconds until I disabled most of AGP. So that was enough to keep programming (and kick myself for swapping motherboards). But now it crashes every time I try to do something fancy, like opening Azureus, WinAMP, or any other program that uses sound or tries to initialise DirectX.

And the entire reason for the upgrade was to get DX9 so I can check out XNA.

Well I’ve finished my current project for now, made my backups, and am about to reformat. I may even make a partition and install Linux. See you on the other side. If I don’t come back, bury me with my guitars.

VS2005 Service Pack 1 for Windows Vista

Friday, March 30th, 2007

Microsoft has released a service pack for VS2005 under Windows Vista, so maybe I can consider Vista when I eventually upgrade my poor Athlon XP 1600+. Now I just have to get over having to go through twice as many screens to use advanced settings, mess around with an over-simplified explorer interface, buy an enormous screen to make room for the Aero Glass widgets, wait for minutes to delete a file, and the fifteen billion other annoyances that I picked up with Vista after playing for 5 minutes. Easy.