The official llllloooooo blog

Sunday, October 4, 2020

Kinetic Valium - Fidget Spinner

I want to officially document my inventing of the term "Kinetic Valium" which applies to my Fidget Spinner. If you have any kind of anxiety then cast aside your sense of self pride and dignity and get one of these.

Note the ink stains. A pen leaked in the same pocket as my fidget spinner.
I still wear those pants.

For me, the fidget spinner helps the most when you're stuck somewhere with absolutely nothing to do or to entertain you. I don't care about the weird looks I get from other adults when I'm playing with a "childrens" toy. I feel like the day I'm considered a "normal" person by other adults is the day that I've failed as a human being.

Smoking also alleviates boredom and anxiety but it
is not as cool as using a fidget spinner.

I've recently become a fidget spinning master. I can now spin the device both clockwise and anti-clockwise!! (Well, only in my left hand...I guess after a few more months of practice I'll be able to do it with my right as well but I'll have to quit my job first to make time.) 

Fidget spinners can also help with weight loss. Studies show that using a fidget spinner continuously for even as short a time as 17 hours a day can lead to a loss of up to 1 kg of fat per decade! With this kind of intense flow of power one can imagine a clean energy future where fidget spinners are connected directly to the electricity grid to replace fossil fuels, nuclear power and out of date solar generation. 

When you think about it a wind turbine is just a less efficient
and less reliable form of fidget spinner.

Note : You can also use the term "Kinetic Benzodiazepine" . This avoids any copyright issues.

Sunday, September 13, 2020

"Multiple definition" error when compiling with GCC 10 and above. Inetutils WITHOUT "--disable-servers"

In the spirit of the rare and unusual error messages that I occasionally post on this blog that no one but me will probably ever experience, this post is about the "multiple definition" error message that occurs when you try to compile inetutils 1.9.4 with GCC 10. This error will probably occur with a whole heap of other oldish software as well so even if you're not compiling "inetutils" but you are using GCC 10 or later, this might apply to you if you get the "multiple definition" error.

The error is of the form

/sources/inetutils-1.9.4/telnetd/state.c:69: multiple definition of `not42'; utility.o:/sources/inetutils-1.9.4/telnetd/utility.c:66: first defined here

and also

/sources/inetutils-1.9.4/ftpd/extern.h:93: multiple definition of `errcatch'; ftpcmd.o:/sources/inetutils-1.9.4/ftpd/extern.h:93: first defined here

The problem is that going from GCC 9 and below to GCC 10 and above the default GCC behavior changed. If multiple definitions of the same global variable are made without using the extern keyword, GCC 10 will generate an error message. GCC 9 and below would just treat all of these kinds of global variable definitions as the same variable and not complain. Specifically the default in GCC has changed from "-fcommon" to "-fno-common".

There's a neat explanation at

https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common


The following solutions work for inetutils. You only have to chose one of them. I used the first one.

1) Specify the "-fcommon" flag when using GCC to compile inetutils. In other words add "-fcommon" to the CFLAGS. I did this by appending 

CFLAGS="-O2 -g -fcommon" 

to the end of the "configure" command I was using during the compilation process.

2) You can specify the "--disable-servers" flag when you run "configure". This gets rid of the affected code and the compilation will succeed but it means that you won't have cool old school services like telnet, echo and discard.

3) Fix the code. You can fix the code by making small modifications to 3 files. These modifications add the "extern" keyword to some of the global variables that need fixing. See the following URL for a suggested patch

http://git.yoctoproject.org/cgit.cgi/poky/diff/meta/recipes-connectivity/inetutils/inetutils/0001-ftpd-telnetd-Fix-multiple-definitions-of-errcatch-an.patch?id2=0e09f045738259c49126a792cdf583f335bb29e8


The background here is that I was trying to work my way through "Linux From Scratch" (LFS) as seen at http://www.linuxfromscratch.org/ . LFS lets you go through the experience of creating and compiling the whole GNU/Linux system from bare bones source code. I got to the part where "inetutils" was being compiled and it failed as seen above. Inetutils gives you useful network tools like "ping" and "traceroute" so it's impossible to completely skip.

If you use the standard LFS configuration for inetutils then you won't run into any problems but I wasn't happy with the default. I noticed that the suggested configuration for inetutils in LFS was to include the configure option "--disable-servers". This means that inetutils would not include some of those useful old school services like "telnet" and "echo" which I still wanted to be available.

The documentation says that LFS excludes these services because they are insecure however I disagree. I think that if used properly, while keeping in mind that these services are indeed susceptible to packet sniffing, they're invaluable for basic network troubleshooting at a local network level. Obviously you're going to prefer to use something encrypted like SSH rather than unencrypted telnet when your packets are travelling over an untrusted network.

So when I didn't include "--disable-servers" as part of the configure step I got the compilation error message as seen above.

