July 11th, 2009
My fileserver has 10 disks in a linear setup (JBOD, BIG, whatever you want to call it). I’ve been using software raid on Linux to do this. Today, one of the drives seemed to fail, giving me a read-only filesystem. Without too much experience in the field, I assume this harddrive is on it’s way out. I did a simple disk info and found it was 1 of 3 Samsung drives… Which one though? And is it really faulty?
I downloaded a utility from Samsung that lets you run a disk diagnostic, which would hopefully give me an answer to that question. However, I had to choose between a bootable CD and a floppy, neither of which works for me since I don’t have an optical drive or a floppy drive in the fileserver. So! Here’s how I made a bootable USB thumb drive:
Note: This will only give you a bootable MS DOS drive.
- Download the “HP USB Disk Storage Format Tool” from bootdisk.com (it’s under “method 2″, first link, currently version 2.0.6)
- Install the app.
- You will need the files from a MS DOS boot floppy. You can get plenty of different versions from bootdisk.com. I chose the Windows 98 OEM version.
- Most of these will want to write straight to a floppy (to get the boot sector right). If you’re like me and a don’t have a floppy drive anymore, you can download and run an awesome little app called Virtual Floppy Drive. This will emulate a floppy drive on your windows box. Pretty awesome for stuff like this.
- Create the floppy using the downloaded boot disk creator.
- Insert an appropriate USB thumb drive into the system. I’ve tried different drives and it handles most of them just fine. This time I used a simple MicroSD => USB adapter and a small memory card.
- Run the HP USB Disk Storage Format Tool thingy, select your USB device, select FAT as the file system, choose a quick format and to create a DOS startup disk. Browse to your (virtual?) floppy drive and click OK, then Start.
- When it’s done, feel free to copy any applications you want to run from it over to the thumb drive. I downloaded the bootable CD diagnostics from Samsung, opened the ISO file and extracted the application files onto my thumb drive.
- Plug it into whatever system you want to boot, be sure to set the BIOS to boot from it and you should be good to go
Hope this helps someone, it took me a little while to figure this out a while ago and figured I’d write a small howto.
Tags: boot, floppy, Hardware, thumbdrive, usb
Posted in Hardware | 1 Comment »
June 23rd, 2009
I’ve been developing some Android stuff lately, and finding it a real joy to work with.
It gets rather tiresome to look at the same fake phone all the time though, so I decided to take a break and see if I could create a skin based on the upcoming Samsung i7500 (I believe they’ve named it Galaxy now, at least in Germany). The screen position and such may not be spot on, but it has the right resolution at least. I mapped most of the buttons too, but the zones had to be cut off a little due to the emulator not supporting weird button shapes (afaik).
Should anyone be interested in downloading it, feel free to get it. Just extract this to your Android/platforms/android-<version>/skins folder and you should be good to go. Run the emulator with the flag “-skin Galaxy” (or if you’re using Android 1.5 or upwards, just select Galaxy as your skin in the AVD Manager). Here’s a screenshot of how it looks in action:

Samsung Galaxy Android Emulator skin
Tags: Android, emulator, galaxy, samsung, skin
Posted in Android | 6 Comments »
June 20th, 2009
I’ve been writing a couple of web services lately which returns XML data. If I’m on a deadline and just have to get it up and running, I usually don’t care for small details, but a hobby project is another matter. When I have the time, I like to sit and tweak the code to get the response looking as clean as possible, giving meaningful error messages, logging errors to files etc.
Let’s say I’m writing an application that retrieves a list of notes from a web service. The URL for retrieving the XML data would most often look something like:
http://whatever.webservice.com/feeds/latest.php?since=timestamp
Which is fine, except one little aspect: it doesn’t tell me if I am getting data back as XML, JSON, CSV or in some other format. I would much rather prefer to have this specified in the URL. Examples of good, clean URLs would be any of the following:
http://whatever.webservice.com/feeds/xml/latest.php?since=timestamp
http://whatever.webservice.com/feeds/latest.php?format=xml&since=timestamp
http://whatever.webservice.com/feeds/latest.xml?since=timestamp
I personally think the last one is the prettiest. There are reasons why the two first might be “better” from a code and performance perspective though:
- The subdirectory method could handle outputting of the data in that format and only that format, not needing any if-checks.
- The query parameter method could handle a lot of different formats in the same file, and would simply call the correct function to retrieve the data in the correct format.
The last one was what I went for in the end. The problem with that is making Apache understand that this “XML” file is really a PHP file. I solved this easily with this simple .htaccess file, which forces every XML file within the directory you place it in to be run through PHP:
<Files *.xml>
ForceType application/x-httpd-php
</Files>
Sending the correct headers is also a bonus:
<?php
header('Content-Type: text/xml; charset=utf-8');
Worth the effort? You tell me
Tags: Apache, htaccess, PHP
Posted in Apache | No Comments »