Press "Enter" to skip to content

Richy's Random Ramblings

Techy: Resetting a Windows Vista Password

Due to staff changes at work, we had two Windows Vista PCs (Business Edition, but these instructions should work all all versions of Windows XP and Vista) which had installed/purchased software on them, but we did not know the user passwords and/or administrator passwords. We also did not have a “Password reset disc”. We therefore needed to “break into” them and it’s a lot easier than you expect.

  • First of all, from a machine which you do have access to, download the Trinity Rescue Kit (TRK) from http://trinityhome.org.
  • Now burn the ISO image to a CD/DVD (instructions will vary depending on which platform you downloaded the ISO from and what software you are using). Make sure you burn it as a “Disc Image (ISO)” (aka a “Bootable CD/DVD”) and not just storing the file “as is”.
  • Insert the TRK CD into the machine you need recovering and get the machine to boot from the CD drive (on Dell machines, just press F12 as it is booting for the “Boot Menu” and select “Boot from onboard or USB CD/DVD drive”).
  • Wait for TRK to load.
  • Select the first option on the TRK menu as you don’t need any fancy extras
  • Once booted, type “winpass -l” (that’s all in lower case and finishes with a hypen and then a lower case L for lima)
  • If you get a message about Windows already being mounted, just select the “Force” option.
  • You may then be asked to select a Windows installation – select one and see if it lists the username you are trying to reset. If it doesn’t, repeat the previous step and select another Windows installation
  • Make an exact note of the username as the spelling, spacing and capitalisation will matter
  • Type “winpass -u 'User Name'” where ‘User Name’ is the exact username you are changing. Select the same Windows installation as you did previously.
  • Select option 1 to reset the password for that account to “blank” and, if necessary, unlock the account with option 4 (if there have been too many resets previously).
  • When finished, type “q” and press return to exit winpass.
  • Eject the CD/DVD and reboot.
  • You should now be able to log into that user account without using a password (if it is the only Windows account on the machine, it should auto-boot into that account)

Needless to say, neither myself nor the makers of Trinity Rescue Kit can take any responsibility for any damage/problems caused by following these instructions and I can only say “it worked for me!” (twice).

PHP: Zend Framework and Browser Content-types

I’ve just added a bit more security on to the system I’m working on and for that, I needed to check what the Content-type of the content the browser was sending (as I’m looking at checking that it’s an “application/x-amf” content type requested via Flash). Since I’m using Zend_Framework and wanted to make the check in the controller, it seemed sensible to use:
if (!($this->getRequest()->getHeader('Content-type')=='application/x-amf')) {
throw new Exception('Not a valid request');
}

which worked ok in Firefox. However, when testing in Internet Explorer, I always got “Not a valid request”… Why? Well, IE sends a “Content-Type” header instead of “Content-type”: note the different capitalisation!

It gets worse! Google Chrome (based on Apple WebKit), sends “content-type”.

Here’s the summary

Browser Content type field Content length field
Google Chrome 2.0.172.33 content-type Content-Length
Firefox 3.0.11 Content-type Content-Length
Microsoft Internet Explorer 8.0 Content-Type Content-Length
Safari 4.0 Content-Type Content-Length

Hope it helps somebody else!

YouTube: Japanese Queen

In another shameless Japanese-orientated post stealing from Accordion Guy, here’s a Queen Medley (entitled “Joousama Monogatari” by the Japanese group Joousama):

In order, the songs (if you don’t recognise them) are:

  • Bohemian Rhapsody
  • Bicycle Race
  • Killer Queen
  • Flash Gordon
  • We Will Rock You
  • Another One Bites the Dust
  • A Crazy Little Thing Called Love
  • We are the Champions

Tech: Apple iPhone 3Gs in the UK

Well, the Apple iPhone 3GS (3G Speed) has been announced on at the Apple WWDC (Worldwide Developer Conference) and thanks to O2 on Twitter, here’s the key points for UK people wanting the iPhone:

  • The 3GS be available on the O2 Mobile Phone Network in the UK on the 19th of June
  • The 16Gb version will cost up to £184.98 and the 32Gb version up to £274.23 depending on the contract you chose: an 18month contract will be £29.38 for the 16Gb and £34.26 per month for the 32Gb (and these are the highest prices). In the US, the 16Gb version costs $199 and the 32Gb costs $299.
  • You will be able to upgrade to an iPhone 3GS from another O2 contract phone when you are eligible for an upgrade. You will be able to leave your current contract early if you want it the new iPhone asap: however, you’ll need to speak to O2 and they’ll explain to you how much “early termination” would cost.
  • O2 will be supporting MMS (out of your normal text message allowance: one Multimedia Message will cost four SMS from your allowance)
  • O2 will also be supporting tethering (allowing your computer to use the iPhone as a 3G modem). However, this will be an extra Internet Tethering Bolt One costing £14.68 per month for 3G and £29.36 per month for 10Gb. Both include access to The Cloud’s Wifi points.
  • More information will be available on o2’s website at o2.co.uk/iphone as soon as possible

cPanel: Error: Package system can not be repaired automatically

If, like myself, you have recently upgraded the cPanel control panel system on your Red Hat Enterprise Linux 5.2 server and received the error message “Error: Package system can not be repaired automatically” when upgrading Apache, then it’s probably caused by a problem with either the RedHat Package Manager (RPM) or YUM. To fix it, first ensure that no RPM or yum updates are running:
ps auxwww | grep yum
ps auxwww | grep rpm

If any are running, find out why and kill -9 them if they are zombie processes. Now you just need to rebuild the RPM database:
rm /var/lib/rpm/__db.* -rf
rpm --rebuilddb

This process may take some time (between 1 and 30 minutes depending on your server speed and the number of packages installed). Once it’s completed, you should be able to upgrade without problems.