I'm sad that the maintainers of inetutils haven't updated it to reflect this change in the GCC 10 compiler, but given that the last release of inetutils was in 1995 (v1.9.4) I don't expect anyone cares too much. 

I hope this helps someone! I'd really love to know in the comments if anyone else has come across this problem while going through Linux From Scratch.

Friday, March 27, 2020

Tried OPNsense to replace old cisco router. Failed

I have been using a second hand Cisco 3800 series router running very old IOS software as my home gateway for the last few years. It's been very reliable and always performed extremely well. Apparently this model can switch almost 500,000 packets per second (with no other features configured) so it was always more than adequate for my needs.

Unfortunately it was very loud and took a lot of power to run, and since Cisco stopped providing updates for this model of router years ago I decided to look elsewhere for something a bit less bulky, a bit quieter, and a bit more modern.

It weighs as much as one of my children and it sounds like a jet engine
when you turn it on.
Naturally I wanted to be trendy and use an open source product! I wanted the power of being able to customize and control what my router was doing and not have to worry about my router secretly sending "troubleshooting data" (wink wink) back to the manufacturer.

Although I'm not a complete amateur when it comes to this sort of thing (I use OpenWRT on my access points and most of the little devices in my house run some kind of pre-hacked linux) I didn't want to build something from the ground up. I wanted some kind of "integrated" system that let me get things up and running and go from there.

I considered a few alternatives including OpenWRT, DD-WRT, pfSense, ipFire and others. All of these have a nice web based gui and lots of useful "add ons" and "plugins" that allow you to perform a great deal of customization.

I eventually settled on OPNSense which is based on the FreeBSD operating system.

I've never had much to do with the FreeBSD operating system before so I was a little hesitant, but after hearing about how strong and powerful the FreeBSD networking stack was meant to be, I decided to go with it. I was particularly convinced by a smart looking guy called George Neville-Neil who mentioned that the FreeBSD networking stack is what's being used by the Mars Pathfinder mission to communicate with Earth!!

George has written textbooks, spoken at conferences, has a cool beard and his
code is on a space ship....he's everything I want to be. 

Now for the exciting part of the post. The bit where things went wrong and I tell you why I failed. There are two reasons why OPNsense didn't work for me.

1) OPNSense is nothing like Cisco IOS

When I say this I don't mean "The commands weren't the same" (which is true). I mean that Cisco IOS is a truly integrated routing system where each part of the router software knows about all the other parts whereas OPNSense is nothing like that. In addition the commands and tools on a Cisco router generally follow a consistent style and pattern whereas each plugin in OPNsense is a kingdom unto itself.

OPNSense is essentially a shell that fits atop dozens of different programs that don't natively know anything about each other and were probably not written with many of the other programs in mind. This applies equally to other open source style routing systems like OpenWRT and pfSense. DD-WRT seems to be better integrated than its cousins, but consequently it has far less functionality and ability for customization.

In most cases this is fine because if you run a standard combination of services, then they'll have been tested adequately with each other and the OPNSense system can successfully integrate their functionalities together. However, if you stray off the beaten path a little, then that's when you run into trouble.

For example, in my network I need to route multicast traffic. It took me over a week to get it working with OPNsense and this is why. In some circumstances the OPNsense firewall component (pf) is programmed to transmit routed multicast traffic with an INCORRECT DESTINATION MAC ADDRESS WHICH MAKES IT ABSOLUTELY BLOODY USELESS (See OPNsense issue 3629). It seems like the maintainers of this part of the code has absolutely no plans to fix this issue.

This picture isn't here for any reason. I love
everybody and I am at peace with the universe.
I suspect that it isn't being fixed because multicast routing is quite rare in home networks and isn't necessarily super common in enterprise networks either so why would the maintainers spend time fixing this problem?

I came across about a dozen other feature interaction issues like this one. Most of them were trivial but a few were very tedious to overcome indeed.

Now I'm not saying that products made by big proprietary network vendors don't have problems, especially when weird combinations of features are used but I can guarantee that if something like multicast routing wasn't working then it would be fixed very very quickly.


I actually know a guy who worked for the now defunct Bay Networks router company.
You wouldn't believe some of the bugs he found!
2) FreeBSD is the OS/2 of the modern open source world

Are you old enough to remember OS/2? One of my professors introduced me to it back when Microsoft Windows was pretty much completely dominant in desktop computing.

It was great! It performed better and more reliably than Windows did, and it even ran (some) Windows applications! It's nowhere to be seen now.


If it's made by IBM then how can you go wrong?

The issue I had with it was that in those rare instances where I had a problem with OS/2, there was every possibility that I was the first and only human being on the planet to have experienced that particular issue because the user base of OS/2 wasn't what you'd call "vast".

And even though there were hundreds of brilliant people on forums and mailing lists who could probably help me, I was a "newb" and my requests for help weren't looked upon with much respect.

