Archive for the ‘Informative’ Category

Unlocking My 3GS 3.1.3

Friday, May 21st, 2010

I was going to title this “Unlocking the iPhone 3GS 3.1.3″ and then I realised that there are a billion posts out there like that, and there doesn’t seem to be a one-size-fits-all answer to this. So, here’s what worked on mine.

1. Grab a copy of Spirit (has Mac and Win versions)

2. Make sure you have already activated your iPhone (i.e. turned it on and synched to iTunes and you are able to register with the cellphone network)

3. Connect the iPhone and run Spirit, hit Jailbreak

4. Install Ulstrasn0w and you have unlocked the iPhone :)

NOTE: I’ve discovered and confirmed Ultrasn0w doesn’t work with baseband 05.12.01 yet.

The difficulty for me with the 3GS was that the older methods of unlocking it didn’t work for me, because I have a native 3.1.3 model…which has intermittent success depending on the actual model number. Spirit worked though.

VirtualBox UUID Woes

Thursday, March 25th, 2010

I had a power outage the other night and it looks like one of my VirtualBox virtual images got a little corrupt and it’s UUID changed. This isn’t espcially a problem, but VirtualBox identifies images by the UUID and therefore refused to start the VM this is attached to throwing the error:

UUID {b6e58671-d821-4dba-b723-f12defc2650a} of the medium ‘/home/admin1/vimages/zen.vdi’ does not match the value {c14b3de3-78c8-40a1-8106-badd0e0fb9c2} stored in the media registry (’/home/admin1/.VirtualBox/VirtualBox.xml’)

I hacked the VirtualBox.xml file to reflect the new UUID but it still gave me the same error. I guess VirtualBox must cache it somewhere.

I ran:

VBoxManage internalcommands setuuid “/home/admin1/vimages/zen.vdi”

Which said it ran successfully, but then gave me the same error when I tried to start the VM. Weird. Cloning the VDI also fails with the same message, so I can’t generate a new virtual image from this one either.

I have in fact had this issue when using the Mac version of VirtualBox, and I removed the image from the HD listing and re-added it, forcing VirtualBox to accept the new UUID of the image. Unfortunately, I couldn’t find in the manual how to perform this step on the command line. Simly detaching and reattaching the media does not force VirtualBox to change the media registry.

Eventually after molesting Google to broaden my search way beyond my error message (effectively looking at everyone who had UUID errors in VirtualBox!) I came accross the unregisterimage command. Intuitively I discovered there is an identical reverse command called registerimage. These commands control the media library from the command line. They appear to be compeltely undocumented in the VirtualBox Manual. It’s quite stupid really, they should be in the same section where the GUI describes how to do this.
A quick detachment of the drive from my VM:

VBoxManage storageattach zen –storagectl “IDE Controller” –port 0 –device 0 –medium none

Followed by resetting the image registration:

VBoxManage unregister “/home/admin1/vimages/ubuntu.vdi”
VBoxManage register “/home/admin1/vimages/ubuntu.vdi”

And re-attaching the drive:

VBoxManage storageattach zen –storagectl “IDE Controller” –port 0 –device 0 –type hdd –medium “/home/admin1/vimages/ubuntu.vdi”

And all was good!

Dell 1320C and Mac OS X

Monday, February 22nd, 2010

When my Samsung CLP-300N failed, I had about $200 worth of new unused toner sitting around and so I bought a 2nd hand CLP-300 (the network version is rare and so prohibitively expensive). This worked ok for about another 6 months, but before I can even change the toner, the black imager is dying again. So I investigated sub $500 color laser printers, and I found that the Dell is one of the cheapest capital expenditures while still giving good quality. I think this is because they sell the toner with the imaging unit, which makes the toner about $100 per color, very expensive. However, it should prolong the printer. I saw these on special at $180 from Dell’s site and picked one up last month. I hadn’t set it up because of the shift though. Now, in the new place, in a hurry to print something, I unboxed it and set it up, only to find that:

1) Mac OS 10.5.8 does not support the printer natively

