(What is a Raspberry Pi? It's an inexpensive minicomputer, popular with hobbyists and educators.)

After doing several saving and restoring several images, I have found tools and a method that I'm happy with. I am using these with Raspbian, but they would work with other flavors, too.

Tools

Most instructions I found on the web say to use the Win32DiskImager. I used it a few times, and found it to not be particularly user friendly. In fact, it reverts back to the first device after completing an operation, which I didn't notice once and ended up unintentionally formatting the wrong drive, which was particularly UN-user-friendly (I still haven't finished cleaning up that mess). 

So then I stumbled across mention of the USB Image Tool in a forum post somewhere. This thing is awesome. FIRST, it is more selective about which devices it shows (also shows much more details about the selected device, and can optionally show more devices). ALSO, it can keep track of favorite images, for easy selection and restoral. ALSO, you can restore an image that is bigger than the target device (not all flash cards of the capacity are truly the same capacity). ALSO, it can automatically compress the image file (and also use it for restoral) so you can skip the zeroing step on the Pi. So that's four major pluses in my opinion. Additionally, there are a number of options that can enhance user experience. Why would anyone use the Win32DiskImager?

On the Pi itself, I use gparted to reduce the size of the main image of the SD card. This is necessary because not all SD cards of the same nominal capacity have the same actual capacity. Due to bad areas of the flash, etc. one flash card might be smaller than another. So we want the OS to only use the lower "safe" portion of memory, which we are pretty sure will be usable on all of our SD cards. So, use gparted to reduce the partition and move it all the way down against the boot partition. This process only needs to be done once. In the USB Image Tool, be sure to select the option to truncate oversize images. This allows us to write an image even if it's bigger, and we know it's going to be ok because we reduced the memory area that the OS actually uses (so the "oversize" area is not even valid in the image).

There's really only one tool needed on the Pi itself for the every-time preparation: BleachBit. I use this to reduce the size of the data on the Pi before creating a copy. It's really easy to use. Just select which items you want to clear and it does the rest.

Method

One-time: Reduce the size of the main flash partition (not /boot)

  * Use gparted (I reduce to 7500 megabytes on an 8GB SD card)

One-time: Remove unneeded stuff (all in sudo), only need to do this after initial Raspbian setup

  > rm -rf python_games

  > rm -rf opt     # code examples

  * (?) Remove development packages (may want to keep in some situations)

    > sudo apt-get remove `sudo dpkg --get-selections | grep "\-dev" | sed s/install//`

  * (?) Remove python (may want to keep in some situations)

    > sudo apt-get remove `sudo dpkg --get-selections | grep -v "deinstall" | grep python | sed s/install//`

  * Remove older gcc

    > sudo apt-get remove gcc-4.4-base:armhf gcc-4.5-base:armhf gcc-4.6-base:armhf

Save disk image

  * Select stuff to remove in bleachbit

    > sudo apt-get install bleachbit secure-delete

  * Fill freespace with zeros using secure-delete

    % Note: this can take a while and is not necessary if using USB Image Tool's img.gz

    > sudo swapoff -a  # turn off swapping

    > sfill -llz

  > sudo shutdown now

  * Create an image using USB Image Tool and select a type that compresses the image.

Selecting PHP command line version on HostGator shared host

This took me a while to find, so I'm saving it somewhere I can find it again.

The easy way to select the PHP version used for web applications is to use the CPanel configuration tool. However, that doesn't work if you're using SSH and need PHP on the command line. Also, on HostGator, you can't create a symlink outside of your directory (such as to the global php).

You can find out what version you have with

$ php --version

If that's not the version you want, try a specific version like this (php55 is 5.5, etc):

Book Scanning Process

 

Just to document this for next time. For reference, my books are 8 x 10.75 inches and other dimension below work for this. For approximately 100 pages, It takes me about 45 minutes to scan, an hour to crop and rotate, and 30 minutes to organize and generate the PDF.

Fixing features for hotfolder

Here is some documentation about the process I used to solve some issues with hotfolder and the features module. I was doing this partly through the web interface and partly through a console, so this is a reconstruction of what I remember and the console log. 

 

I was getting the following error message when I tried to check hotfolder watches (see https://www.drupal.org/node/2453659):

Notice: Undefined property: stdClass::$field_watch_config_scheme

 

GIMP for Kids

 

My daughter likes to draw on the computer. I don't remember exactly how it started, but she draws in GIMP using my Genius pen tablet, on my secondary monitor. I used to have Linux running in a VirtualBox with GIMP running on my second monitor for her, but VB doesn't completely work in Windows 10 yet. A while back I tried running GIMP on one of my Raspberry Pi's but it was just too sluggish to be useful, frustratingly slow for a (then) 3-year-old. It runs much better on a Raspberry Pi 2. It still lags if she goes crazy with a big brush, but it works.

Die Fly: Designing a better fly swatter

I was looking through some of my old stuff for something and ran across this gem. If you need to put together a quick flyswatter, try this one I designed for a class in college (the famous Rube Goldberg project).

Here are a few excerpts from the attached PDF. If this doesn't convince you to build one (perhaps with several improvements as noted in the document), I don't know what will.