FreeBSD has kind of the same problem. Even though there are some very appealing aspects of FreeBSD, such as the package and ports system, and the extensive documentation of the base operating system, getting help isn't always easy. That seems to be because the user base is numerically much less than that of Linux, but also the FreeBSD user base all seem to be universally brilliant people who aren't always interested in helping "newbs".

These people aren't worthy to smell an experienced FreeBSD user's dirty socks!!
Now obviously there are also many arrogant people that maintain Linux features and core components as well, but since there are always plenty of new users being drawn in to the linuxverse, there's always someone out there willing to help, and likely many others who have had, or are having, the same problem as you!

Linus Torvalds, the creator of Linux, is widely acknowledged to be one of
the kindest 
and most patient men in the world.
What will I do?
To anyone who says I didn't give OPNsense enough of a chance, I actually ran it as my home's main gateway for a whole month as I tried to incrementally enable features I needed and troubleshot problems. I eventually had to give up after weeks of my OPNsense system's Ethernet interface randomly losing it's link about once every 36 hours.

I promise I did extensive troubleshooting. I replaced cables, moved switch ports and went through a large permutation of settings, driver updates and debugging but I could find no sign of why the problem was happening or what to do to fix it.

All of that being said, seeing how OPNsense works has given me some great insight into the tools that open source routing and firewall systems use. For that I am grateful.

I basically plan now to run a very basic linux system as my gateway (maybe on a Raspberry Pi?) but without a unifying Gui/web interface sitting above all the tools. I plan to just use the individual base programs like ipfw, dnsmasq and quagga and take control of the interactions between them myself.

Obviously this won't be as pretty as using a nicely integrated GUI but you have to admit, it will be very hardcore!


You know this guy edits his firewall config files with "vi" instead of "nano".
I will probably fail and go back to using my old hulk of a Cisco router, or buying a second hand TP-link router and installing OpenWRT on it, but I'm sure I'll learn a lot on the way. I think that's what my main goal is anyway.

Sunday, January 12, 2020

VirtualBox not passing 802.1q VLAN tags to or from guests with Broadcom NetXtreme 57xx Gigabit Ethernet on Windows 10 Host

I have a Dell Latitude E5500 laptop running Windows 10 Home Edition (Version 1909) which has a Broadcom NetXtreme 57xx Gigabit Controller Integrated Ethernet port (Driver version 214.0.0.0 by Microsoft)

I tried to setup a Linux Guest Virtual Machine (OpenWRT but I think this applies to all guests) using Oracle VirtualBox (Version 6.1) . I wanted my guest to access the real world network so I used the "Bridged Adapter" setting in the Network Properties of the guest and bridged the guest to my Broadcom Gigabit Ethernet Interface. Note that I changed the "Promiscuous Mode" setting from the default of "Deny" to "Allow All" in order to let my guest see a wider range of frames.

Guest Network Settings in VirtualBox

This worked fine for normal non tagged networking but when I wanted my guest to use 802.1q VLAN tagging, the tagged frames didn't seem to get to or from the guest's tagged interfaces.

Note that I did not have any kind of 802.1q VLAN tagging enabled on the host Windows device. I suppose another approach to this problem would have been to create separate VLAN tagged interfaces on the host and bridge them individually to the guest, but I honestly couldn't figure out how to do that. I think Windows 10 Home has some kind of in built impediment to using VLANs and 802.1q tagging.

To get 802.1q VLAN tags to pass to the guest I had to follow the instructions as seen in a few other sites that tackle a similar problem where the WireShark sniffer software running on Windows doesn't display VLAN tags when sniffing on this kind of network interface. For example

Wireshark VLAN Capture Setup
https://wiki.wireshark.org/CaptureSetup/VLAN

LiveAction - Don't Lose the Tags
https://mypeek.liveaction.com/tip.php?id=21

The instructions basically boil down to adding a special Windows Registry Key value as follows.

* Run the Windows Registry Editor regedit on the Windows 10 host. (Windows Key + R , then open regedit)

* In the Registry Editor search under the folder HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class for a value called TxCoalescingTicks . This will take you to the registry folder corresponding to your Broadcom GigE adapter where you need to perform the next steps. Note that we only want to find the folder that is under CurrentControlSet. Ignore folders that are NOT under CurrentControlSet. Also note that in some circumstances there might be more than one folder under the CurrentControlSet to have that TxCoalescingTicks value (multiple adapters installed?). Try to determine which one of them corresponds to your network card.

* The folder you've discovered should have a name along the lines of

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\00xx

where xx just means some hexadecimal number unique to your system.

*  Add a new String Value to the folder you'd discovered with name PreserveVlanInfoInRxPacket and set the value to 1. After adding this value to the folder it should look something like this

