000webhost

Web hosting

Saturday, August 18, 2012

Funky Firmware

I've been examining my home network. Part of this process has obviously involved examining firmware upgrade options for embedded routers such as OpenWRT, DD-WRT, and Tomato. I have a Linksys WRT-54GL lying around but due to the flash constraints (it runs with 4MB flash and 8MB RAM) I've also been investigating other options (including hardware mods) and alternative hardware for a reasonable (sub-100). The hardware mods (such as USB, SD, Serial, etc...) aren't all that difficult. The main thing to take into consideration though is that this is the Internet. Information will vary in quality, people have slightly different hardware, and of course the way people communicate isn't always clear. Nonetheless, an SD card mod is very much a viable (and easy if you are a semi-decent solderer) option if you need more space for software installation (though indications of a short aren't exactly easy to decipher in the logs though).

Log entry with bad soldering job for SD mod.

[INFO] mmc_hardware_init: initializing GPIOs
[INFO] mmc_card_init: the period of a 380KHz frequency lasts 524 CPU cycles
[INFO] mmc_card_init: powering card on. sending 80 CLK
[INFO] mmc_card_init: 80 CLK sent in 43663 CPU cycles
[INFO] mmc_card_init: resetting card (CMD0)
[FATAL] mmc_card_init: invalid response from card: ff found, waiting for 01
[INFO] mmc_card_init: the period of a 380KHz frequency lasts 524 CPU cycles
[INFO] mmc_card_init: powering card on. sending 80 CLK
[INFO] mmc_card_init: 80 CLK sent in 43275 CPU cycles
[INFO] mmc_card_init: resetting card (CMD0)
[FATAL] mmc_card_init: invalid response from card: ff found, waiting for 01
[ERROR] mmc_init: got an error calling mmc_card_init: 01
[ERROR] mmc_check_media: change detected but was not able to initialize new card: ffffffff

Log entry with good soldering job for SD mod.

[INFO] mmc_hardware_init: initializing GPIOs
[INFO] mmc_card_init: the period of a 380KHz frequency lasts 524 CPU cycles
[INFO] mmc_card_init: powering card on. sending 80 CLK
[INFO] mmc_card_init: 80 CLK sent in 43646 CPU cycles
[INFO] mmc_card_init: resetting card (CMD0)
[INFO] mmc_card_init: doing initialization loop
[INFO] mmc_card_init: card inited successfully in 354 tries (10920782 CPU cycles).
[INFO] mmc_init: MMC/SD Card ID:
01 50 41 53 30 31 36 42 45 8a 16 3f b4 00 59 1f [INFO] Manufacturer ID   : 01
[INFO] OEM/Application ID: PA
[INFO] Product name      : S016B
[INFO] Product revision  : 4.5
[INFO] Product SN        : 3a529fb1
[INFO] Product Date      : 2005-9
[INFO] mmc_card_config: size = 14560, hardsectsize = 512, sectors = 29120
[WARN] mmc_init: hd_sizes=14560, hd[0].nr_sects=29120
[INFO] mmc_card_init: set_blocklen (CMD16) succeeded !
Partition check:
 mmca: p1

http://beta.ivc.no/wiki/index.php/Adding_SD_card_to_WRT54GL
http://www.isnull.com.ar/2009/12/wrt54gl-v11-sd-card-mod-with-openwrt.html
http://wiki.openwrt.org/doc/howto/mmc_over_gpio
http://www.jbprojects.net/articles/wrt54gl_mods/#sw2
http://www.dd-wrt.com/wiki/index.php/Linksys_WRT54G-TM_SD/MMC_mod
http://programmingstuff.free.fr/files/openwrt/whiterussian/mmc/src/

Along the way, I obviously found some interesting information about the hardware as well. One thing which surprised me though was how little exploration (it seemed that way to me) was done of the onboard voltages though. Some of the extraneous circuits out just didn't seem to be required. On my board alone there seemed to be stable sources for 2 (LEDs), ~3 (JTAG/Serial), 1.8, 5, 15 (DC Jack) volts around various areas of the board (with some clever programming and/or wiring you may also be able to extract decent/stable voltages from the Ethernet ports as well).

Please note that there is a difference in signalling/voltage between the onboard JTAG and standard RS-232 serial ports though. Note also, that while the difficulty of the solder job to create onboard serial/JTAG ports is trivial the USB job is can be extremely difficult if not well thought out or if you don't have adequate equipment on hand.

http://www.dslreports.com/forum/r22654574-Undersized-Power-supplies-from-Linksys.
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=54242&postdays=0&postorder=asc&start=75
http://www.techrepublic.com/photos/cracking-open-the-linksys-wrt54g-wireless-router/62182
http://woodhousellc.com/?p=30
http://en.wikipedia.org/wiki/Ethernet_over_twisted_pair
http://www.mingtek.tw/pdf/B-17.pdf
http://www.powco.net/wrt/
http://www.jbprojects.net/articles/wrt54gl_mods/
https://forum.openwrt.org/viewtopic.php?id=9653
http://www.devttys0.com/2011/07/reverse-engineering-vxworks-firmware-wrt54gv8/
http://wikidevi.com/wiki/Atheros
http://www.wrtrouters.com/router/wrt54g/
http://en.wikipedia.org/wiki/Linksys_WRT54G_series
http://infodepot.wikia.com/wiki/Linksys_WRT54GL_v1.0
http://infodepot.wikia.com/wiki/Linksys_WRT54GL_v1.1
http://www.apcmedia.com/salestools/VAVR-5WKLPK_R1_EN.pdf
http://en.wikipedia.org/wiki/Serial_port
http://www.aggsoft.com/rs232-pinout-cable/pinout-and-signal.htm
http://forums.whirlpool.net.au/archive/1784403
http://www.instantfundas.com/2010/07/7-alternative-firmware-for-wireless.html
http://www.jbprojects.net/articles/wrt54gl_mods/
https://forum.openwrt.org/viewtopic.php?pid=5329
http://wiki.openwrt.org/doc/howto/mmc_over_gpio
https://forum.openwrt.org/viewtopic.php?id=9653&p=1
https://forum.openwrt.org/viewtopic.php?pid=47366
https://forum.openwrt.org/viewtopic.php?id=23308
http://en.wikipedia.org/wiki/Capacitor_plague
http://www.apogeekits.com/power_adapter_selection.htm
http://answers.yahoo.com/question/index?qid=20080823014024AADQZnk
http://en.wikipedia.org/wiki/Failure_modes_of_electronics
http://www.elexp.com/t_solder.htm
http://helpdeskgeek.com/windows-7/windows-7-hyperterminal/
http://www.evga.com/forums/tm.aspx?m=185066&mpage=1
http://electronics.stackexchange.com/questions/1409/best-methods-to-fix-broken-tracks
http://en.wikipedia.org/wiki/Voltage_spike
http://parashell.sourceforge.net/docs/parallel.txt
http://www.unixmen.com/unp-universel-file-extractor/

Note that if you end up using the Ritmo HL-340 USB to serial adapter you'll need the ch341 kernel module under Linux and the following driver for Windows 64 Bit (not included on the support CD that I received).


Bus 002 Device 004: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter

[130081.190436] usb 3-1: new full speed USB device number 2 using uhci_hcd
[130081.349157] usb 3-1: New USB device found, idVendor=1a86, idProduct=7523
[130081.349171] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[130081.349182] usb 3-1: Product: USB2.0-Ser!
[130081.467336] usbcore: registered new interface driver usbserial
[130081.467386] USB Serial support registered for generic
[130081.467474] usbcore: registered new interface driver usbserial_generic
[130081.467482] usbserial: USB Serial Driver core
[130081.480724] USB Serial support registered for ch341-uart
[130081.480788] ch341 3-1:1.0: ch341-uart converter detected
[130081.492731] usb 3-1: ch341-uart converter now attached to ttyUSB0
[130081.492825] usbcore: registered new interface driver ch341

I explored a number of options for a full router upgrade (but D-Link/Netcomm/NetGear were prime options simply because I had credit at my local Officeworks store). Here are some of the options. Note, that most on-line reviews of D-Link hardware seem to indicate that these are terrible devices in their normal guise/firmware configuration (they also seem to have a history of releasing bad first versions but solid subsequent revisions (read Amazon reviews)) but with better firmware they can make extremely good, inexpensive pieces of hardware.

https://www.flashrouters.com/blog/2012/02/07/d-link-dir-632-dd-wrt-router-with-8-ethernet-ports-integrated-vpn-usb-port-featured-dd-wrt-flashrouter-of-the-day/
http://forum.pfsense.org/index.php?topic=47207.0
http://doc.pfsense.org/index.php/HOWTO_Install_pfSense
http://www.dd-wrt.com/wiki/index.php/Known_incompatible_devices
http://www.dd-wrt.com/wiki/index.php/Supported_Devices
http://www.dd-wrt.com/wiki/index.php/JFFS_File_System
http://www.dd-wrt.com/wiki/index.php/D-Link_DIR-632
http://www.dd-wrt.com/wiki/index.php/D-Link_DIR-825

Moreover, depending on your router choice you may be able to gain 3G backup capability (via USB modem).

http://www.dd-wrt.com/wiki/index.php/Cellular_Phone/USB_Modem_as_WAN_connection
http://doc.pfsense.org/index.php/Configuring_3G_modems

Another choice of course is to simply turn a spare PC/laptop/netbook into a router and use a crossover cable to keep things going (laptop is obviously a decent choice since it basically has its own backup power system).

https://support.net.com/display/UXDOC1/Ethernet+Crossover+Cable
http://en.wikipedia.org/wiki/Ethernet_crossover_cable
http://www.jaycar.com.au/productView.asp?ID=YT6081
http://ubuntuguide.net/ubuntu-connect-to-internet-via-android-phone-as-usb-modem

3G setup is actually fairly easy (depending on the modem) under Linux (I've seen and heard of bad things when it comes to many OEM software driver setups).
usb_modeswitch -v [Vendor ID] -p [Product ID] -R
nm-connection-editor (or some other network configuration utility).

Watch for some wierdness though. I had one system not being able to automatically pickup DNS setting from the ISP. I had to manually insert a rule.

https://bugzilla.redhat.com/show_bug.cgi?id=467004
http://forums.whirlpool.net.au/archive/1544486

While we're on the topic of firmware there does seem to be Open Source firmware projects for well known SSD's out there.

http://www.openssd-project.org/wiki/The_OpenSSD_Project

As you can see though, SSD reliability is still very much up in the air (across ALL manufacturers) though (keep backups, do your research, and so on.).

http://www.xtremesystems.org/forums/showthread.php?271063-SSD-Write-Endurance-25nm-Vs-34nm

- as usual thanks to all of the individuals and groups who purchase and use my goods and services
http://sites.google.com/site/dtbnguyen/
http://dtbnguyen.blogspot.com.au/

Cleanup Operations

If you haven't already figured out already I often repair/investigate devices (for myself as well as on behalf of others) in my spare time. I was recently given an Acer Aspire One 531h, a Acer Aspire 1671 as well as a laptop that was running Vista in a foreign language. Let's start with the easy stuff. Language packs are easily handled via the following. Please note that while this may handle most dialogue within the operating system itself it doesn't deal with installed programs such as utilities, security, and other software.

http://www.froggie.sk/download.html
http://support.microsoft.com/kb/946928
http://www.mydigitallife.info/windows-vista-mui-language-packs-for-x86-and-x64-direct-download-link/
http://windows.microsoft.com/en-us/windows-vista/Change-the-display-language
http://windows.microsoft.com/en-US/windows-vista/Install-a-display-language

The Aspire One and 1671 were much more difficult propositions. It was clear that they had previously been opened and were mis-diagnosed or had strange fixes applied to them. The 1671 was shutting down a few seconds after boot or would only boot when the battery had been charged for a little while. While opening it up:
- plastic pieces fell off after they had previously been broken and were inadequately put back (super/expoxy glue can work but is harder to use when dealing with thin plastics)
- there was glue where it shouldn't have been (super glue debonder helps here)
- the CPU wasn't locked down properly (there's a screw/lever mechanism for locking it in place normaly)
- it was clear that several screws were misplaced
- there were globs of heatsink compound everywhere, and so on...
It's clear that the previous person thought that the problem was entirely down to heat. By running a multimeter over the terminals of the DC jack it was clear that this wasn't the case though. The inner pin of the DC jack was losing contact with the mainboard which meant that only a trickle of charge was reaching the system with the result being unable to start the system or only being able to start it with an adequately charged battery (Unsurprisingly, it also had other issues such as a pirated version of Windows). On top of this, the trackpad seemed to be disabled by defaut after software re-installation?

http://www.daniweb.com/hardware-and-software/pc-hardware/usb-devices-and-other-peripherals/threads/25588/synaptics-touchpad-suddenly-stopped-working

Like the 1671, the One had many problems (the primary issue was the that no charge was reaching the system though):
- there was a break in the cable on the old AC adapter when you bent it. It also seemed to be a poorly made replacement (Lite-On branded but reviews seem to be poor on Amazon with similar problems reported, http://www.daniweb.com/hardware-and-software/pc-hardware/usb-devices-and-other-peripherals/threads/25588/synaptics-touchpad-suddenly-stopped-working) with the plug being slightly too large for the socket. Jigglng the plug made it work but it also exacerbated the problem with the DC jack. You were basically covering one problem with another and dismounting the pin in the DC jack (you can choose to either re-solder or replace)
- cable between mainboard and front LED lights had worn out contacts ('mended' by trimming a bit off the tip)
- there was a break in the connection between the internal wireless card and the attenna (re-soldered)
- the centre point on the DC jack was not connected properly to the mainboard (re-soldered)
- there was a break in the plastic on the right side panel (glue)
- numerous screws were misplaced (guess-timation)
- two charging pins to the battery were mis-aligned (bent back to shape)
- there was a massive break in an internal cable between the power switch and the mainboard (Alternatively, you can turn it on by shorting pins 2/3 of the relevant connector on the mainboard). After seeing the cost of the cable online and comparing it with the cost of device itself I half thought about (drilling holes or just swapping the switch for another existing port such as USB, Ethernet, etc... I've done it with phones before though but have 'sculpted' the switch rather than the case most of the time) using a small microswitch but obviously the solution wouldn't be elegant, light on power button wouldn't be perfect, etc...

http://www.laptoprepair101.com/laptop/2007/12/06/dc-power-jack-repair-guide/
http://www.ehow.com/facts_7611392_problems-laptop-dc-jacks.html
http://www.technibble.com/forums/showthread.php?t=37678
http://www.therailwire.net/forum/index.php?topic=26454.0
http://www.cdsparts.com/p-3212-new-acer-aspire-one-531h-ao531h-zg8-power-board-cable-50s6507003.aspx
http://www.cdsparts.com/p-3452-new-acer-aspire-one-531h-netbook-power-board-da0zg8pb6e0.aspx
http://acer--uk.custhelp.com/app/answers/detail/a_id/3009/~/hotkeys-and-key-combinations-on-aspire-one-netbooks

http://support.acer-euro.com/drivers/

- as usual thanks to all of the individuals and groups who purchase and use my goods and services
http://sites.google.com/site/dtbnguyen/
http://dtbnguyen.blogspot.com.au/

Monday, August 6, 2012

Space Saving

I've been running out of hard drive space. While I've upgraded I've also done a little bit of 'cleaning up' as well. Little did I know just how difficult this would be. With the recent increase in hard drive prices (due primarily to the Thailand floods) I (and others) have been looking at unusual sources. One of these has been purchasing portable hard drive expansion packs (hard drive and enclosures) that are on sale and removing the internal hard drive which often ends up being cheaper than purchasing the drive alone. Sounds simple, right? Not quite.

I tend to do some background on product purchases. In the past, this has held me in relatively good stead but with the advent of online marketing and reviews it seems as though everything has balanced out. Almost every single brand seems to have 'problems' and unless something is truly worthy it is unlikely to have a clean bill of health. In fact, a random sample of Amazon (and HDSentinel) reviews seemed to indicate that anywhere between 10-25% on average are dissatisfied with their purchase of electronic goods (anything from flash memory, hard drive, routers, to wireless network cards).

http://www.behardware.com/articles/862-7/components-returns-rates-6.html
http://www.hdsentinel.com/knowledgebase.php

On top of this an increasing number of companies are locking down their hardware/software which means that modification can be difficult if not impossible. Obviously, there are issues relating to consistency, security, and so on. While some compromises I understand, other's I'm not so certain about. For instance, Clickfree actually have a microchip in their enclosures (warranty void if removed) which holds the key to being able to use the internal drive as a normal drive or as a 'Clickfree' drive. Toshiba have been attempting to draw more power than standard from USB ports for their external enclosures than standard. Seagate have been (depends on the age of the enclosure) using slightly larger than normal (12.5mm as opposed to 9.5mm height drives) in their enclosures which means you can't use them as a replacement for your internal hard drive. Western Digital have even altered their circuit boards so that instead of a generic SATA out interface that leads to a USB controller/interface card which then leads to your PC the circuit board is direct to USB (I never would have believed this had I now seen the pictures on HDDGuru). I've even seen accounts of HP using non-generic PCB's which basically encrypt the contents of your drive which mean that while your data is safe if it is removed from the drive in the advent of a failure it's difficult/impossble to recover your data without skilled aide. Firmware flashing of the requisite chip seems to be the only way around this without using a different enclosure.

http://www.phonenews.com/toshiba-acknowledges-macbook-woes-canvio-usb-3-0-hard-drives-18699/
http://forum.hddguru.com/disk-with-sata-usb-adapter-remove-virtual-rom-t18492.html
http://windowssecrets.com/forums/showthread.php/125707-How-to-delete-a-CDFS-partition-on-a-hard-drive
http://forum.hddguru.com/disk-with-sata-usb-adapter-remove-virtual-rom-t18492-60.html
http://www.ted.com/
http://www.station-drivers.com/page/jmicron.htm
http://hddguru.com/software/2005.10.02-MHDD/
http://forum.hddguru.com/wd5000bmvv-connector-t16203.html

Moreover, many firms are developing tamper proof enclosures that mean that opening them up is extremely difficult without causing damage to the enclosure themselves. The general consensus seems to be a combination of higher local ambient temperature and careful prying using thing pieces of plastic/metal is the best way.

http://forums.seagate.com/t5/Other-External-products/Would-the-hard-drive-inside-a-640GB-Expansion-Portable-fit/m-p/50297
http://hardwarespot.net/computer-hardware/how-to-open-a-toshiba-portable-hard-drive-without-case-damage

While I've previously used SyncToy and other tools to run backups and syncronise drive contents I recently came across Syncback. Overall, it's just like many other backup tools. The thing I like about it is that it creates it's own backup logs (HTML format) instead of me having to create them.

http://www.2brightsparks.com/syncback/index.html

Transcoding of media files seems like an extremely simple affair and I thought that many applications would be able to handle audio syncronisation issues easily by now but that's not the case. Whether I'm using CLI (ffmpeg) or GUI (HandBrake, FormatFactory, MediaCoder, Avidemux, etc...) based tools there doesn't seem a single tool that can transcode (at an acceptable level of quality) without extra input from the end user while maintaining sync without causing abberations in the transcoded file. The simplest option seems to be a mass transcode via MediaCoder/ffmpeg and then using the MediaInfo/Avidemux/VLC in order to re-sync/edit the transcoded file back to normal. This of course, raises other concerns.

ffmpeg -i out.ogg -itsoffset 4.267 -i out.ogg -map 1:0 -map 0:1 -ar 22050 video.flv

http://www.avsforum.com/t/1098651/converting-video-files-keeping-audio-in-sync
http://www.kkoncepts.net/node/69
http://howto-pages.org/ffmpeg/
http://support.microsoft.com/kb/316992
http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html

In my case, temperatures were exceeding acceptable limits/normal parameters which meants that it would automatically trigger system shutdown. Obviously, I've worked with CPU throttling applications (I even built one) previously though so using a combination of ThrottleStop, Open Hardware Monitor, and Process Lasso I've been able to slow things and maintain a more sustainable thermal environment.
http://www.techinferno.com/downloads/
http://forum.mediacoderhq.com/viewtopic.php?t=3381
http://forum.mediacoderhq.com/viewtopic.php?f=17&t=6383
http://forums.whirlpool.net.au/archive/1141751
http://www.avidemux.org/smf/index.php?topic=10793.0
http://forum.notebookreview.com/gaming-software-graphics-cards/674100-throttlestop-expiry.html
http://www.cpuid.com/
http://www.techinferno.com/downloads/?did=41
http://openhardwaremonitor.org/
http://www.techpowerup.com/realtemp/

If you've ever used a particular brand from Jaycar you'll notice that they have some quality control issues. Recently, I once purchased a mini microSD card reader but after noticing read errors from the device I returned it for another. I noticed the same thing again but this time decided to take a closer look. Apparently, they may have a dry solder problem with what appears to be an onboard crystal oscillator.

http://en.wikipedia.org/wiki/Crystal_oscillator

I also noticed similar read issues with another product (a USB to IDE/SATA convertor) from this particular brand. As soon as it hit the 1GB file mark of a certain file copy (this only seemed to occur on one particular file transfer) it seemed to silently fail (under Windows). There are accounts of the core chip not dealing with errors correctly (under reporting information during failure) and also incorrect/un-optimal implementations. I may explore this further if I have time but I'm still working on my 'Cloud and Internet Security' report.

http://www.jmicron.com/JM20337.html
http://bigacid.wordpress.com/2008/12/08/jm20337-read-data-corruption-solution/
http://forums.seagate.com/t5/Barracuda-XT-Barracuda-Barracuda/Silent-write-failures-with-500G-SATA-in-JM20337-USB-enclosure/td-p/60970
http://answers.softpicks.net/answers/topic/reading-errors-on-JMicron-JM20337-USB-SATA-1894164-1.htm
http://www.gossamer-threads.com/lists/linux/kernel/953952
http://blog.gmane.org/gmane.linux.usb.general/page=61

- as usual thanks to all of the individuals and groups who purchase and use my goods and services
http://sites.google.com/site/dtbnguyen/
http://dtbnguyen.blogspot.com.au/

Wednesday, August 1, 2012

If Only Reading Were Easier, eBook Firmware Modifications, and More

I recently came into possession of a MiGear eBook Reader. It's not the best eBook device in the world but I got it for a price that was hard to refuse. One of the things I've discovered is that while it makes a great video/photo viewer and music playback device it's actual eBook reading capabilities needed a bit of work (the zoom function doesn't work particularly well in the default firmware which means that a lot of scrolling needs to be done because the fonts are too large or the words are too small because the there neds to be greater magnification).

Like others I've been exploring the full capabilities of the device and looking at modifying/changing the firmware to fully exploit it. The device itself is based on the Rockchip RK2738 which is often used in MP3/MP4 music devices with the rest of the device relying on inexpensive and readily available PC electronics. It is also used in many eBook readers as well which means that as long as the reader is based on the same chip you can chop and change as you like. Moreover, while it is possible for you to end up with an (inexpensive in this case) paperweight there are existing provisions to activate a recovery mode of sorts by shorting pins 29/30 on the flash chip (Based on what I've read and done it seems to be very hard to 'brick'. The product itself seems to be hobbled by the firmware than the hardware.).
http://www.rock-chips.com/index.php?lang=en

http://www.2shared.com/file/kwyAnRpZ/Ebook-2738img.html
http://mympx.org/Downloads
http://forums.whirlpool.net.au/archive/1537766
http://www.migear.biz/Downloads/MiGear_BSTE102_eBook_Upgrade_Tool_v1.rar
http://mympx.org/forum/firmware/45967-rk2738-4.html
http://www.gear2go.biz/categories/Software-upgrades/

Moreover, while you may end up with the wrong language they (the various firmware revisions) all seem to be based on the same core which means that even if you end up seeing strange characters you can almost always set it back to any arbitrary language. The irony though is that while there is a firmware update utility you need to tweak it (Hardware IDs which can be obtained from 'lsusb' under Linux and 'Device Manager' in Windows) in order to get things right.

http://www.ozbargain.com.au/node/70439

There's clearly no 'perfect firmware' out there at the moment though. I've ended up using firmware from another Chinese clone which oddly enough had better hardware (more RAM, Flash memory, FM radio, TV-out, and also a larger battery) than my device. This led to be explore the actual data sheets, various PCBs, and SDKs for this chip. Most of the time the data sheets indicated that only minor modifications/additions needed to be made to add these capabilities (I actually thought about adding more flash memory from a USB flash drive after discovering the physical size of the chips on the board and in my flash drive were identical. Try to format the flash using NTFS and not FAT16/FAT32 as it will be more resistant against potential filesystem corruption. You'll know why if you've compared these filesystems on USB flash drives previously and have not ejected properly.). While there doesn't seem to be support for Android/Linux, Lexand seemed to have released a device that uses Android/Linux and is also based on the RK2738 (here's hoping someone uploads the firmware).

