The official llllloooooo blog
Tuesday, March 13, 2018
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
"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
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
at one of the many "raves", "techno soirees" and "trance shindigs"
Thursday, June 7, 2012
|Oh...I get it! Prints...like Prince....ha ha ha ha. It's a shame I|
don't know what a camera is.
Sunday, October 16, 2011
* 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.
Tuesday, July 14, 2009
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
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
ATTENTION! If your computer is struck by the spyware, you could suffer data loss, erratic PC behaviour, PC freezes and creahes.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.
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)
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
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
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
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
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
The clip won't recognize it. It wants to see
(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
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
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
"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 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.