Newly created PreserveVlanInfoInRxPacket Value added to folder
After disabling and then re-enabling the host's Broadcom GigE network interface in Control Panel (which you could just do by rebooting the host) and stopping and restarting the guest in VirtualBox, I found that my guest was then able to receive and transmit tagged 802.1q frames as expected.

From what I can tell these instructions might also work with other types of Broadcom brand GigabitEthernet controllers being used on Windows 10 hosts. 

I guess based on the name of the PreserveVlanInfoInRxPacket value being added, the problem was that the Windows driver was removing 802.1q VLAN tags on frames to and from the guest. This meant that the guest was receiving everything on its native untagged VLAN, and when it transmitted a tagged frame it was being output as untagged on the host's physical GigE interface.

I also want to note that for my guest I had to change the default VirtualBox Guest Networking setting of Promiscuous Mode to All to get things working. This means that the guest is able to tell its virtual networking adapter to listen to all frames rather than just the ones directed to it. I don't know if that's required in all cases though.

Tuesday, March 13, 2018

My message of hope to the people of the world


Here is a message of hope and reconciliation to all the people of the world ....


Lettuce Leaf in Peas ... Let us live in peace

I thank you for your support and prayers as I dedicate my life to spreading this important message to all mankind.

Friday, December 1, 2017

Convert binary data files between Big Endian and Little Endian with xxd

Here is a nifty command line trick you can use to convert binary data files between big endian and little endian format. So for example if you are using 4 byte / 32 bit words, byte swapping 0x1a2b3c4d to 0x4d3c2b1a.

"input.bin" is your input binary file.
"temp.txt" is an intermediate file that you can delete later.
"output.bin" is the output binary with all the 4 byte / 32 bit words endian swapped.

xxd -e -g4 input.bin temp.txt
xxd -r temp.txt output.bin

or if you want to skip using the temporary text file...

xxd -e -g4 input.bin | xxd -r > output.bin



The xxd tool is used to make a hexdump or convert a hexdump back into binary.

The xxd tool normally comes as part of the "vim" application, so if xxd isn't available on your system you might need to install vim. Additionally I don't think this will work with the busybox version of xxd found on embedded system because as far as I can see it doesn't currently support all the required command line options. The standard linux / BSD / unix version of xxd should be fine.

Note that this procedure does not convert executables between big endian and little endian, only binary data.

For example. Say I have a binary file "test.bin" as follows
 
00000000  41 42 43 44 45 46 47 48  49 4a 4b 4c 4d 4e 4f 50

00000010  51 52 53 54 55 56 57 58  59 5a 30 31 32 33 34 35
00000020  36 37 38 39 61 62 63 64  65 66 67 68 69 6a 6b 0a

First use "xxd -e -g4" to convert the binary file to a hexdump text file. The "-e" option says to use Little Endian output format. Use this option regardless of whether you're converting from Big to Little or Little to Big Endian. The "-g4" option specifies to use 4 bytes (32 bits) per word. You can use a different word size option with "-g".

xxd -e -g4 test.bin temp-hexdump.txt

The contents of temp-hexdump.txt are as follows

#cat temp-hexdump.txt
00000000: 44434241 48474645 4c4b4a49 504f4e4d  ABCDEFGHIJKLMNOP
00000010: 54535251 58575655 31305a59 35343332  QRSTUVWXYZ012345
00000020: 39383736 64636261 68676665 0a6b6a69  6789abcdefghijk.


Note that the 4 byte hex values in the middle are presented in little endian format (i.e. reversed) so for the first word instead of "41 42 43 44" we have "44 43 42 41".

Finally we use "xxd -r" convert this hexdump back to binary format. Note that xxd -r only looks at the numerical hex data so if you want to edit your text file, just edit the hex numbers not the strings at the right.

xxd -r temp-hexdump.txt test-new-endian.bin

The contents of the output file test-new-endian.bin are endian swapped from the original as follows

00000000  44 43 42 41 48 47 46 45  4c 4b 4a 49 50 4f 4e 4d
00000010  54 53 52 51 58 57 56 55  31 30 5a 59 35 34 33 32
00000020  39 38 37 36 64 63 62 61  68 67 66 65 0a 6b 6a 69



Finally note that if your input binary file size isn't a multiple of the chosen word size, such as 32 bits / 4 bytes, then the last couple of bytes in the file will be discarded. One thing you could do is manually edit the temporary hexdump text file in the middle of the process add some zeros to the hex data at the end to make your data have a whole number of words before executing "xxd -r".

I used this method as a basis to convert an "md" memory dump from the u-boot boot loader utility from one endian into another on my debian linux system. Obviously there are ways you can programmatically do this with python scripts and so forth but I always prefer using existing command line tools if possible.
 

Sunday, March 12, 2017

Trance Techno - Sound of Goodbye by Armin van Buuren - About depression and suicide??