http://gnn-components.com/Fuzhou_Rockchip_Electronics_Co___Ltd_-22-488.aspx
http://ananda.en.alibaba.com/product/494388542-0/7inch_Rockchip_2738_ebook_reader.html
http://tablet-news.com/2012/07/05/lexand-lt-127-and-lt-227-color-e-readers-officially-announced/
http://mympx.org/forum/general-discussion/44608-rockchip-sdk-working-links.html
http://www.mp4nation.net/forum/f27/rockchip-programming-14769/
http://www.podchasov.ru/rk27/
http://mympx.org/forum/firmware/45967-rk2738-2.html
http://mympx.org/forum/general-discussion/43348-hooray-rockchip-sdk.html
http://wiki.mobileread.com/wiki/Skytex_Primer
thttp://mympx.org/forum/general-discussion/43348-hooray-rockchip-sdk-28.html
http://www.androidtablets.net/forum/rockchip-based/439-how-unpack-repack-custom-firmwares-rockchip-rk28xx.html
http://wiki.archosfans.com/index.php?title=Dump_your_Home_Tablet_rom_and_create_a_custom_rom&action=edit&oldid=141291
http://forum.archosfans.com/viewtopic.php?f=59&t=33946
http://www.slatedroid.com/
http://en.pudn.com/downloads135/sourcecode/embed/detail575860_en.html
http://www.mobileread.mobi/forums/showthread.php?t=111836&page=3 
http://forum.archosfans.com/viewtopic.php?f=59&t=33946

