I created an easy way to enable/disable one of the mice attached to my computer. When VirtualBox is running, that mouse is captured within VB (for my daughter to play with). However, when VB isn't running, I don't want that mouse interfering with my mouse, so I created a batch file to enable and disable it using Microsoft's devcon utility. Unfortunately, the legal way to get it is to download the huge WDK (Windows Driver Kit).

My wife's new HP Envy, which has Windows 8.1, doesn't have a way to disable its touchscreen or touchpad. So I wanted to use a variatoin of my script to do that as well. (In the end, I got the script to work for the touchscreen, but not the touchpad... which is run by a different kind of driver so needs a different method).

Under Windows 8, this worked in a simple batch file:

    devcon.exe enable "USB\VID_046D&PID_C501"

 

I did not even need to elevate to admin priveleges for that to enable/disable the mouse.

I updated to 8.1 last night and the batch file stopped working. Using the same batch file, devcon SAYS it enabled the device (below), but the mouse was actually NOT enabled if I tried to move it around (and vice versa if I enabled it in Device Manager and then tried to disable via devcon... it did not disable). I could enable/disable perfectly fine in the Device Manager GUI.

    USB\VID_046D&PID_C501\5&3514F6C9&0&1                        : Enabled
    1 device(s) are enabled.

 

I made sure I was using the x64 version of devcon on my x64 Windows 8.1. I tried doing it as elevated to admin rights as well as not elevated (both for the batch file and devcon itself). I also tried it in a few different compatibility modes.

I googled and googled and did not find anyone else having an issue with devcon on 8.1 and all of the example I saw matched what I was already doing.

I decided to read through the help screen again, and I saw the restart command. Once I put it after the enable/disable command, it started working. Finally.

    devcon.exe enable "USB\VID_046D&PID_C501"
    devcon.exe restart "USB\VID_046D&PID_C501"

 

The restart command requires elevation to admin rights. So I created two shortcut files to the batch file (one to enable and one to disable) and set the shortcuts to run as administrator. And then I use the shortcuts to run the batch file.
 
Tags

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.