One of the many techno tunes that I love to listen to repeatedly is Armin van Buuren's catchy and hip "Sound of Goodbye".

This is a pretty good approximation of what I look like
at one of the many "raves", "techno soirees" and "trance shindigs"
I attend.

Here is a youtube link to the so called "Tribal Feel Edit" of the song which has a very "trancey" feel but there are other versions of "Sound of Goodbye" out there to suit everyone's taste in techno.

Her Majesty prefers the "Dubstep" style. 

In the clip the vocals are performed by the Dutch trance icon Elles de Graaf . You'll also see the quite fetching Ms de Graaf running half naked across an isolated green valley towards a lake where at the end of the clip she appears to drown herself.

You get to see her bottom just before she dies!!

The lyrics are as follows. I've numbered each of the lines. She doesn't actually sing the numbers they're just there for reference purposes later.

     1. Every face I see is cold as ice
     2. Everything I touch is pain
     3. Ever since I lost imagination
     4. Like a stream that flows into the sea
     5. I am lost for all eternity
     6. Ever since you took your love away from me

     (Repeat lines 7 & 8 till the end of the song......)
     7. Sometimes the sound of goodbye
     8. Is louder than any drumbeat


The first two lines of the lyrics tell us that this poor damsel can't stand human contact any more and that everything is giving her pain. I think this describes the experience of extreme unipolar clinical depression poetically and precisely. The social withdrawal, the feeling that no one loves or cares for you, and that the only emotions you can experience are negative ones.

The third line talks about "lost imagination" being the trigger for her misery. Could it be some important relationship that she thought she had with someone that turned out to be imaginary, like a love that ended up not being reciprocated, or a friendship that wasn't as strong as she thought. One other possibility is that she has lost her faith in God. The God that she once thought was real but was actually only "imagination".

Depression can often be triggered by some kind of heartbreak or painful emotional event. I think this is what has sent the lovely Elles into her spiral of unhappiness.

I'll be your friend Elles! Come and stay at my house!
My wife won't mind. She can take the kids and go and live 
with her parents for a few weeks.

Lines 4 and 5 talk about how she feels like water from a stream that gets lost in the sea. That is, she thinks that her life doesn't matter and in the grand scheme of things she is insignificant and means nothing. Again this is the typical thought pattern of someone who is severely depressed.

Line 6 talks about the trigger for her illness again. "Ever since you took your love away from me". Again, I think this implies a failed relationship or a lost faith. The experience of rejection by person or God is, I believe, one of the worst things that a sensitive maiden such as Juffrouw de Graaf can endure and is something that could definitely be the spark for the psychological inferno of major depression.

"Juffrouw" is Dutch for "Missus". Google told me.

Now on to the "chorus". Lines 7 and 8 say that the sound of goodbye, which I think clearly refers to the act of killing yourself, is "Louder than any drumbeat".

The meaning of "drumbeat" here is pretty ambiguous. My first guess is that it might be a metaphor for her heartbeat which is in turn a symbol for her being alive. If this is what it's saying then the chorus means that she thinks that her suicide is more significant and matters more (louder) than her life.

The other alternative revolves around the idea that beating drums were used as a form of communication in some ancient cultures. Is she saying that she's tried to communicate with others about her pain and distress but that no one has listened, but that by drowning herself she'll finally get others to pay attention?

Ancient cultures also used smoke signals to communicate but
everyone thought "drumbeat" sounded cooler.

After all that detailed analysis I think it's quite reasonable and safe to assume that this song is indeed about the thoughts and emotions of a depressed woman who is going to die by her own hand. 

At this point in the post I think I'm supposed to appeal to anyone with depression or thoughts about suicide to contact a doctor or psychiatrist or something. Especially if you're an attractive techno princess with the voice of an angel.

 Just take some Prozac and get some shock treatment and
you'll be fine.


Thursday, June 7, 2012

All other jokes are dwarfed in comparison.

I have made up one "joke" in my lifetime, and I thought I should put it here so that future generations can look back in amazement. And without further ado, here it is....


What did Snow White say when she dropped off her negatives at the photo store?

"Some day my prints will come!"

Oh...I get it! Prints...like Prince....ha ha ha ha. It's a shame I
don't know what a camera is.

Thank you ladies and gentlemen.


Sunday, October 16, 2011

Freemake Video Converter : Easy DVD to DVD, DVD to movie file, movie file to DVD etc etc etc tool

I found a fantastic and easy tool for copying copy protected DVDs to movie files for easy viewing on your PC or mobile gizmo. It's Freemake Video Converter. It's so simple to use and it has a number of great features.

* Copy protected DVD to DVD, AVI, Flash, MP4, MP3 (Audio) and others.
* All of the above video formats to each of the other ones.
* The ability to crop and join source video files for rudimentary video editing.
* Free!!