While there are SDKs out there development doesn't seem to be simple especially for the 27xx series. A lot of information has needed to be reverse engineered (Rockchips don't seem to be interested in Open Source development at the moment based on what I've read.) and even then there seems to have been measures taken to reduce the chances of end user tampering. Files have clearly been 'packed' and possibly encrypted with 28xx/29xx series also having similar protection.

http://alemaxx.al.funpic.de/rk27/rkwfwpatch.html
Even viewing hidden partitions/backing up the actual firmware itself was a seeming mystery with many people just guessing at what the magical filename should be to make the partitions magically appear (I used the following command sequence to figure this out, 'strings RK2738.img | grep -i tag > tags'. Mine was 'HTC_E01.Tag' though this will obviously depend on you having a copy of the image in the first place.).

Moreover, unlike the 26xx series you can't just modify files on the hidden partitions itself. You need to unpack the image, modify the files, repack it and write the firmware to make the changes 'stick',

mkdir /media/ebook
mount -o loop BSTE102.img /media/ebook/
umount /media/ebook/

else you'll need to use something like WinRAR or WinImage under Windows.

With the firmware being relatively tedious or difficult to modify I wonder whether something like Rockbox/OpenInkpot are more viable options given time and your desired use for your device...

- as usual thanks to all of the individuals and groups who purchase and use my goods and services
http://sites.google.com/site/dtbnguyen/
http://dtbnguyen.blogspot.com.au/