2) The driver disc Dell included includes only the electonic version of the manual, in about 10 languages, in the Mac OS mount partition (obviously the Windows drivers are on the Windows partition).

Googling tells me there is no driver, and to use a Fujixerox driver that uses the same electronics, and so will print, but will not give any options. Great. I couldn’t even find the driver they were talking about. However, dispelling these myths and the myths of Dell’s lack of support for Mac OS X, they do indeed have a Mac OS X driver on their site. And it’s just the driver - 550kb download or so. The application has been split. I like this. It works perfectly now. Thanks Dell! :D

Opening file URI Links In FireFox 3 From A Website

Wednesday, February 10th, 2010

I have just had to write a web application that links to the local file system (NFS actually) to open a directory that stores common business files in FireFox 3. It doesn’t allow it. I found many sites saying this, but not offering any real helpful workaround. Mozilla is quite clear about this fact, and the appropriate work around:

For security purposes, Mozilla applications block links to local files (and directories) from remote files. This includes linking to files on your hard drive, on mapped network drives, and accessible via Uniform Naming Convention (UNC) paths.

http://kb.mozillazine.org/Links_to_local_pages_do_not_work

The solution is to alter the security settings for the site in question, with the exact settings shown above. Note that the settings do not require using the user.js / prefs.js file and can be enabled in about:config, although doing that on many computers might be a drag!

RedMon Installation Errors

Saturday, November 7th, 2009

I recently had an experience with a Canon LBP-3500 printer where we were sharing the printer on the network, and one of the laptops that needed to use it was using 64 bit Vista. Canon don’t provide 64 bit drivers for their CAPT range of printers it seems, so there was no driver for the 3500, nor any compatible driver. In fact, the driver setup program even refused to run.

The solution that I found was to use GhostScript and Redmon to create a normal Postscript printer for a printer that wasn’t actually there, share that printer, and  rediect the rendered output to the real printer. Of course, it means that the remote computer won’t have the fancy utilities and options available in the real Canon driver, but at least it would enable printing.

The problem was, during the installation of RedMon, I messed it up and had to uninstall. The uninstall failed, and reinstallation kept failing with:

“Error Copying DLL. Error = 5. Access is denied”

The error is actually correct. Something goes wrong with the permissions when installing the RedMon files into C:\Windows\System32, and those files cannot be overwritten. The solution is to manually  remove the RedMon files from that directory. I think the files are redmonnt.dll and unredmon.exe (after you fix the DLL error, it complains about another file). Alternatively, just do a search for “*redmon*” and delete the files located in the system32 directory. Installation should then succeed.

Linode’s Marketing Gimmick

Friday, November 6th, 2009

As part of my job, I manage virtual machines on both of these networks. With rolling out Hyperic as a new monitoring solution, I’m now able to see some of the inventory that gets picked up by the agent automatically. This includes the amount of memory on the box.

When I installed the agent onto a Slicehost VM, all was good. The CPU is showing 2×2, which means 2 dual cores, which is interesting, it means they are not using native quad cores. At least, not in the box I’m in. Investigation on the actual box shows that they are using Dual-Core AMD Opteron(tm) Processor 2214 series processors. The memory from Hyperic shows as 512MB, which is what that VM has.

On the Linode box, it shows 1×4. They are using quads. The VM reads this as Intel(R) Xeon(R) CPU L5420  @ 2.50GHz. For some reason though, the memory was showing as 704MB. My first reaction was: That’s an odd number, did they allocate it wrong? However, checking the specs, it is supposed to be 720MB. Checking on the actual box shows 720,000kb or there abouts.

It was pretty obvious then that Linode are advertising their memory based on 1MB = 1000kb, like hard drive manufacturers do. That’s why when you buy a 500GB drive, it doesn’t format as 500GB, but it will format as 500,000MB (which is about 420GB). Slicehost are selling the memory as what the OS sees.

The actual RAM readings from the OS are.

Slicehost = 523008k total for a 512MB slice

Linode =  721740k total for a 720MB slice

