Yesterday, I nearly bricked my phone (HTC Desire HD), but got it back up and running again. Here is how – it is a relatively simple technique but I did not find it on the web, so I thought I'd share it.
Assume your phone (any Android phone for that matter) is in the following condition:
- The bootloader works. Means, the HBOOT and FASTBOOT modes of the bootloader that appear when pressing "Volume down + Power" on a HTC Desire HD.
- Android does not boot. This makes it impossible to unlock the Bootloader with the HTCDev method, since it usually requires a firmware update first that is done with a fully booted Android and a RUU .exe file on a Windows computer. For the same reason, installing any stock firmware in its regular RUU .exe distribution format is likewise impossible. It also makes it impossible to repair anything via
adb of course.
- The recovery solution does not work. For example because of a failed attempt to flash it, failing due to the "signatture verificattion" error mentioned above. So there's no ClockworkMod Recovery or 4ET Recovery Touch with Nandroid backup functionality that would allow you to restore Android to an earlier, working version. You also cannot flash a recovery solution because this is a custom flash that requires an unlocked bootloader.
- The bootloader is locked. In this case, it still had "SHIP S-ON" showing at its top, means it is not posssible to flash any custom firmware etc. via fastboot since then it will turn that down with a "signature verification fail" error. For the same reason, you also cannot use the HBOOT PD98IMG.zip method for flashing a custom image (see below).
- You cannot root or S-OFF your phone. That will be because most rooting methods require adb access or a booted Android version.
Solution: Install a stock firmware with the PD98IMG.zip method:
- Find a stock firmware for your phone in PD98IMG.zip format. For the HTC Desire HD, I tried PD98IMG-GB3.zip from this list, and it worked.
- Flash that stock firmware with HBOOT. That is, place the firmware to flash as PD98IMG.zip on the SD card and then boot your phone into the bootloader in HBOOT mode. It will detect the PD98IMG.zip and ask you if to flash it. And since it's a stock firmware, it will pass the signature verification. Usually, such a firmware also includes a (stock) recovery solution, so that will work too (though still without Nandroid backups …).
- Boot into Android. Should work again now.
- Root and S-OFF the device. Should be possible again now, since you have a working Android version again.
- Install a custom recovery solution. I recommend 4EXT Recovery Touch. Can be flashed now, since your bootloader is S-OFF now.
- Restore your system from a Nandroid backup. Works now, since you have a custom recovery solution that can handle Nandroid backups.
All software that I found (esp. the many Android apps developed for this purpose) use the webcam by taking a single picture and improving it digitally to be a "scan". This however leads to low resolutions. A better way is to use several pictures and stitch them together. This would be possible most comfortably with a dedicated software for documents from webcams, but that does not seem to exist so far. As an intermediate solution, let's use normal panorama software for this purpose.
Alternative 1: Panorama from images
My propsed scenario looks like this now, but I haven't tested or implemented it further so far:
- Add lighting. Add a light source that will illuminate the piece of your document that each webcam photo will cover. Such as a clipping a USB flashlight to the upper display edge of a notebook.
- Add your page on a stiff "background template" with markers for photo areas. Usually, one would scan A4 pages, so partitioning it in A7 elements and marking them on the "template" along the edges of the A4 page that you add in the middle will result in the option to take 8 photos per A4 page in a way that allows you to select the proper area for each, as each A7 section has an edge in common with the A4 page. 8 images at (say) 2 MPx webcam resolution results in 16 MPx per scan, which is more than enough.
- Create images. You would have a viewfinder with live video, hold up your page so that the next A7 section fits into the viewfinder, and click a key to shoot the next image. Ideally, the viewfinder should have an on-screen display showing a somewhat smaller rectangle for placing the A7 area in, as the edges will then be used for overlap finding when stitching the images together.
- Get the images stitched together. This should be a fully automated process and is possible with one of the many "panorama maker" software applications out there. Some are available for Linux.
Alternative 2: Panorama from video
This is what I tried at first: creating a panning video of your document, grabbing it with the webcam, and using video-to-panorama software to create a high-resolution image from it. However I now think that there are inherent quality limitations, as panning video images are never as sharp as still images since the objects are in motion. However, for other purposes this is a worthwhile technique, and I explored it in its own blog post "How to create a panorama from video under Linux?".
Option 1: Autopano Pro
Autopano Pro is a great sophisticsted panorama software that comes with a Linux version (.deb package even!). It is commercial software for about 100 USD, but has a demo version that will do about the same, just watermarking the generated panoramas.
They have a an article "Fun : Stitching video frames" that explains in detail how to create a panorama from a video. I was successfully able to do it like this, on Ubuntu 14.04.
Option 2: Using Panorama Maker
Panorama Maker is a gratis, Windows and Mac software that can create panoramas from videos automatically. I was successfully able to run the software under Linux using Wine, but could not get the video-to-panorama feature to work. Probably I just did not know the correct video format to use.
For HTML files, you can use the command-line tool
html2text (even with several files at once), together with
html2text *.html | wc --words
For XML files, you can use the command-line tool
xml_grep instead, again together with
wc. It allows to specify an XPath-like expression to define which parts of the XML text to count. Examples for TMX files:
xml_grep --text_only --cond "tuv[@xml:lang='de']/seg" languages.tmx | wc --words
xml_grep --text_only --cond seg languages.tmx | wc --words
I also shared this solution at Stackoverflow; see there for alternative approaches as well.
The mouse stopped clicking at times – it seemed to happen at arbitrary moments. The pointer would still move, but it was no longer possible to click in any way (on my ThinkPad X201 Tablet meaning: trackpoint buttons, touchpad buttons, touchpad tapping, pen input, finger input). The reason for this behavior was probably a defective keyboard (which includes the trackpoint). This post is about temporary workarounds for this issue when it happens though.
The so far least invasive way to re-initialize the mouse (compared to restarting X or rebooting) is to restart the window manager. When you can open a terminal without the mouse working, use this command in a X virtual terminal window [source]:
Alternatively, switch to a console (Ctrl+Alt+F1) and use this command:
DISPLAY=:0.0 openbox --replace
The idea explored here is to separate your data physically from the computer that you are using them on. This has the following advantages: (1) you are quite safe from theft because you can keep carrying your data with you always, even when having to let your notebook at home or in a hotel because it is too heavy; (2) you can use your data on any computer (like a friend's computer when travelling, an Internet cafe computer etc.); (3) you can hand over data items quickly and easily because every computer has a USB interface.
You have to decide if the this idea is worth its benefits for you, as all solutions below are much slower and more expensive than a bigger standard SATA III SSD (as of 2014-06, about 100 EUR new incl. shipment for a 256 GB SSD, with data transfer rates up to 600 MB/s, though the continuous transfer rates have to the researched).
However, here are the solutions I could come up with. By adequacy for my requirements – which included to be 128 GB or more in size:
- SD card in SD card reader. This is the bes option on notebooks that come with a card reader, since it does not block any ExpressCard expansion port (reading your digital camera card is easily possible in the USB ports as well with SanDisk Ultra II SD Plus USB cards). However, it has to be tested still if the typical notebook card reader can utilize the speed of highest speed SD cards used here (else a ExpressCard/34 based card reader would be needed). Because for proper speed, we need the latest "U3" class SD cards. These are just being introduced around 2014-06, so prices will drop lateron. Currently available products:
- SD card in ExpressCard/34 card reader. For data exchange, all readers can expose a SD card as a USB mass storage device, so no drivers on the host system are needed. The additional advantage of using a SD card is that you can also use them for other purposes (recording photos and HD video etc.). For proper speed, we need the U3 speed class cards again, see above.
- Compact Flash card in ExpressCard/54 card reader. This is a good solution, since the speeds of Comact Flash cards are comparable to the ExpressCard SSDs while the Compact Flash format makes it simpler to find an adapter to USB mass storage (namely, a simple card reader). However, Compact Flash does not fit by width into ExpressCard/34, so your notebook will need the larger ExpressCard/54 slot [see]. Speeds of Compact Flash are great, and for data exchange you can carry a USB card reader that exposes the Compac Flash card as USB mass storage (means it needs no driver). But high-speed, large-capacity cards are also expensive; recommendable products:
- A moderately priced one is the Hama CF 128 GB (up to 150 MB/s read, so maybe 40 MB/s continuous write?) for about 145 EUR.
- ExpressCard/34 form factor SSD, plus USB adapter. This is the best option in terms of speed. It can be connected to other computers using a USB to ExpressCard adapter (overview; also see DeLock 61714 etc.). ExpressCard allows cards to use an USB 2.0, USB 3.0 or PCIe mode, and not all these adapters also support PCIe (the Digigear PCU10 does however, but needs manual configuration for PCIe mode). So check first which mode is used by the ExpressCard SSD – anything above 60 MB/s means USB 3.0 or PCIe mode. For the connectors etc., see the ExpressCard standards document.
Available products 64 GB and larger:
- Small "knobby" USB flash drive. If your notebook has a USB 3.0 port or you can add one via an ExpressCard/34 slot or similar, the achievable speed of this solution can be good, too. It seems that there is still no 128 GB flash drive in "knob" size. A hack to get over this would be to combine two of them physically so that they fit exactly into two adjacent USB ports on your notebook (and with a small cable-type USB hub to other computers' USB ports). Available options:
- microSD card in "knobby" microSD card reader. This option works even up to 128 GB (with 128 GB microSD cards being available). However, these cards tend to be slow. Available models: just one so far
- Compact Flash card in 1.8" or 2.5" SATA drive bay. This is essentially using a Compact Flash card as a removable, rugged SSD. There are Compact Flash to SATA adapters for both 1.8" and 2.5" SATA SSD form factor (example: StarGat SAT2C). Also this solution will work only if your notebook can be modified in a way to allow drawing out the card from the HDD bay. And it's not really clear how the computer or operating system might react when extracting the Compact Flash card for example during ACPI Suspend mode. Also when using the system disk bay for this type of SSD, we cannot physically separate operating system and personal files as intended here.
- miniPCIe SSD in ExpressCard and SATA external enclosure. This is more a theoretical option since you do not want to handle a bare PCB with your data on it just to connect it to a computer that does not have an ExpressCard slot. But it would work, as there are converters for miniPCIe to ExpressCard and miniPCIe to SATA.
If you are using Plesk as a server control panel and took part in all updates starting with some Plesk 10 version, you will notice that your recent version (Plesk 11.5 currently) has a total mess with respect to the web hosting directory layout. That's because during some of these updates, Plesk migrated its hosting directory structure, and now the old and new ones are mixed.
The new Plesk web hosting directory layout
Say you have two subscriptions (subscribers being the same or different customers, or even you as an admin). Each subscription has one subdomain and one additional domain. Then the web hosting directory layout would be like this (using placeholder domain names here):
Plus, in /var/www/vhosts/system/ there will be a directory for each domain and subdomain, named with its domain name, and containing subdirectories conf/, logs/ and statistics/.
Recommendation for using this directory layout
One subscription per (sub)domain. We want a directory structure that is logical and consistent, so it's not acceptable to find directories for some but not all domains inside /var/www/vhosts/. The only solution I could come up with so far is creating a new subscription for every single domain and subdomain that you want to host. And then to name the document root directory for hosting the main domain of that subscription always htdocs rather than with the domain name.
Problem: if you have a domain-restricted Plesk licence. With this method, you will run into problem depending on your Plesk licence. For example, if you have the typical "10 domains" licence. Because in this setup, every subdomain is created as its own Plesk domain record, so taking up one of the 10 available domains. While creating Plesk subdomain records for cases where their parent domain is also hosted in Plesk would not take up anything from your licence. But in my view: cleanliness first 🙂 And it's another reason to move to a recommendable, free and open source web hosting control panel.
Removing old, legacy elements. The following elements of the directory structure are probably legacy ones from the earlier Plesk versions and can be safely removed. However, I did not test this, so rename them first and check if everything still works before removing them:
- /var/www/vhosts/example.com/conf/ (a symbolic link)
- /var/www/vhosts/sub.example.com/ (in cases where this contains only conf/, logs/, statistics/ for a domain or subdomain that is an add-on domain for a subscription with another main domain, and has its document root inside that main domain's directory)
- /var/www/vhosts/httpsdocs/ (probably not needed, as the new place seems to be /var/www/vhosts/default/httpsdocs/)