Tuesday, July 24, 2012

The Hard Drive Resurrection!

My first hard drive 'incident' occurred years ago when a friend moved a hard drive of mine while it was still working. The result was 'smoky' and resulted in a drive that would not spin up and a fried controller board. Switching boards for data recovery was simple though as the drive was of desktop size and the model fairly common. 

Since then I've sufferred all sorts of drive failures from virtually all drive manufacturers. While I haven't lost much data (I backup regularly) it has been annoying and I've learnt about hard drive technology along the way. Last year I had another drive failure. This time it was a laptop sized drive with a supposedly 'seized spindle'. I tried 'freezing it' in a sealed container and it seemed to spin up long enough for me to recover the data but after one power up that was basically all the activity that I ever saw again from this particular drive. Since I recovered the data I didn't bother with further experimentation. Recently though, some other work in data recovery brought this drive back into my mind. I opened up the drive and was reminded that even though hard drive technology has been around for decades it has definitely evolved/become more refined. Drive designs from a decade ago there were much more distinctive between drive manufacturers than now and there were sometimes aspects of drive design which could have easily been improved (such as shock absorption and chip placement). Over time, its become clearer that drives have become much more refined though and manufacturers have converged upon some similar design principles. When I opened this particular drive it was obvious how much thought was put into it; there were stickers to prevent improper screw placement (some screws could have protruded directly onto the underside of the drive platter if you weren't careful), contingencies were made to deal with the possible build up of internal condensation/contamination (packet of what appeared to be silica/cotton?), and even minor design changes to head parking areas to reduce the shock of drive movement to the extreme edges of the disc platter themselves.

Anyhow, it seems clear that there are several methods when dealing with seized spindles. One involves using a power drill, another blunt force, another involves a specialised tool to help re-align the platter/bearing bundle. I decided to use a stylus from my old Palm Vx. It seemed to work well and I was at least able to get my drive spinning relatively freely again. The next problem that I faced was head/servo movement. I checked my re-assembly several times and everything seemed to be in check. However, after careful examination I realised that a cable that led from the controller board to the head was deformed/broken which meant that power could not be sent to an electromagnet at the end of the head assembly which is ultimately used to control head alignment over the disc platters. After re-alignment head movement seemed to be back. While its clear what the problem is, I'm not sure how much further I can push this with my existing equipment. The connections/wires that need to be fixed are basically the size of pin heads. It will take a microscope and a bit of luck to be able to accurately re-connect the relevant connections.

Moreover, unlike previously where switching parts seemed to be quite simple I'm discovering that drive recovery nowadays is far more evolved than it used to be. While some parts are interchageable others aren't so easy. Based on some research it seems as though some drives may have begun to place part or all of the firmware on the actual drive itself which makes parts transfer not so simple. The firmware from the old drive needs to be extracted or procured from another location (can be trivial or extremely difficult depending on the situation/manufacturer as some publish tools/software to do precisely this while others rarely publish any supporting documentation/software at all).

I suspect the best/simplest method may be sourcing another drive for its head assembly (if you don't have specialised head removal tools you're best choice is turning the drive upside down and pushing it towards the back wall of the drive enclosure to remove it and enhance your chances of removing it without causing significant drive damage)(Obviously, you've discovered by now that you can often get by without having to resort to specialised tools a lot of the time. However, like general 'tradesman' it is far easier if you have them and you need to take extra care if you don't have them.). I'd like to know whether they alter drive heads based on drive density though? Clearly, when switching from single to multi-platter configurations this will be the case. How about switching from a single platter discs of different density though? Surely, efficiencies in mass production should mean that you use the same heads while altering only the platters, firmware, controller card, etc?

As an aside I've noticed a lot of good deals for SSDs of late. However, it's also clear that some of the drives on offer have a history of data loss as a result of dodgy controllers, firmware, etc... For the moment, I would do my homework before purchasing an SSD, hold off on the technology while it matures, and/or just use it for non-critical/read only purposes.

A word of note, if you're working with this type of equipment you should primarily be thinking about the most minimal way to get things going again rather than seeking the most elegant solution out there (at least initially). I recall working an phone that had sufferred from water damage. Everything seemed to be fine but the power switch needed to be replaced. While I managed to find a replacement from Jaycar I tried to get too cute with the repair and ended up damaging the replacement switch. Luckily, the switch was only 95 cents and the phone was relatively inexpensive.

http://en.wikipedia.org/wiki/Hard_disk_drive

http://www.overclockers.com/do-it-yourself-hard-disk-repair/
http://superuser.com/questions/44318/how-do-i-remove-a-mybooks-wd-smartware-virtual-cd-from-my-desktop
http://club.myce.com/f138/access-hard-drives-firmware-257428/#.UAoich-eVG0
http://freemyipod.org/wiki/Extracting_firmware

- as usual thanks to all of the individuals and groups who purchase and use my goods and services
http://sites.google.com/site/dtbnguyen/
http://dtbnguyen.blogspot.com.au/

The World is Full of Software Bugs

It seems as though bugs may have developed an attraction to me of late. I've discovered that 'pcmanfm' doesn't handle unmounting of drives completely cleanly and that you need to manually kill processes regularly sometimes. I've also discovered that Windows Media Player (with my configuration at least) only seems to work when the TV tuner is inserted on the original USB port that it was configured on (else it will indicate that there are no tuners currently available. Obviously, you can attempt to re-configure the tuner on another USB port but that's beside the point. This is strange behaviour.). MultibootUSB needs 32-bit of 7-Zip to be installed to be run (even if you have installed the 64-bit version on a 64-bit Windows system). Otherwise, you end up with a never ending series of errors. Tip, you need to kill MultibootUSB first before killing 7-Zip else it will keep on trying to re-spawn that process.


