Bazaar is great on Windows. Several years later, git's tools for Windows still.... (ahem) are lacking or too commercial. However, official development on it has ended and git is so much more popular now. So I think the time has come to convert all my beloved bzr repositories to git.

First we need note some prerequisites:

  • Bazaar
  • Git (msysgit flavor)
  • Hstart (you could do it without, but the script uses it, as written)
  • TortoiseGit (not strictly necessary, but it's my preferred way of using git repositories)

Get all those installed and then we can use the script attached.

The output looks like this:

Found a bzr repository in...
   F:\CodeProjects\ExportPDF-01\

Press [Enter] to open a git shell and continue.

Welcome to Git (version 1.9.4-preview20140929)

Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
/f/CodeProjects /f/CodeProjects/ExportPDF-01
/f/CodeProjects/ExportPDF-01

This script creates a git repository from a bzr repository.

Affected directory: ExportPDF-01
                in: /f/CodeProjects/

Initializing git repository in /f/CodeProjects/ExportPDF-01 ...
Initialized empty Git repository in f:/CodeProjects/ExportPDF-01/.git/
Converting...
16:06:28 Calculating the revisions to include ...
16:06:28 Starting export of 3 revisions ...
G:/Programming/Bazaar/plugins\fastimport\exporter.py:557: DeprecationWarning:
bzrlib.revisiontree.InventoryRevisionTree._get_inventory was deprecated in version 2.5.0.

16:06:28 Exported 3 revisions in 0:00:00
G:\Programming\Git\libexec\git-core\git-fast-import.exe statistics:
---------------------------------------------------------------------
Alloc'd objects:   5000
Total objects:       65 ( 6 duplicates )
       blobs :       42 ( 5 duplicates    18 deltas of    41 attempts)
       trees :       20 ( 1 duplicates     6 deltas of    20 attempts)
      commits:        3 ( 0 duplicates     0 deltas of     0 attempts)
        tags :        0 ( 0 duplicates     0 deltas of     0 attempts)
Total branches:       1 ( 1 loads     )
      marks:       1024 ( 3 unique    )
      atoms:         38
Memory total:      2294 KiB
       pools:      2098 KiB
     objects:       195 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =     65536
pack_report: core.packedGitWindowSize =  33554432
pack_report: core.packedGitLimit      = 268435456
pack_report: pack_used_ctr            =        15
pack_report: pack_mmap_calls          =         8
pack_report: pack_open_windows        =         1 /          1
pack_report: pack_mapped              =     36961 /      36961
---------------------------------------------------------------------

Creating .gitignore from .bzrignore...
Cloning repository...
Cloning into 'f:/CodeProjects/ExportPDF-01-clone'...
done.

Creating dummy remote folder (locally)...
------------------------------------------------------------------------------

             Total    Copied   Skipped  Mismatch   FAILED    Extras
   Dirs :       34        34         0         0        0         0
  Files :       78        78         0         0        0         0
  Bytes :  264.4 k   264.4 k         0         0        0         0
  Times :  0:00:00   0:00:00                      0:00:00   0:00:00

  Speed :            2820656 Bytes/sec.
  Speed :            161.399 MegaBytes/min.
  Ended : Saturday, November 8, 2014 4:06:29 PM

Fetching into remote folder...
From f:/CodeProjects/ExportPDF-01-tmp
* [new branch] master -> origin/master
Already on 'master'
Your branch is up-to-date with 'origin/master'.

Copying .git from dummy folder back to repository...
cp: `/f/CodeProjects/ExportPDF-01-clone/.git/objects/pack/pack-d642dfcb49971e8a979d2f266f4f67dc0247e32b.idx' and `/f/CodeProjects/ExportPDF-01/.git/objects/pack/pack-d642dfcb49971e8a979d2f266f4f67dc0247e32b.idx' are the same file
cp: `/f/CodeProjects/ExportPDF-01-clone/.git/objects/pack/pack-d642dfcb49971e8a979d2f266f4f67dc0247e32b.pack' and `/f/CodeProjects/ExportPDF-01/.git/objects/pack/pack-d642dfcb49971e8a979d2f266f4f67dc0247e32b.pack' are the same file

Cleaning up...
error: tag 'origin/HEAD' not found.

Error at git
Continuing from next operation...

error: tag 'origin/master' not found.

Error at git
Continuing from next operation...

Press [Enter] to continue

 

The errors at the end can be ignored. You'll want to check the new git repository before deleting the bzr folder.

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.