Archive for the ‘Computer’ Category

How can I speed up SD card writing speed (using /dev/disk*) on a MacBook Pro?

九月 6, 2017

When one character “r" means 83.8x speed difference:…/how-can-i-speed-up-sd-car…
“Apparently a BSD thing"

On Lexar 633x microSDHC card:

sudo dd if=image-to-be-written.img of=/dev/disk4 bs=1m

sudo dd if=image-to-be-written.img of=/dev/rdisk4 bs=1m
17.54MB/sec (83.8x the one above)



一月 22, 2016


安裝 livestreamer

# pip install livestreamer

安裝 ffmpeg

請到 去下載並安裝 ffmpeg

找出節目 .m3u8 鏈結

請參考 一文找出 .m3u8 鏈結,如

http 換成 hlsvariant 然後下載

$ livestreamer “hlsvariant://″ best -o 20160118.ts

用 ffmpeg 將 .ts 檔轉成 .mp3

$ ffmpeg -i 20160118.ts -acodec copy 20160118.mp3


請參考 如何飛走新聞

bash script


* 用 ffmpeg -i 錄出來的會條線(過程中 ffmpeg 回報有錯誤),所以才要去找另外的方法。

Convert mp3 tag to utf8

一月 2, 2014

find . -iname "*.mp3" -execdir mid3iconv -e big5 {} \;
You can replace big5 with gbk, if so needed.

Prerequisite: sudo apt-get install python-mutagen (on Ubuntu).

Nook HD+

十一月 11, 2012

(Note: Not everything written here is accurate. I’ll update this post as I find errors. Last updated: Dec 14, 11:30 EST)

This post is just a dump of what I want to say about the Nook HD+ at hand (so it is not organized and not a comprehensive review). For specs look up the web.

Firmware: 2.0.2, automatically updated from 2.0.0 during initial setup after connecting wifi.

No auto brightness; lowest brightness setting pretty easy on eyes for bed time reading.

Bluetooth keyboard does pair but doesn’t work without apps like BlueKeyboard JP (which is only available in Google Play but not Amazon app store nor Nook app store—maybe this is a reason to root it?) Bluetooth mouse works fine with it.

Keyboard (horizontal) as wide as my 12″ laptop