While the following is not a bug I find it 'annoying'. The versions of Acronis TrueImage distributed by Seagate/Western Digital are incompatible (retail and other version are fine). I've obviously tried various Open Source options in the past but none come near the performance/compression balance that currently exists in this product and several other proprietary options.

While searching for a new external hard drive I came across the following...

http://www.phonenews.com/toshiba-acknowledges-macbook-woes-canvio-usb-3-0-hard-drives-18699/
http://www.theregister.co.uk/2012/07/23/100w_usb_power_delivery_specification/

I was recently playing around with the idea (and the practice) of turning Android phones into servers. It was not without its difficulties though. On most mobile computing devices there are forms of so called speed stepping technologies to help increase battery life. It's obviously re-appeared on Android as well but not without some of the problems that plagued other platforms. I once recall using a power control utility application on my old Android phone which underclocked it to such an extent (1/3 of it's full capacity) that I couldn't answer phone calls because there weren't enough CPU cycles for user space applications (such as unlocking the phone itself so that I could take a call) while playing music. Admittedly, the hardware specifications were minimal (it was an extremely early and inexpensive Android phone) but I would have thought a bit more thought would have gone into it prior to deployment (I 'accepted' the 'default settings' believing that that would have been adequate).

I obviously tried SSHDroid but like others I came across what were seemingly stability problems. Upon further examination though I found a lot about wireless and power control technologies. I think a lot of the problems that I was experiencing were as a consequence of power saving software (the above will likely make more sense to you now) which may have led to SSHDroid shutting down randomly and regularly. However, in my research I also came across a file transfer application called SwiFTP. In it, was option to shutdown most power saving behaviour. By enabling this, I've seen been able to achieve relatively stable connections (hours at a time).


You can lock up (somewhat) your Android phone by using firewall such as DroidWall.


Strongly suggest you have reliable equipment if you do ANY wireless experimentation. Obviously firmware changes can have significant impacts upon devices. One thing I underestimated though was how much of an impact 'raw power' played on connection stability. In the past (and recently) I was playing around with the idea of deliberately changing architecture to maintain wireless security (as opposed to relying on pure 'Faraday Cages' and other anti-TEMPEST techniques). By using the concepts of absorption, superposition, and reflection we can manipulate wireless signal pathways (very similar to some of the techniques that are used to develop low visibility/stealth aircraft). The results of these experiments indicate that putting this theory into practice will be less trivial than I had originally anticipated though (the intensity of a signal is conversely proportional to the inverse square of the distance between the source and destination if I recall my physics correctly).

Tuesday, July 3, 2012

iPod Nano Device Sanitisation

Continuing my work on my, "Cloud and Internet Security" report. I'll revise my earlier estimate and say that its likely to be 500+ pages though the scope will depend on other factors. One of the issues that I wanted to explore was mobile device backup and sanitisation. In particular my iPod Nano. It sounds easy but if you haven't got a recent backup,  you're aware of how strongly iTunes and iPod devices are integrated, and have taken a look at the file directory structure of an iPod you'll realise just how awkward this can be.

Actual music files are stored on the device in the following format:
/media/sdd1/iPod_Control/Music/F[:number:]{2}/[:alpha:]{4}.mp3

The command, "file ZRJR.mp3" yields the following:
ZRJR.mp3: Audio file with ID3 version 2.2.0, contains: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo


knoppix@system:~/iPod_Control/iTunes/iTunes Library.itlp$ file *
Dynamic.itdb:       SQLite 3.x database
Extras.itdb:        SQLite 3.x database
Genius.itdb:        SQLite 3.x database, user version 2
Library.itdb:       SQLite 3.x database, user version 23
Locations.itdb:     SQLite 3.x database
Locations.itdb.cbk: data