One tip is that when I converted a few DVDs to AVI and MP4 I used the XVid Video codec rather than the default H.264 codec. It was faster to convert the videos and the output video played a lot smoother. My short research indicates that while H.264 is superior in quality to XVid, it takes a whole lot more CPU power to generate and to play. Maybe my PC isn't beefy enough to play it because whenever I used H.264 the picture was quite jerky whereas it's smooth with XVid.

Tuesday, July 14, 2009

Fantastic Noodles

I'm trying to find the right combination of spices and beef stock to make the perfect Fantastic Noodles. I'm going to log all my attempts here.

1) 85g Beef Fantastic Noodles + 1 Massel Beef stock cube + Dried vegetable sachel + 4 small sakes of Masterfoods Powdered Cheyenne Pepper. Did not use included beef soup satchel. : Only a very mild beef flavor. Tastes a bit oilier than with the included beef flavoring sachel. Also might be a bit too spicy for my tastes. Tomorrow I'll try two Massel beef stock cubes.

Update : I didn't bother continuing with this experiment. I've gotten sick of noodles and I don't eat them any more. To be honest I don't know what I ever saw in them.

Wednesday, May 6, 2009

Recovered my mother's corrupt NTFS harddrive

I just wanted to make a note of the tools I used to recover my mother's Windows XP NTFS harddrive that had a corrupted partition table. I will list the tools I used in order that I invoked them and some brief notes about each. I'm not going to list all the details because there are other sites with extensive details on how to use these tools. Besides, your hard drive crash will be different to mine.

To summarise I replaced the old hard drive with a new one that was at least three times as big as the old one and installed windows on it. I then added the busted hard drive to my system by disconnecting the CD drive and moving the cabling from the CD player to the old drive. I booted with my USB key running a linux live CD and used the "gddrescue" tool to create a raw disk image of the busted hard disk and saved it on the new disk. From there I removed the busted disk, reconnected the CD drive then booted up windows and used the tools below to extract information from the disk image.

Now the details.

First piece of advice. As soon as you detect that your hard disk is broken STOP USING IT. You need to plan what you'll do to recover the data and then do that. Don't just go poking around because you might only get one chance to recover the data. That is, your corrupted hard disk now has a limited lifetime and you don't want to waste time running "dir" repeatedly in the vain hope that it will do something.

Second, you'll need to get a new working hard drive that is at least three times as big as the original. This is because you're going to create a disk image of the old drive, copy that disk image and then retrieve files off the disk image.

Third, don't put the drive in a freezer like some people suggest. It will just mean that the drive will get condensation on it and get further damaged. By all means keep it cool while running with a heat sink or fan but don't freeze it.

1) Trinity Rescue Linux Live CD or Knoppix : Make a bootable CD or USB key using trinity rescue linux to boot up a linux system that can be used to recover your busted NTFS hard disk. Knoppix is ok too but doens't natively contain gddrescue which is listed below. I used a USB key because in order to install the old hard disk in the system I disconnected the CD drive and moved all it's connectors over to the broken harddrive. (I don't have any spare cabling)

2) ddrescue / gddrescue : Not to be confused with "dd" or "dd_rescue" this is a linux tool that can be used to create a disk image. The idea here is you point the tool at your busted harddisk and save an image of the disk to the new working disk. The advantage of gddresuce / ddrescue over "dd" and "dd_rescue" is that gddrescue will quickly build a disk image out of the readable parts of your busted hard disk first and then it will grind over the non working bits to see what it can retrieve. After this make a copy of the disk image because we're going to muck around with it. If you mess up the copy then you can delete it and make another copy of the original. I found that copying this file in Windows was much quicker than in linux. Note that this part of the process can take hours and hours (Took about 12 hours for a 20G drive for me)

All the tools from this point can be run from Windows. Some also work in Linux too.

3) testdisk : Use this to potentially reconstruct the partition tables and NTFS MFT on the disk image you created with gddresuce. This didn't work in my case but it might work for you. Then you can mount the disk image and just copy your files out of it. (VDK does this for windows. In linux you can just use )

4) photorec : If testdisk couldn't get the disk image mountable then use photorec to try to find file signatures and pull files out of the image. When this tool works it pulls files out that have well known file formats (jpg, doc, pdf etc) but it isn't able to retrieve the proper file names or directories. Huge note : In photorec you have the option of only retrieving files of a certain type and ignoring useless stuff like .exe or .dll files. Don't do this! Let the tool retrieve everything. I tried limiting the tool to .jpg and .doc and it only got about 2% of my files back. By letting it retrieve everything it was somehow able to get a lot more .doc and .jpg files. I just deleted all the files I didn't want later.

5) PhotoRec sorter from Builtbackwards : This tool takes the files generated by photorec and puts them into directories based on file type. So one directory for jpg, another for doc, another for pdf etc. Doing this makes sorting through the thousands of files much more convinient and you can just delete directories with unuseful files (like .dll or .exe)