It doesn’t bother me very much because I usually leave capacity margins when I provision servers, but it is annoying that Linode don’t tell people that is what they are doing.

Hyperic Agent / Server Time Issues

Wednesday, November 4th, 2009

I’ve been playing with a variety of network management systems for a month or so now and I’ve decided that Hyperic is the best for my use. It might not be the most detailed / configurable, but it’s “good enough” and sports the ability to install the agent and have the agent automatically detect most of the monitoring metrics I want. Anyway, I added my 5th server to it once I’d figured out the configuration that I was going to use for everything, only to find that this 5th server wasn’t appearing on my Dashboard metrics. About 4 hours later, it also stopped reporting metrics in the indicator panel of the platform. This was weird, given that the host was still up, I could see everything on it, and the Hyperic agent reported that it was working just fine (through the status command).

I went to the live metrics, and when I ran top it ran. Except then I noticed the time on it was 30 minutes out. My first thought was that the server was being stupid and caching the data before putting it into the the database ready for extraction and display. But then when I ran top on the host that the agent was installed on, the time was the same — the host actually had the wrong time. I realised that I hadn’t set NTP to run on that machine. As soon as I ran it and upated the time, the platform appeared in the dashboard metrics and the indicators started going green again. There was, however, 6 periods which are blank in the indicators as the time jumped. So, the lesson is, Hyperic will use the time that the Agent reports from the host it is installed upon, it does not time conversion. This also affects what is displayed on the dashboard metrics — it must only display what is happening “now”, so that if one of the platforms that a metric is on is reporting that it is a different time, it is not included as being “now” and thus is not shown. Good to know, even if I did find out by being frustrated (what’s new in system administration).

Splunk 4 - Trial to Free License Conversion

Tuesday, November 3rd, 2009

I downloaded Splunk 4 a couple of months ago when it came out because I decommissioned the box that my original Splunk version was on (and changed OS’s - see my battle with FreeBSD and Splunk in earlier posts) and I needed to download the package again. At the time, there was no free license available. Actually, I didn’t realise that when I downloaded it, and I wound up with a 60 day enterprise trial license. I didn’t do anything with it that I didn’t do with the old 3.x free license, as in, I didn’t index any more data and the authentication actually just annoyed me (I’m the only user).

Anyway, it expired after 60 days a the beginning of October, and there was still no free license available, so I stopped using it. At the end of October (27th), Splunk released a free license verison. Unfortunately, they provided no instructions on going from the trial to the free license version. The marketing release mentioned that 3.x enterprise users should contact sales for upgrades, and 3.x free users should read the documentation. Unfortunately, all the documentation said was that the 3.x license wouldn’t work with 4.x, and the rest of the documentation referred to the old Splunk version. Nothing indicating how to upgrade from 3.x to 4.x free license, or trial to free license conversion.

I sent sales an email and got a response back saying “Hey, thanks for using Splunk, go read our marketing release”. I’m thinking, yeah, I did that already, that’s kind of why I emailed you… Oh well. Anyway, I’ve been trying to move all these beta monitoring servers into production,so I wanted to get Splunk working. I poked around in the directories and discovered /opt/splunk/etc/splunk.license. Renaming it so that the program couldn’t find it didn’t really work; Splunk stil said my license had expired. I wound up being ready to ditch my existing database and just install a fresh copy if necessary, but first I was going to see if I could install the new version, rip the free license file out of it manually now I knew where to find it, and put it in my old directory. Because I’m using Debian / Ubuntu, when I installed the new package version, it automatically deteted an upgrade. Ok, there goes my idea of manually copying the file, I should have gone with the tarball..however, because I’d renamed the license (or maybe it does this anyway, I’m too lazy to reinstall it now it works), the upgrade installed all of the licenses and upon the first run prompted me to agree to the license agreement for a free license. Woohoo! Working Splunk. And it kept all my data that had been indexing from the Enterprise trial. :D

VirtualBox 3.0.2 & FreeBSD 7.2 Network Bridging - FAIL (and fix!)

Sunday, November 1st, 2009