http://www.macworld.com/article/1139974/itunes_files.html

Plugging the device in under Linux and mounting as as a USB mass storage device works but so does iPod/iPhone Explorer under Windows as well (though they have some quirks that need to be fixed (I picked up some unhandled exception during my experimentation)). They remind me a lot of Explore2FS which we had to use in the early days of Windows/Linux interoprability. They also allow you to drag and drop though conversion from stored file format to MP3 will take some time. 

TeraCopy (a more optimal version of Windows Explorer's copy functionality) sufferred from a number of stalls and the only notification that I had was a balloon popup on the toolbar indicating that it was due to the process of conversion. Would have liked to see something more informative regarding progress.

Some of the main database table structures extracted from various onboard files are provided below (This was extracted by using a SQLite Browser/Manager and then exporting it to SQL code.).

CREATE TABLE album (pid INTEGER NOT NULL, kind INTEGER, artwork_status INTEGER, artwork_item_pid INTEGER, artist_pid INTEGER, user_rating INTEGER, name TEXT, name_order INTEGER, all_compilations INTEGER, feed_url TEXT, season_number INTEGER, is_unknown INTEGER DEFAULT 0, has_songs INTEGER DEFAULT 0, has_music_videos INTEGER DEFAULT 0, sort_order INTEGER DEFAULT 0, artist_order INTEGER DEFAULT 0, has_any_compilations INTEGER DEFAULT 0, sort_name TEXT, artist_count_calc INTEGER DEFAULT 0 NOT NULL, PRIMARY KEY (pid));

CREATE TABLE artist (pid INTEGER NOT NULL, kind INTEGER, artwork_status INTEGER, artwork_album_pid INTEGER, name TEXT, name_order INTEGER, sort_name TEXT, is_unknown INTEGER DEFAULT 0, has_songs INTEGER DEFAULT 0, has_music_videos INTEGER DEFAULT 0, PRIMARY KEY (pid));

CREATE TABLE avformat_info (item_pid INTEGER NOT NULL, sub_id INTEGER NOT NULL DEFAULT 0, audio_format INTEGER, bit_rate INTEGER DEFAULT 0, sample_rate REAL DEFAULT 0, duration INTEGER, gapless_heuristic_info INTEGER, gapless_encoding_delay INTEGER, gapless_encoding_drain INTEGER, gapless_last_frame_resynch INTEGER, analysis_inhibit_flags INTEGER, audio_fingerprint INTEGER, volume_normalization_energy INTEGER, PRIMARY KEY (item_pid,sub_id));

CREATE TABLE category_map (id INTEGER NOT NULL, category TEXT NOT NULL, PRIMARY KEY (id), UNIQUE (category));
CREATE TABLE composer (pid INTEGER NOT NULL, name TEXT, name_order INTEGER, sort_name TEXT, is_unknown INTEGER DEFAULT 0, has_music INTEGER DEFAULT 0, PRIMARY KEY (pid));
CREATE TABLE genre_map (id INTEGER NOT NULL, genre TEXT NOT NULL, genre_order INTEGER DEFAULT 0, is_unknown INTEGER DEFAULT 0, has_music INTEGER DEFAULT 0, artist_count_calc INTEGER DEFAULT 0 NOT NULL, album_count_calc  INTEGER DEFAULT 0 NOT NULL, PRIMARY KEY (id), UNIQUE (genre));

CREATE TABLE item (pid INTEGER NOT NULL, revision_level INTEGER, media_kind INTEGER DEFAULT 0, is_song INTEGER DEFAULT 0, is_audio_book INTEGER DEFAULT 0, is_music_video INTEGER DEFAULT 0, is_movie INTEGER DEFAULT 0, is_tv_show INTEGER DEFAULT 0, is_ringtone INTEGER DEFAULT 0, is_voice_memo INTEGER DEFAULT 0, is_book INTEGER DEFAULT 0, is_rental INTEGER DEFAULT 0, is_itunes_u INTEGER DEFAULT 0, is_digital_booklet INTEGER DEFAULT 0, is_podcast INTEGER DEFAULT 0, date_modified INTEGER DEFAULT 0, date_backed_up INTEGER DEFAULT 0, year INTEGER DEFAULT 0, content_rating INTEGER DEFAULT 0, content_rating_level INTEGER DEFAULT 0, is_compilation INTEGER, is_user_disabled INTEGER DEFAULT 0, remember_bookmark INTEGER DEFAULT 0, exclude_from_shuffle INTEGER DEFAULT 0, part_of_gapless_album INTEGER DEFAULT 0, chosen_by_auto_fill INTEGER DEFAULT 0, artwork_status INTEGER, artwork_cache_id INTEGER DEFAULT 0, start_time_ms REAL DEFAULT 0, stop_time_ms REAL DEFAULT 0, total_time_ms REAL DEFAULT 0, total_burn_time_ms REAL, track_number INTEGER DEFAULT 0, track_count INTEGER DEFAULT 0, disc_number INTEGER DEFAULT 0, disc_count INTEGER DEFAULT 0, bpm INTEGER DEFAULT 0, relative_volume INTEGER, eq_preset TEXT, radio_stream_status TEXT, genius_id INTEGER DEFAULT 0, genre_id INTEGER DEFAULT 0, category_id INTEGER DEFAULT 0, album_pid INTEGER DEFAULT 0, artist_pid INTEGER DEFAULT 0, composer_pid INTEGER DEFAULT 0, title TEXT, artist TEXT, album TEXT, album_artist TEXT, composer TEXT, sort_title TEXT, sort_artist TEXT, sort_album TEXT, sort_album_artist TEXT, sort_composer TEXT, title_order INTEGER, artist_order INTEGER, album_order INTEGER, genre_order INTEGER, composer_order INTEGER, album_artist_order INTEGER, album_by_artist_order INTEGER, series_name_order INTEGER, comment TEXT, grouping TEXT, description TEXT, description_long TEXT, collection_description TEXT, copyright TEXT, track_artist_pid INTEGER DEFAULT 0, physical_order INTEGER, has_lyrics INTEGER DEFAULT 0, date_released INTEGER DEFAULT 0, PRIMARY KEY (pid));

CREATE TABLE item_to_container (item_pid INTEGER, container_pid INTEGER, physical_order INTEGER, shuffle_order INTEGER);

CREATE TABLE video_info (item_pid INTEGER NOT NULL, has_alternate_audio INTEGER, has_subtitles INTEGER, characteristics_valid INTEGER, has_closed_captions INTEGER, is_self_contained INTEGER, is_compressed INTEGER, is_anamorphic INTEGER, is_hd INTEGER, season_number INTEGER, audio_language INTEGER, audio_track_index INTEGER, audio_track_id INTEGER, subtitle_language INTEGER, subtitle_track_index INTEGER, subtitle_track_id INTEGER, series_name TEXT, sort_series_name TEXT, episode_id TEXT, episode_sort_id INTEGER, network_name TEXT, extended_content_rating TEXT, movie_info TEXT, PRIMARY KEY (item_pid));


My guess is that they used the:

/media/sdd1/iPod_Control/Music/F[:number:]{2}/[:alpha:]{4}.mp3

structure as a means of avoiding filename clashes. iTunes basically manages various files and databases to keep track of where everything is. While its clear that there are alternatives they are not always perfect (I manually deleted a file from a my iPod and one of them was unable to correctly update the database. There has been some difficulty in the Open Source world with reverse engineering the details obviously and one of the solutions I've seen was adding/removing files using another program and then plugging it into iTunes to have it update its internal databases but you have to wonder about the logic of this as you're just adding another moving part to the already complex mix/interplay.) and have to be reverse engineered which can be time consuming and difficult as Apple continue to increase their use of anti-reverse engineering technologies (The more you dig the more you realise how drastically some organisation's thinking can veer off of what you believe to the most sensible/elegant option. During my sanitisation experiment a number of files kept on showing as being recoverable. My guess is that it has to do with the way in which files/directories are extracted and manipulated rather than remnant data though. You also obviously need to factor in design compromises and commercial considerations as well.).

CopyTransManager
CopyTransDoctor


It seems clear that the device itself is built off of industry standard software/hardware. Brilliantly integrated and packaged though. Underlying filesystem format is either HPFS or FAT32 depending on the operating system from which the device is setup from.

Tried using various wiping programs. However, it soon became clear that there  other issues at play here. Almost like there's another layer in between the operating system and the underlying filesystem. Not sure whether this is limited to my system (I have a Windows system that is dedicated to pure experimentation so I can't be entirely sure about it being true to other's experiences. I seemed to have no issues with interfacing with the underlying filesystem on Linux but that's not a 'standard environment'.) though.

AxCrypt - Shred and Delete
Shredding of ''????" failed,
A device attacked to the system is not functioning.

Eraser - Erase
Error - The file or directory is not a reparse point. (Exception from HRESULT: 0x80071126)

A file or directory can contain a reparse point, which is a collection of user-defined data. The format of this data is understood by the application which stores the data, and a file system filter, which you install to interpret the data and process the file. When an application sets a reparse point, it stores this data, plus a reparse tag, which uniquely identifies the data it is storing. When the file system opens a file with a reparse point, it attempts to find the file system filter associated with the data format identified by the reparse tag. If a file system filter is found, the filter processes the file as directed by the reparse data. If a file system filter is not found, the file open operation fails.

iPod Explorer - Simple Deletion
Obvious that one deletion of file is possible but it doesn't deal with updating the meta-data/database. It still appears in the menuing system but attempting to play results in nothing, not even an error.

Obviously, after deletion I tried various methods of file recovery to see just how effective some of the mechanisms I employed were. As with most standard FAT based filesystems if there were no other intervention 100% file recovery is almost always possible. You need to use a wiping program to truly defend your iPod or other mobile devices against attack from computer forensics programs. 

root@system:/media/sdc1# photorec /log /debug /d photorec
PhotoRec 6.11, Data Recovery Utility, April 2009
Christophe GRENIER
http://www.cgsecurity.org

Disk /dev/sdd - 7889 MB / 7523 MiB (RO) - Apple iPod
     Partition                  Start        End    Size in sectors
 1 P FAT32                    0   1  3   127 204 49    1926015 [USER'S IPOD]
168 files saved in photorec directory.
Recovery aborted by the user.
mp3: 148 recovered
tx?: 10 recovered
sqlite: 4 recovered
txt: 3 recovered
mov: 2 recovered
gz: 1 recovered
[ Quit ]

root@system:/media/sdc1# vim /etc/scalpel/scalpel.conf
# MPEG Video
mpg     y       50000000        \x00\x00\x01\xba        \x00\x00\x01\xb9
mpg     y       50000000        \x00\x00\x01\xb3        \x00\x00\x01\xb7

root@system:/media/sdc1# scalpel -v /dev/sdd1 -o /media/sdc1/scalpel
/dev/sdd1:   9.8% |********|  740.0 MB  2:05:55 ETAOPENING /media/sdc1/scalpel/mpg-1-0/00003091.mpg
/dev/sdd1:  10.0% |*******|  750.0 MB  2:06:05 ETAOPENING /media/sdc1/scalpel/mpg-1-0/00003093.mpg
CLOSING /media/sdc1/scalpel/mpg-1-0/00003091.mpg
^C^C^C
Kill signal detected. Cleaning up...
CLOSING /media/sdc1/scalpel/mpg-1-0/00003090.mpg
^C
Kill signal detected. Cleaning up...
CLOSING /media/sdc1/scalpel/mpg-1-0/00003089.mpg
^C
Kill signal detected. Cleaning up...
CLOSING /media/sdc1/scalpel/mpg-0-0/00000055.mpg
OPENING /media/sdc1/scalpel/mpg-1-0/00003092.mpg
CLOSING /media/sdc1/scalpel/mpg-1-0/00003092.mpg
/dev/sdd1:  10.1% |*********|  760.0 MB  2:04:56 ETACleaning up...
 Caught signal: Interrupt. Program is terminating early 

Erase Free Space (Eraser) option has reduced the significantly the chances of file recovery even though file integrity recovery indicators state (CopyTransDoctor) that 100% recovery is possible this is certainly not the case. My results indicate that while partial wiping is possible it requires specialised tools and/or knowledge (I've seen some mobile applications that are specifically designed for this purpose) and clearly if you have raw/jailbroken access to the file system you have many options/utilities available to you.

Not surprisingly given these issues, Apple and others have come up with their own wiping/encryption functionality. 


Simulated the following wiping (free space only. To run on the entire device just drop the digit.) algorithms,
- British HMG IS5 (3 passes)
- US DoD 5220.22-M (8-306./E)(3 passes)
by running the following:

dd if=/dev/zero of=/media/sde1/ipod.wipe
cat /dev/zero | tr '\0' '\1' | dd of=/media/sde1
dd if=/dev/urandom of=/media/sde1/ipod.wipe

Note that you will run into the 4GB filesystem limitation with FAT32 so just create a another file to get around this problem. Namely,

dd if=/dev/zero of=/media/sde1/ipod.wipe
dd if=/dev/zero of=/media/sde1/ipod.wipe1
dd if=/dev/zero of=/media/sde1/ipod.wipe2
etc...

It seemed to fairly obvious that a single wipe (British HMG IS5 (1 pass) or US DoD 5220.22-M (8-306./E)(1 pass) which basically amounts to a single pass of zeros) was enough to throw off the various programs that I was using to examine the device though (I was only using free and Open Source tools to simulate a worst case scenario.).

- scalpel
- photorec
- testdisk
- Recuva
- Glary Utilities
- diskinv

Not surprisingly, ports, and installations of Linux have been attempted. The main limitations seem to be the anti-reverse engineering technologies implemented by Apple though.



Given the fact that it basically is a USB storage device you can use a lot of standard utilities on the device such as DBAN and BCWipe.


Luckily recovery mode is there for you to be able to restore functionality most of the time (It's fairly easy to trigger. I obviously corrupted the filesystem a number of times through my experiments with dd and also attempting to reformat, use other programs, and operating systems on my device. Just plug it into a computer running iTunes and it'll do a complete reset of the device for you.).

http://www.tuaw.com/2010/12/31/discovering-ipad-nano-recovery-mode/

- as usual thanks to all of the individuals and groups who purchase and use my goods and services
http://sites.google.com/site/dtbnguyen/
http://dtbnguyen.blogspot.com.au/

Friday, June 8, 2012

Crash Course in Security

My preliminary guesswork regarding my recent LibreOffice crashes were more correct accurate than I realised. What's actually happening is that in areas where the picture is larger/where strange cut/paste decisions are being made the program is actually having difficulties processing this data. This is reflected by a stall of several minutes (or eventual crash) in user space (workable under Microsoft Word but not under LibreOffice/OpenOffice at the moment). I've fiddled around with removing, changing the format, and compression level of the pictures themselves but obviously this does not scale well on large files (I'm not sure how long this is going to be yet.).

There does seem to be an option in Microsoft Word which will allow you to compress all images in the file though (there seems to be similar work occurring in LibreOffice/OpenOffice as well). I was able to achieve a size reduction from 5906KB to 5023KB. A substantial saving and one which has allowed me to re-open it (I've been standardising fonts/styles as well) and use it in OpenOffice/LibreOffice as well. Something else which I've realised is that where I've tracked changes I've made or the program has made odd formatting/styling decisions which have compounded the problem.

http://www.libreoffice.org/features/extensions/
http://user.services.openoffice.org/en/forum/viewtopic.php?t=6918
http://user.services.openoffice.org/en/forum/viewtopic.php?t=3665


In some other work had to deal with some browser compatibility issues (IE6). Something I came across was the history different in support levels between PNG as opposed to other formats in web browsers. If you've ever heard of or used ImagaMagick then you'll realise just how useful it is.

for i in *.jpg; do temp=`echo $i | sed s/jpg/png/`; convert $i $temp; done
for i in *.jpg; do temp=`echo $i | sed s/jpg/gif/`; convert $i $temp; done

Another thing you may notice is that even when using tools that are designed to deliberately compress image files depending on the algorithm there's only so far that you can take it.

http://pmt.sourceforge.net/pngcrush/

At a certain point it just comes down to the raw dimensions of the file itself. This is particularly the case with files that use lossless compression algorithms.

for i in *.jpg; do temp=`echo $i | sed s/jpg/png/`; convert -resize 25% $i $temp; done

The following are useful utilities for dealing with PDF files. I recently needed them to append multiple PDF's to one another/convert to other formats and didn't want to use a full blown editor. 

Monday, June 4, 2012

I'm not a Crash Test Dummy!

I was going to write the following.

Only a short while back I never thought that I would be able to reach this point (due to continual LibreOffice crashes) but my document on 'Cloud and Internet Security' has reached 90K+, 318+ pages without much of a problem. There's still a bit of work and a lot of editing to do though.

However, I'll have to change it to this.

The crashes resumed after copying/pasting in a new element. I can't be sure whether it was a picture or just pure text as the crash generally only occurs during automated autosaves so what is supposed to save you is actually causing you the problem. I've done a bit of research and its basically what I surmised earlier. It has something to do with formats/styles but not exactly in a way that you would think. It doesn't actually have to do with the content itself as the total number of formats/styles that are part of the document. The more you have the more likely the crashes are to occur.

Obviously, the cleanest way was to convert it to another format so that I could open it with a more reliable word processor. Ironically, even AbiWord, OpenOffice and CLI based tools had trouble with (opening, saving, and converting would result in timeouts or crashes) the document. Eventually, I recalled an add-on for Microsoft Word that would allow me to open ODT documents which seemed to work perfectly fine and also allowed me to convert to DOC format (converting to the more up to date DOCX format would result in freezes). I've since switched to the more stable, tested, and resilient Microsoft Word for now (LibreOffice still has problems with the new document but I've noticed that a lot of strange additional formatting decisions were made during cutting/pasting once I saw the Navigation Panel under Word. I will switch back to LibreOffice once they've figured some of these issues out.).

http://stackoverflow.com/questions/4017886/how-to-convert-odt-to-doc-rtf-without-openoffice-org
http://davelargo.blogspot.com.au/2012/05/libreoffice-live-better-crash.html
http://forums.opensuse.org/english/get-technical-help-here/applications/466453-libreoffice-writer-freezes-100-cpu-utilisation.html
http://scottnesbitt.net/ubuntublog/?p=1018

As an aside, I sometimes crimp/re-crimp my own network cables. Try to go after quality crimping tools/equipment. I just had a small batch of connectors just break. I suspect it partly had to do with the ambient temperature (very low) but I think its mostly down to QA problems. Please note that while stripping the network cable further back may allow you to more easily insert the cable into the connector it also means that it is more likely to lead to signal leakage/interference between individual wires in the long run (I've learnt this through personal experience).

Also, if you've ever come across the 'nm-applet' that sits on your taskbar and manages network connections (under UNIX/Linux) but it refuses to pickup a new connection try removing and reinserting the relevant network kernel module via 'rmmod' and 'modprobe'.

- as usual thanks to all of the individuals and groups who purchase and use my goods and services
http://sites.google.com/site/dtbnguyen/
http://dtbnguyen.blogspot.com.au/

Monday, May 21, 2012

Temperamental Television

Until recently I didn't realise just how sensitive DTV (Digital Television) actually was. My experience tells me that an amplifier is highly recommended (unless your dongle/device/set top box is exceedingly good). The thing which has made me particularly curious though is the impact of local electrical appliances (such as power boards, heaters, and even networking devices. Removing or swapping particular devices can have an immediate impact on signal strength/integrity.) and the connections between the tuner, antenna, amplifier, etc... While I admit that some of the equipment in my setup could be of a higher standard the tolerances that we're talking about are borderline absurd. Changing the angle of connections is enough to change the signal strengh/integrity substantially. Moreover, signal integrity issues at certain points are extremely difficult to debug without specialised equipment (I've seen some digital TV strengh metres being sold but I haven't tried one as yet and the cost outweighs the possible gains. Admittedly, there are some signal strength measuring systems in the software itself but this is not ideal as it can not go into an arbitrary position in the pipeline.) and the only real feedback that you get is how 'choppy' the sound/picture is. I've found that moving the amplifier power point on to a less noisy circuit can be extremely helpful as well as changing the angle of the cable the being used to carry the signal into various devices (the amplifier is particularly susceptible to this problem and I've found it best to lay it on a flat surface). I may experiment with Microwave based transmitters (2.4/5GHz range) later on but early indications/reviews say that cable may actually be better. I've also been thinking about using an adapter to carry the signal over a non-coax type cable (or a medium that is less suspectible to issues related to cable bending) to hopefully reduce the impact of these problems but once again its a cost/benefit issue and I've seemed to have found a viable solution as is.

I've figured out that some of my recent problems with LibreOffice may also be due to issues with regards to externally inserted objects (such as images). I've been working on a new document (on 'Internet and Computer Security') and its 225+ pages/67K + words and there have been no random crashes as I've previously experienced when working on larger documents. I guess I'll have to write the text before hand, and add other objects in now from now on (at least until they fix the problem. This should also get me around another problem that I've found when editing text and there are images in the document (they don't move perfectly correctly with the text when cut/pasted.). The other alternative is to switch to another system of document management...

Have a theory about some connectivity issues I've been having lately. While playing around with MTU values has resulted in success I've also noticed something else. Sometimes, there seems to be a noticeable delay at certain critical points as though the traffic almost as though it is being buffered. Also, if there is other web based activity simultaneously this will help to get around the problem of stalls/stops at these particular points. Suspect there may be a timeout value that I may be able to tweak in my browser to help smooth out this intermittent problem (I've been dealing with it by dynamically shifting MTU values (depending on the circumstance) along with using HTTP/206 partial download capabilities but am thinking of building something more robust/automated/finding a better configuration for a more elegant solution.).

about:config
opera:config
http://100pulse.com/http-statuscode/206.jsp

- as usual thanks to all of the individuals and groups who purchase and use my goods and services
http://sites.google.com/site/dtbnguyen/
http://dtbnguyen.blogspot.com.au/

Sane and Sensible Hierarchies/Organisational Structures, Random Stuff, and More

- in this post we'll look at professional sports and other fields and how stuff from that field can be used in the business world and ho...