All the tools below have other equivalent software that perform the same functions. I just picked ones that were freeware and worked in Windows.

6) Anti-Twin : This tool finds duplicate files and deletes or moves them. Photorec seems to generate a lot of duplicates. I imagine this is because the way it works is it looks at the raw contents of the disk and pulls files out. I guess the windows operating system must sometimes end up storing multiple copies of the same file in different places. You probably aren't interested in duplicates so use this tool to find and get rid of duplicates. I found that about 20% of the files retrieved by photorec were duplicates.

7) Mihov EXIF renamer : This took takes EXIF information embedded inside a jpeg created by a camera and tries to rename the jpg file accordingly. Generally this means naming it with the date and time it was taken. One major drawback of this tool is that it creates a copy of the files it renames instead of just renaming them. This is tedious because if you have files with and without EXIF information there's no easy way of telling which ones were succesfully copied and which ones were not. Maybe there's a better tool out there.


So now I'm going to present my mother's recovered files on Mother's day. I think she'll be very happy.

Update : I found a better EXIF based renamer called Namexif 1.5. It renames files with EXIF data and leaves the others alone which is perfect for what I want.

In addition I found that with photorec another problem I was having was that I was selecting the wrong "Partition Table Type". The program automatically selected "NONE" but I was using "Intel". I think it's best to use whatever the program automatically selects. Same goes for testdisk.

Friday, November 14, 2008

Get rid of Virtumonde spyware. Use http://safety.live.com

Recently, I have no idea how, my windows xp system became infected with a spyware program called Virtumonde. The distinguishing characteristic is that ads pop up in your browser every few minutes. If you search on "spyware" then you'll be greeted with a popup that says...

ATTENTION! If your computer is struck by the spyware, you could suffer data loss, erratic PC behaviour, PC freezes and creahes.

Detect and remove viruses before they damage your computer!

Antivirus 2009 will perform a 100% FREE and quick scan of your computer for Viruses, Spyware and Adware.

Do you want to install Antivirus 2009 to scan your computer for malware now? (Recommended)
My computer runs McAffe Virusscan and is updated every single day with the latest virus definitions and it didn't detect it. I also tried Lavasoft AwAdware and it didn't detect it.

I found an awesome tool called Spybot and while it detected the infection and correctly identified it as Virtumonde, it couldn't remove it.

The tool that fixed the problem was a free web based scanner tool by Microsoft called

http://safety.live.com

Just click on the button that says "Full Service Scan", follow the prompts and wait for about 2 hours, then reboot and the problem will be fixed!

Others have reported that they have to run Spybot first and then the tool at safety.live.com but just running safety.live.com worked for me.

Update : You have to run the tool from Internet Explorer. It won't work with Firefox.

Saturday, September 27, 2008

Sansa Clip can play audio fast or slow if it's a "podcast"


The Sansa Clip with the latest firmware (1.01.29) has the ability to play audio files either slightly slowed down (good for classical music) or slightly sped up (good for techno).

Unfortunately you need to load the files onto the Clip as Podcasts. That is, place the files under the "PODCASTS" directory instead of the "MUSIC" directory.