Rooting of Nook HD and HD+ are currently in progress—keep fingers crossed. Thrilled to know Cyanogenmod is coming! ( (See also

For PDF reading there are two (free) choices: OfficeSuite and Reader. For some reason the full screen on OfficeSuite is missing 1/16 of the screen. Both don’t offer scroll lock (maybe that’s less of a problem given the large screen. Or maybe not) and both can’t quite handle the NY subway map. After zoom and a few pans both crashes.
(edit Nov 12) Full screen (portrait) in Reader is even worse, with about 2cm total on top and bottom of screen. Landscape mode in Reader is real full screen, showing two pages at a time (OfficeSuite is still 1 page at a time).

You have to pay for ezPDF reader and RepliGo PDF reader; the free mupdf which works on Nook Color and Nook Tablet doesn’t work on the HD variants currently.

Web browser: Portrait

Upper half of the screen

Close-up (portrait):


Close-up (landscape):

Video: mp4 clips downloaded from youtube played well. Youtube videos also played well, and can go full screen but the bottom most 1/16 of the screen is not utilized (landscape). JW Player (a flash player) doesn’t work. Vimeo works (uses Moogaloop player).

Transfer rate (from laptop to Nook) using Camera (PTP) mode is slower (about 3 MBytes/sec). Haven’t tried Media device mode (MTP) on Ubuntu because that involves installing app on laptop but what was provided is a dmg file (for Mac). On Windows (MTP) transfer rate is about 9 MBytes/sec.

Email, calendar and contacts are setup in one shot if you use Google.

Key pitch is close to 19mm in landscape mode—almost the same as the keyboard on my 12″ laptop. (pic)

No CJK keyboard support.

Nook store sucks for many of its apps haven’t updated to support Nook HD and Nook HD+ (i.e. they say they have 10K apps but only a fraction of them is good for the new ones, until the apps are updated). We’ll see how that will improve over the coming month or two. Their search functionality sucks hard too. Searching for “pdf" only returned 1 app whereas there are at least 3 pdf readers out there—I had to search for “reader" instead.

Speaking of the store, you need an account and a credit card to use with it. This maybe annoying to some. Plus you can’t delete your card info like that with iTunes (at least not on the web—maybe you have to call them).

Charger that comes with it has 2A output. When the Nook HD+ is plugged into a laptop, it doesn’t show charging but the orange charging light next to the connector lights up, much like the 1st edition Nook (the e-ink reader with a colour screen). So my guess is it will still charge with computers albeit at a slower rate.

As I owned a refurb 1st edition Nook before and it died after 14 months of use I’m paranoid about warranty. Squaretrade asks $79.99 for a 3-year warranty with accidents like spills and drop (theft not included). Warranty can be purchased within 30 days of purchase of the device. I think this is better than the 2 year protection from either Target or B&N, that costs roughly the same. (edit: Nov 15) Just learned that if you pay by Mastercard you can have warranty extension to 2 years for free. No accident coverage but you don’t have to pay extra. (I believe there’s something similar for Visa card too, but I haven’t checked that out.)

(edit Nov 12) There doesn’t seem like an oleophobic coating like those in cell phones so fingerprints and grease don’t come off easily.

(edit Nov 14) Sideloading apps (no root required) is not that hard once you have the Android sdk setup. Follow (make appropriate changes accordingly) and that’s pretty painless, even though that takes a while. Only SDK needs to be downloaded, not the ADT bundle which is 400+MB. Everything else is downloaded through the Android SDK manager. I find it easier to work with Ubuntu as my Windows connects and disconnect my Nook when it’s put in debug mode. I don’t know why.

After sideloading keyboards that type Chinese, I feel better now. I have yet to get BlueKeyboard JP to work, namely I don’t have the .apk files and I can’t find it on my phone that I can copy it to the Nook.

(edit Nov 15) Got bluetooth keyboard to work! BluIME is the key (need rooting). BlueInput doesn’t quite work: it eats up a lot of CPU.

(edit Nov 17) Sideloaded Google Maps and Skitch (from makers of Evernote). Google maps work with offline so you get a gorgeous HD map! Map setting cause it to crash probably because I haven’t rooted it. Evernote is available in Nook App store so you can access it (and Skitch from within Evernote) from the home screen. Not so for Google Maps. If you don’t want to install a launcher, the trick is to open the “Apps" from home screen, then tap and hold the bar with the word “App" on the top and meanwhile pressing volume button. Both volume up and down works, so I prefer volume down because it won’t make noise even if it fails (if it fails you’ll be adjusting your volume). Maybe I should root it and use Amazon App store and then I don’t have to get the .apk files and sideload them from my laptop… (I added this update with the Bluetooth keyboard!) The DIY cover is also done. Together with a Bluetooth keyboard you can edit WordPress posts.

(edit Nov 19) Got (sort of) root using the method described at Now I can install apps from Amazon App Store! No more side loading.
In more detail, you first go to the first post of the thread and root it. Then follow that post #65 (I’m putting in more details and links here),
<Warning you should backup everything first!>
1. get a file manager that supports root, e.g. ES file manager and sideload it.
2. using the file manager copy NookColor Tools (e.g. here) to /system/app (for this you need to enable write on /system using the file manager)
3. sideload a launcher, e.g. ADW Launcher, so you can see and launch the NookColor Tools from it. Check and uncheck several times the “install non market apps" box. Leave that checked before you move on.
4. Try downloading a test .apk of your choice and see if it installs.
5. Delete the NookColor Tools from /system/app and quit the file manager.
6. Reboot your device (you can just do a “adb reboot")
7. If it doesn’t fall into a reboot loop, then you should be able to install Amazon app store and get it running.

(edit Nov 22) I’m trying to copy some free apps from my phone to the nook, but looks like google now uses encryption so the .apk file is not directly there at /data/app (need root privilege). I can find those apps at /mnt/asec but it’s not a single .apk but a directory. Fortunately for the one app that I want the .apk file is in there. Not sure if that’s true for other apps as well. I can install the .apk found there.

(edit Dec 14) A month into using my Nook HD+ there were two occasions when it just won’t turn on, until you plug it into the charger and give it a zap (it’s not completely discharged, it just went into a coma). Bad luck for me, or other owners have the same issue? Last time I was on firmware ver 2.0.2 and this time 2.0.4… Looks like I have to have my charger with me all the time (good that it’s not bulky).

P.S. As I went to Target and get my Nook HD+, I also see the e-ink one (Simple Touch) with the GlowLight—the one on display looked terrible.

Targus Bluetooth mouse

十月 1, 2011

I got a Targus bluetooth mouse (AMB04US) at $13. I prefer Bluetooth mouse as there’s no dongle that protrudes from my laptop (and frees up a USB port), but this means far fewer choices. The size of the mouse is 4.1″L x 2.1″W x 1.4″H (104.8mm x 54.4mm x 35.7mm). I’d say it’s medium size as according to this thread, Bluetooth mouses have length from 3.1″ to 4.9″. Dell 5-button Bluetooth travel mouse matte black looks great but it’s considerably more expensive at about $30 (3.75″ in length).

Usually it connects within a few seconds, and if it doesn’t it’s the bluetooth of my laptop not working and I have to switch it off and on again to have it working. The feedback when scrolling the wheel is not as strong as my other mouse, but it’s still way better those that scrolls continuously (I hate that), and I get used to it after a while.

It takes 2 AAA batteries and the batteries are good for at least 10 days for my light usage (I don’t care that much how long would the battery last as I’m using rechargeable ones). The LED will not switch itself off completely as opposed to my other mouse using 2.4Ghz (for which you can wake it up with a mouse click). The LED will fire more sparingly when not in use, though. When it’s low battery the scroll wheel will flash red. The DPI setting can be changed between 800 and 1600 DPI by pressing and holding the scroll wheel and the right button for 3 seconds.

I’m very satisfied with this mouse, and it’s one of the cheapest you can find on the web (It’s $10 on Amazon few days after I’ve bought it!).


九月 24, 2011

I got a couple of gadgets recently. One is the Targus AMB04US Bluetooth mouse at $13. The other is the OCZ OCZSSD2-1VTZPL120G Vertex Plus 120GB SSD drive at about $1/GB, together with a external harddrive enclosure for my 320GB harddisk originally on my laptop.

Originally, I followed the instructions in this post:
However, two days later I find my system32 folder missing (!) and so I have to recover the system. A day later, some other system files is missing and again Windows failed to boot. I then contacted the tech support of the SSD company and they suggested a fresh install, as opposed to using the Lenovo recovery disk. To do this I have to download the Windows 7 iso image:
Then transfer this on to a USB thumb drive with the tool from Microsoft:

The installation went smoothly, but after that I couldn’t go on to the internet as drivers are missing. I had to download the driver for the wireless interface from another computer to get things started. After that I can download the System Update software from Lenovo, which takes care of other drivers.*

After that it’s time to tweak the system to be SSD friendly: (Although it turns out not every tweak in it is useful)
Few things to highlight: Install a RamDisk (Dataram Ramdisk is pretty good), and put the Chrome Cache on it (using the parameter --user-data-dir="E:\TEMP\User Data"). If you save the ramdisk image to the data disk after re-install the search history will be preserved, which is very good. Also, tell Firefox not to use disk but ram instead for cache (google “firefox ramdisk")

In order to avoid the pain of backup/restore my data, I decided to partition it into system disk and data disk. I then move my user folder (C:\Users\user_name) to the data disk. I first tried this but it doesn’t work for me.
So I fall back to the supported way of doing this: for every folder in my account (Desktop, Downloads, Favorites, My Documents, …) I opened the Properties page and move them in the Location tab. Not fun but it’s the safest way as it is supported.

A bunch of software install follows (the most time consuming part). I’m jotting them down so I can refer to later on if the system needs to be re-installed for whatever reason:
Microsoft Security Essentials
Dataram Ramdisk
Chrome and Firefox
Microsoft Office
Adobe reader
PDFXChange viewer
MikTeX, gsview and ghostscript
Putty and WinSCP
Vim and latex plugin
Printer driver
Windows update
Calibre (ebook management software)
WinSplit Revolution

* Rant about the system update software from Lenovo:
1. It still doesn’t support 64-bit system directly — it’s relying on the Windows XP compatibility mode, even after a few years.
2. For some reason the power manager doesn’t install, which means I have to do it manually.

九月 17, 2011

I’m using for syncing files across computer, as well as backup. Today I saw on slickdeals that there is a that offers 10GB of storage with 2GB file size limit. I tried that out and the registration is simple: just type in a user name and a password and you’re good to go. It doesn’t even ask you for your email. The upload speed is quite decent (2MBytes/sec) while the download speed is 1MBytes/sec (I’m on a 25Mb connection). After upload you can share the file with friends: just give them the link (if it is private) and you can also share it as public. It’s good if you have large files you want to share and neither you nor your friends have to setup a server, and you don’t have to tolerate the slow speed file transfer using those IM clients. It’s worth trying it out.

WinSplit Evolution

十一月 27, 2010
Winsplit Evolution is a utility to organize your windows, so we don’t have to do manually resize them every time. With a large monitor this comes handy.

I disabled the ++ key combination in my display driver (no one really want to use the monitor to be upside down, right?) and assign it to Winsplit. It will cycle through these settings (I’m using the screen in the portrait mode — 1080 x 1920)
1. upper half of the screen
2. lower half of the screen
3. lower 5/6 of the screen (using the full height for reading is just too much)

If you have a better suggestion, leave a message here.

Windows 7 x64 Ramdisk

十一月 6, 2010

I downloaded the Ramdisk from here. It’s free if your ramdisk size is less than 4GB. It works for my Windows 7 x64 version. It saves and load the ramdisk image when you shutdown or boot your computer so it’s really painless.

Then I moved my Chrome cache to the Ramdisk by copying the “User Data" directory from “C:\Users\<UserName>\AppData\Local\Google\Chrome" to “D:\TEMP". Then modify the Chrome shortcut and add the parameter --user-data-dir="D:\TEMP\User Data" after chrome.exe.

Reference: (but you don’t need all that hacking mentioned because the software is not beta now)

Phone Disk – Use your iPhone as a flash drive

九月 5, 2010

From the same developer that develops iPhone Explorer, they now give away registration code for Phone Disk till 1st Dec 2010. Phone Disk allows Windows/MacOS to see your iPhone/iTouch/iPad as a USB flash disk.