llllloooooo

The official llllloooooo blog

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.