The way to access the feature is to start playing your file (remember it's under "Podcasts" now) and then hit the "down" button. You'll see an option called "Speed" where you can select "Slow", "Normal" or "Fast".

I wish the Sansa Clip had this option for normal music files but they don't so I end up putting all my music in the Podcasts folder.

A thread on this very topic over at the Sansa Clip forums has users asking for this feature to also be introduced for music as well as podcasts however it seems Sandisk have just said "put the music in the Podcast folder." Oh well.

Friday, September 12, 2008

Ogg works on Sansa Clip but not below q6

After wasting hours trying to figure out why my Sansa Clip wouldn't read ogg comments/tag properly (see previous post) I now find that it doesn't play oggs with a quality setting less than 6!

See discussion at http://forums.sandisk.com/sansa/board/message?board.id=clip&message.id=9380

I encoded one of my favorite tunes using quality 3 setting (~112kbps). It plays absolutely crystal clear on my PC but it pops and clicks on the Sansa Clip. Ugh.

I'm not one of these audio nuts with $1000 headphones. I honestly can't tell the difference between CD quality and properly encoded 64k.

So stuff open source and freedom. I'm now using the clearly superior Microsoft WMA format. It's awesome!!

To me, the lowest setting on WMA variable sounds fine. Granted it doesn't sound precisely the same as the original CD but if you listen to it in isolation you wouldn't know anything is wrong with it, and this way I can fit about 80 CDs on my 2G Clip.

Update : After sitting with my eyes shut and playing a track over and over I've finally come to the conclusion that the second lowest setting (50 - 95kbps) is indistinguishable from the best setting in WMA variable bit rate so I'll encode everything that way.

Wednesday, September 10, 2008

Sansa Clip doesn't read Ogg Vorbis Tags. Use Easytag 2.1

I bought a Sansa Clip MP3 player. Happily it plays Ogg Vorbis encoded music files as of firmware 1.01.29.

Unfortunately it has a bug where if the fieldnames of the Ogg Vorbis tags or comments are not in all capital letters, the player won't read them.

For example if you have in your ogg file

Title=Happy Birthday

The clip won't recognize it. It wants to see

TITLE=Happy Birthday

(Open up your ogg file in wordpad if you want to see the tags. They should be hanging around the top of the file. Don't edit them in wordpad though. It doesn't work!)

To fix this and convert the tag field names to uppercase use a utility called Easytag 2.1 available at http://easytag.sourceforge.net/ . This utility can edit comment fields in ogg vorbis files and fortunately by default writes the fieldnames in upper case! That is when you make any change to tags in an ogg file, Easytag will rewrite all the tag/comment fieldnames in uppercase even if you didn't edit that particular tag!

Here's what I did...

Run Easytag and have it locate your ogg files by selecting the directory above them all.

Select all the files in the middle part of the window.

Change one of the blank Tag fields that you don't care about. For example the "Encoded by" fieldis probably blank. Set it to say "x" or something. Now click on the little button to the right of the field. This will apply that setting to all the selected files.

Now remove the "x" and click on the little button to the right again.

Finally click on the Disk shaped icon to "Save Files". You'll be asked if you want to write the tag files. Obviously select yes.

Voila, all your tag fields are now in capitals and your Sansa Clip should be able to identify them properly.

Tuesday, October 16, 2007

If Rudd doesn't show up then Brown should take his place.

It seems that Kevin Rudd doesn't seem to be keen about debating John Howard this Sunday night.

Wormless PM may debate alone

If Kevin doesn't want to show then Bob Brown should go along.

It would suit everyone involved because both the Prime Minister and Bob Brown want to steal votes from Labor. There probably aren't many votes who would switch from Green to Liberal or vice versa so I think both Howard and Brown would realize that it's in their mutual interests to go after Labor.

But since absolutely no one reads this blog I fear my inspired idea will simply dissolve into the ether of the Internet.

Friday, July 27, 2007

Getting started is the hardest part of any task.

I had that phrase in my head all this evening.

It's true though. I always find that before I start something I always perceive it to be more difficult than it really is. It's like I have to invest "activation energy" to get a project going, but then it gets easier.

Tuesday, July 10, 2007

Peter Garrett is not a pot head so why not get tested?

Today Daniel Johns from Silverchair claimed that he had smoked marijuana with rock star turned Labour politician Peter Garrett and Bono from U2. Daniel later retracted the claims and called them a stupid joke.


"It was really one of the most surreal moments of my life," Johns said. "It was me and Natalie and Peter Garrett and Bono laying on Bono's bed smoking joints, listening to Young Modern demos."

There were calls for Peter Garrett to get tested for drug use.

Anti-drugs campaigner Tony Wood, whose daughter Anna died of an ecstasy overdose in 1995, said Mr Garrett could resolve the matter by proving the incident initially described by Johns had never taken place.

"The easiest way for him to fix this is to go out and have himself drug-tested today," he said.


Indeed getting tested would be the most obvious thing that Peter Garrett could do. I have no doubts that he'd have a clean result as well.

My gut feeling, and this is just speculation on my part, is that Garrett was prepared to have a test and publicise the results. However his leader Rudd, or one of his other Labor leash holders, has told him not to get tested because they're afraid that once one member of parliament gets tested, they'll all have to be tested!

I'd be willing to bet money that there are more than a few politicians in federal parliament who would test positive for illicit drug use. I'd also be pretty sure that most of them would be on the Labor side. I knew a few prominent Labor party people in my university days and while I never actually saw any of them use drugs, they always had what I thought to be a pretty "relaxed" attitude towards them.

Friday, July 6, 2007

IPv6

There was an interesting post on digg about IPv6. I shut my browser window so I'm not going to paste in the link.

IPv6 is the so called next version of the underlying protocol that the Internet runs on. The current version is IPv4.

IPv6 has all sorts of advantages, but the main one is IP address space.

The catch 22 with it is that if you migrate to IPv6 then you can't easily communicate with the exiting IPv4 internet without having a complicated and probably very slow protocol translation system.

It would be a bit like changing from speaking English to speaking Esperanto. Esperanto might be technically better, but everyone else speaks English! You'd have a lot of trouble doing business in the world if you refused to speak anything but Esperanto right?

I think that the only way people will move to IPv6 is if there's some act of government that mandates it, or if youtube and google stop their IPv4 service and moves entirely to IPv6.

Wednesday, July 4, 2007

Welcome!

Welcome to the official llllloooooo blog. I'm going to waste my time posting comments and thoughts that no one will ever read.