By now, we know of a few requirements for viewing video on iOS (iPhone/iPad et al.). The video codec should be H.264 or another “standard” MPEG codec, and the audio should be AAC. AC3, as far as I know, is not supported. That’s all fine and dandy, but subtitles have been one of the trickiest things to get working on iOS.
I originally wrote this in 2009 as a cheatsheet for processing black and white scanned sheet music. It’s a collection of tips for converting and processing scanned images to ultimately get a nice, high-quality PDF that you could archive.
I just installed Ubuntu 10.04 minimal on a server and it’s great.
-bash: less: command not found
$ man bash
-bash: man: command not found
$ tree ./
-bash: tree: command not found
$ whois google.com
-bash: whois: command not found
$ curl --help
-bash: curl: command not found
I recently moved an old website to a new server. For performance reasons, the new server is running nginx instead of Apache, and didn’t have nginx set up to use PHP. (The optimal way, apparently, is to use PHP-FGM, which currently requires you to patch and build PHP yourself, at least until PHP 5.4).
That was fine, though, because this old site only really needed PHP for one little thing that we could do without. In fact, the primary reason for using PHP here was to essentially append the header and footer sections to each unique page. Basically, we had stuff like:
<?php include('../header.inc'); ?> ... page contents ... <?php include('../footer.inc'); ?>
on every page. What I needed was an automated process to convert all of these PHP pages into static pages. GNU Make, of course, is the de facto standard for automating something like this. Let’s give it a go:
If you are using the Android SDK on a shared computer, you might run into the awesome “NAND: could not create temp file for system NAND” error. This is because “/tmp/android” is hardcoded into the emulator as the directory to start temporary files during emulation, and somebody else has likely claimed it first.
The easiest workaround is, if it won’t cause any problems, to delete or chown the /tmp/android directory, preventing anybody else from using it. If you must share, then you can set up the group so that multiple devs can access it.
But the best way, if you’re not the sysadmin, is to change the temp directory for yourself. You can modify the emulator and change the hardcoded values.
Run “vim -b tools/emulator” and search for “tmp/android” (which would be “/tmp\/android” in vim-speak). Overwrite the name android to something that doesn’t already exist, like “/tmp/anderic”, being careful not to change the length of the file.
Restart your emulator.
I’ve just finished writing the big parts of usbscale, a command-line program written in C that reads and interprets data from USB scales. It was meant as a little hack for the Stamps.com scale, so currently it’s only set up to recognize the Stamps.com 10-lb scale (manufactured by Elane). It should be trivial to add support for more scales, though.
If you have a USB scale, please let me know!
You can find the software at usbscale on Github: https://github.com/erjiang/usbscale
An Ubuntu package of Petite Chez Scheme seems to be a common request among students, given the popularity of Ubuntu among the techno-capable. Currently, only RPM packages are provided on the Chez Scheme site, and the traditional recommendation was to use alien to convert the RPM into a .deb. There’s no reason to have everybody do this though.
I’ve built a .deb package of Petite Chez Scheme for amd64 (64-bit) Ubuntu 10.10. You should be able to install it by simply double-clicking the package and following the on-screen prompts. Petite can then be run using the terminal command `petite`.
Known issues: No package docs.
Update: I now have an improved C version of this program: usbscale.
I got suckered into one of those hard-to-cancel Stamps.com trials. The upside is that they give you a $10 USB 5 lb. scale to use with their software. The downside is that they want you to only use it with their software, and the company that makes the scale has since taken down their free USB-scale program.
So, this little Perl hack reads from the Stamps.com scale by accessing the
hidraw# interface that Linux provides. In my case, I have
hidraw4 hard-coded into the script itself. Basically, it loops until it reads a good value from the scale, at which point it prints out the weight and exits.
Edit: This code is now a Gist on GitHub.
Ubuntu’s partition editor, GParted, usually scans all the hard drives when it starts. However, in some cases, it will get stuck on this “Scanning all devices” step indefinitely. By knowing what hard drive you want to edit, you can launch GParted specifically for that hard drive. Either go into run or a terminal, and run “gparted /dev/sda”, where “sda”, “sdb”, “sdc”, etc., is the identifier of your hard drive, and GParted will launch and immediately open that particular disk.