After deciding not to use VMWare if I could find a working alternate solution, I went back and decided to actually test VirtualBox 3.0.2 on a Ubuntu 8.04 headless server. I installed FreeBSD 7.2 as a guest because it was the only ISO I had available at the time, and I will be wanting to use it in production.

My questions were:

  • Does it work (i.e. the VM runs, the management interface gives me visibility and I can connect to the console)
  • What is the performance like
  • What is the resource hit (or “how VM’s at a time can I run on my server”)

Throughout all of this I had configured the VM with bridged networking (once I eventually got the commands for it right!) and an IDE controller for the virtual HDD.

The answer to the 1st question is yes, but the bridged networking didn’t work at first. By default, VirtualBox gave me an AMD PCNet 79C973 (it’s even present in the XML config file). FreeBSD detected this, but wouldn’t DHCP off it. The problem was that FreeBSD didn’t see the media being connected (i.e. it thought the cable was unplugged).

media: Ethernet none

I checked and rechecked (reset) all the VM settings form VirtualBox, but it looked all ok. Because VirtualBox allows different types of NIC’s, I decided to try my luck with one of the Intel NIC’s. It worked; the interface came up right away and the media was detected by FreeBSD correctly. Obviously I had to reconfigure the NIC because it was a new device, but once I’d done that, it was successfully bridged to the network. The exact command I used was:

VBoxManage modifyvm ftest -nictype1 82540EM

Which changes the NIC to an Intel Pro 1000. I really don’t care about the speed, I know it’s virtual anyway, but I do care that this one works and the AMD does not!

I think this might be a bug in FreeBSD 7+. Looking at a thread where someone is trying to get bridged mode working in the FreeNAS LiveCD, it doesn’t work in the 0.7 liveCD which is FreeBSD 7 based, but it works in the FreeNAS 0.69 CD, which is FreeBSD 6 based. Hrmm. Oh well, at least now there is a solution listed on Google somewhere! :)

By the way, the performance hit on a Dual P3 733 with 1.5G of RAM and nothing (I mean nothing, it was a complete fresh install of Ubuntu Server 8.04 w/ SSH enabled and VirtualBox 3.0.2 over the top) is 40% of one CPU when the VM is idle. It quickly jumps to 100% of one CPU when any disk work is done, even if the work inside the VM is not CPU intensive, so obviously virtual HDD I/O is still slow (PIO style woooooo!!).

It is, however, fast inside the VM. I’d say between 2/3 and 3/4 of native speed, depending on how much disk work is involved (disk work is about 20% of native speed). An I *really* like the VRDP facility. That is the winner for me, and the final straw which made me switch from VMWare (plus the fact that it works! ;)

Office 2008 Mac OS X Won’t Write To Samba Share

Wednesday, October 14th, 2009

I deployed a FreeNAS server last week, and FreeNAS uses Samba for SMB / CIFS file sharing services. Everything went smoothly, but today I was informed that one of the users was having trouble Saving Excel files directly to some folders. He had been saving to his desktop and copying across, which worked. That means the folder permissions for his user were ok. What was going on? I isolated the problem to Office 2008 on his Mac OS Snow Leopard machine. I also isolated it to the fact that it was happening only when he saves as the native file formats (xlsx, docx), saving as Office 2003 files worked fine. What was doing on?

Microsoft Excel cannot access the file “server:path:to:file”
There are several possible reasons:

- The file name or path name does not exist
- The file you’re trying to open is being used by another program. Close the document in the other program, and try again.
- The name of the workbook you’re trying to save is the same as the name of another document that is read-only. Try saving the workbook with a different name.

It turns out that when saving the native format, Office 2008 will save to a temporary file, write to that file, then rename that file to the real file. The problem? When creating the temporary file, it was setting it read only. I have no idea why. I found the solution after a lot of searching on Google (I found lots of suggestions, but no solutions that worked). The solution is to disallow users to be able to change the permissions on files that are created, and to force a file creation mode.

On the share in question:

create mask = 0775
force security mode = 0775