Wednesday, December 02, 2015

Project: Dropbox Without Dropbox

I've been using Dropbox on and off for many years but lately I find I'm only using it for photo backup from my phone and it's starting to fill up. I don't really want to pay for it so there has to be a better way.

Enter BitTorrent Sync. I've recently got a Raspberry Pi2 so my old Raspberry Pi B+ is up for grabs for a project. I tried the free version of Sync and it looks polished and seems to do what I want. The cherry on top was their 50% off sale for cyber Monday. I jumped on that so I could do selective sync.

I'm not going to say I did this right but it seems to be working for me.

  1. Get a raspberry pi and install raspian. This is very easy with NOOBS as you don't have to do any disk imaging, just put the files on the SD card and follow the prompts. I'm going to assume you have done this before or can work your way though it.
  2. The pi doesn't have a hardware clock so make sure your ntp is working. BitTorrent Sync relies heavily on time so it needs to work. It should get setup on install but for some reason mine didn't. I was missing the ntp.conf file but luckily I could just copy that off my pi2 and I was off to the races.
  3. Install BitTorrent Sync. You'll need the ARM version listed under Linux. There really isn't much to install. Download the archive and unpack it. I put it in /home/pi/Sync. Then run ./btsync and that's it. You can then go to http://localhost:8888 to access the "gui".
  4. To get Sync to run on startup you'll have to add a script to /etc/init.d

    "sudo nano /etc/init.d/"

    Your script can be very simple:
    /home/pi/Sync/btsync --webui.listen #allows access to webui from other devices

    Make the script executable
    "sudo chmod +x /etc/init.d/"

    Add it to startup
    "sudo update-rd.d defaults"
  5. Add storage. I used a 16GB flash drive. It should provide me plenty of space for phone picture backups. It looks like my photos are around 3MB each so I should be able to backup around 5000 images.

    Plug your USB drive in and format it. Mine already had a partition so I just had to format it. "makefs.ext4 /dev/sda1". Your partition might not be at sda1 so you'll have to adjust the command.

    You'll want it to mount each time on boot up so you'll have to edit your fstab. First find the UUID of your drive with "sudo blkid"

    "sudo nano /etc/fstab"

    Add "UUID=     /media/pi/Sync (or whatever you want the mount point to be)   ext4    defaults   0    2"

    Do a reboot and check if it mounted. "sudo shutdown -r now"
  6. Assuming step 5 worked your drive will mount as root so you'll have to change the owner so you can write stuff.

    "sudo chown pi /media/pi/Sync"

    You can test if this works by trying to make a folder on the USB drive

    "cd /media/pi/Sync
    mkdir photos"

    If the folder is there then it's working.
  7. I'm going to have my Pi at a different location so I setup dynamic DNS on it. I like DuckDNS since it's free and I've been watching them since the idea first hatched on Reddit a few years ago.

    It's easy to setup. Just create an account, create a domain, it'll be and it may take a bit to find a free one. Go to their install page and follow the instructions for "linux cron". It basically just makes a cron job that runs every 5 minutes and updates their servers with your IP address.

That's the quick and dirty install. I wrote this mostly from memory so there might be some things missing. The next steps would be to install the sync app on your phone and setup syncing. I've got it setup on a computer at home that's always on, plus the raspberry pi, and my phone. This way I should have the pictures in two places all the time and I'll probably add the location to my Crashplan backup.

Tuesday, November 10, 2015

Lasagna Rollups

One of our favourite recipes at home is these spinach and cheese mini lasagnas. My wife first found the recipe on pinterest but I've made some changes to make it go further.

The original recipe calls for 9 lasagna noodles and I've found it can go much further if you add some extra cheese and just use more noodles.


  • 15 lasagna noodles, cooked
  • 1 package frozen spinach, thawed according to the package
  • 500g tub of ricotta cheese
  • 1/2 cup grated parmesan cheese
  • 1 egg
  • pepper
  • 680ml can pasta sauce. This is the size of hunts pasta sauce. YMMV.
  • 1 bag of italian blend shredded cheese. These are usually in the 320g range. More is better though.
Preheat the oven to 350F. Start cooking the lasagna noodles but don't cook them as long as the box would suggest. I like to do a "super al dente" so I usually go one minute shorter than the box says. This will help them keep their shape after baking. Put the spinach in the microwave to start thawing, this usually takes about 7 minutes total so it should be done about the same time the noodles are.

When the noodles are done I like to lay them out on cooling racks. This will make them cool enough to work with and usually most of the water will dry off of them. You want them dry on the surface so they are a bit sticky, it helps with the rolling.

Get a 9 x 12 baking dish and put about a cup of the pasta sauce in the bottom.

In a bowl combine the spinach, ricotta, parmesan, egg, pepper, and about 1/4 of the shredded cheese. Mix this all up.

Get a piece of wax paper and put it on the counter or wrap a cutting board in it. This will be your assembly station. Lay out a noodle and spread an even layer of the spinach mixture on it. How much? You're going to have to estimate. You need to do this 14 more times and you don't want to run out of mix. Roll each noodle and place it seam side down in the pan. Repeat this until you have 15 nice little bundles in the pan,

Take the remaining pasta sauce and spoon it over the lasagnas and then sprinkle the remaining cheese over them. Cover in tin foil and put in the oven for 40 minutes. If the cheese on top isn't melted after 40 minutes, uncover and put under the broiler for 3-5 minutes.

Laying out the cooked noodles on cooling racks

Filling all mixed up

Spread the filling on a lasagna noodle. Don't worry about getting it even. When you roll it up that'll even out the filling

Putting the rolls in the pan

All 15 rolled up

Covered with pasta sauce and cheese

Fresh out of the oven and cooling.

Sunday, November 08, 2015

Backdrop Storage System

My wife is a photographer and has a growing collection of backdrops that are basically just sitting around getting ruined. She saw the following image on Pinterest and asked me to build one.

It seemed simple enough. Just some PVC pipe screwed into some 2x4's hung on the wall. I measured some of her backdrops while they were rolled up and 3" PVC seemed like it would do the trick. I didn't think 2x4's were required and they would stick out too much so I went with 1x3.

It turns out the 3" pipe caused me a bit of an issue. I've got an old dewalt radial arm saw but its only 10" so I can't cut through the pipe in one shot. Luckily some careful blocking on the saw makes it so I can get a pretty good cut. I cut the pipe into two inch sections.

I figured the easist way to mount these would be to drill a hole all the way through so I could get a drill and screw in from the top. This would also make sure that everything was true and would result in a nice mount. Like the saw my problems came down to tools. My drill press only has a two inch throw so I can't drill down through a three inch pipe in one shot. I ended up just drilling a hole in the top so I could screw them in. I just let the screw do the work making the other hole.

I made a simple jig on my drill press to make sure all the pieces had the hold drilled in the same place. The long piece of wood was to stop the pipe from jumping up when the bit broke through. It worked pretty well and I got through all 28 pieces much faster than I expected.

Some #8 3/4 inch screws hold the pieces of pipe to the 1x3's. Ideally I would have liked to get the holes counter sunk a bit so the screws were flush with the inside of the pipe but I had no good way to do that. The screws sunk in a bit and they have no sharp edges so it seems like it'll be ok.

Here is the finished project.

There is some space at the top and the bottom of each board so I used some 2 inch screws to screw them into the studs. The spacing worked out OK since three studs are 48 inches apart and that was the minimum size required for the smallest backdrop she had.

I didn't finish the outside of the pipe or boards, my wife didn't care and it saved me a bunch of time. Originally I was going to hit the PVC with some Krylon fusion white paint and maybe stain the pine but if she's good with it, so am I.

I'm pretty impressed with how it turned out. I really think if I had a 12" saw and a bigger drill press I could have made a much cleaner product. Good enough for a weekend project.

Sunday, November 01, 2015

Trailer Hitch Install

Today  I did an install of a Curt Manufacturing 13364 hitch on my 2013 Dodge Grand Caravan. I was going to try to find a different one because the instructions on this one mention that you have to trim the bumper on some models. It appears that is only for the Town and Country and I didn't need to trim on my Caravan. I did the install by myself in my driveway with the van on oil change ramps. Maybe not ideal but it worked pretty well. There are a couple good videos on YouTube that were very helpful. I felt pretty familiar by the time I got under there.

Curt manufacturing has a video.

And has one. This one is for a hidden hitch brand but they appear virtually identical.

They've disabled embedding the YouTube video but here is the link.

It's pretty straight forward. You need only basic hand tools. I didn't feel like getting out my big impact for the 18mm bolts so I just used a breaker bar.

Here are the tools I used:

  • 1/2in drive breaker bar and 10 inch extension
  • 1/2in drive torque wrench. If I had a 3/8 drive I would have used that also but more on that later.
  • 3/8in drive ratchet and 10 inch extension. I don't own a 1/2 drive ratchet right now.
  • 13mm socket to remove the exhaust hangers
  • 15mm socket for the rear most bolts
  • 18mm socket for the other bolts Two on the drivers side and one on the passenger side. **Note** this isn't a regular size as far as I know. None of my sets had one so I went out and bought one in each 3/8 and 1/2 drives.
  • Universal joint to get to the 18mm bolt above the muffler.
  • Jackstands to hold the hitch while you get a bolt or two in. You wouldn't need these if you have a helper.
  • I did grab my cordless impact but it didn't have enough torque to do much other than take the exhaust down.

All the tools laid out with the instructions. The instructions were pretty good but the videos make it easier.

The three drivers side bolts. 1 x 15mm and 2 x 18mm. Remove all three. When I reinstalled them the forward most 18mm wouldn't go in so I had to use a screw driver to align the hole. I think whatever the nut is on moved, the bumper maybe? It was easy enough to line back up and get the bolt in.

The passenger side is a bit harder to deal with. This is the 15mm that needs to come out and there is a 18mm right above the muffler. Even with the exhaust lowered I had to use an universal joint to get to the bolt. My 1/2 drive socket was 12 point so it wouldn't get a good grip on it with the universal. I had to use my 3/8 since it was six sided. Unfortunately I didn't have a 3/8 torque wrench so this bolt didn't get torqued. It's 86ft-lbs so I just got it as tight as I could with the short handle on my ratchet. A case of good enough I guess. There always has to be one of those bolts.

The 15mm is only supposed to get torqued to 48ft-lbs but my torque wrench doesn't go lower than 50. I kind of wish I had a 3/8 but an extra 2 ft-lbs won't make any difference.

The passenger side is pretty tight.

All installed.

A couple overview shots. This project is very doable for anyone that changes their own oil since there are no holes to drill and all the bolts used are already on the van.

It'll likely be a while before the hitch actually gets used. We plan to get a small tent trailer in the next few years but I thought it would be much easier to install this before our Canadian winters made everything under the van rusty and crusty. I haven't looked into the wiring much but as far as I know I'll require a brake controller. I'm sure that'll be a pile of fun.

So all in this took me about 45 minutes to an hour. It probably would have been faster if I didn't have to stop and run out to get some 18mm sockets. The hitch cost $215 shipped from They were slightly more expensive than but since the shipping was free that saved me a bunch. All in I spent about $275 because I needed two 10 inch extensions, two 18mm sockets, and two universal joints. I also picked up a 5/8 hitch pin and a plug for the receiver opening. I probably could have bought just 1/2 drive sockets and extensions but I'm glad I grabbed the 3/8 because of that bolt behind the muffler.

I like doing this stuff so it was a nice way to spend a Sunday afternoon. Now if only it was sunny and warm instead of cold and drizzle.

Wednesday, October 28, 2015

Painting Winter Rims

So I decided to have some fun with my winter tires this year. Whatever paint Kia uses on their factory rims is terrible. I'm pretty sure they just colour them with a sharpie because the "paint" does almost nothing to stop the rust. I decided to hit them with some rustoleum and see what happens.

I don't have pictures of the whole process but I washed the rims down with dish soap to degrease them and then hit them with a wire cup brush on a drill to get rid of most of the rust and to finish I sprayed them down with simple green and rinsed with water. The sun took care of the drying. Next I masked them off, which was actually quite tough. I was using some cheap green painters tape and it didn't like curves. The best results were obtained by using lots of short pieces.

As you can see below my masking got better as I went. I started with the right most tire so it's the worst looking. A friend told me that a deck of playing cards wedged between the wheel and tire works very well.

All painted up.

Back on the car. I think it's gives it a fun rally look. Either way it's more interesting than black.

Three sets of summer tires in the garage waiting for spring.

Friday, October 23, 2015

It worked!

Well it took two weeks but I've finally got a dinosaur time lapse for you. This was taken with the camera module on a raspberry pi 2 over 5 days. It's 1201 frames at 24fps. I couldn't encode it on windows, it kept running out of memory (shocked!) so I used libav to do it on Ubuntu.

I'm not sure what's up with the horizontal lines, it might have something to do with the CFL bulb that I used to light the scene or it could be something totally unrelated.

Was this worth two weeks? I'm not sure but it was fun none the less.

Tuesday, October 20, 2015

The Model M Lives!

I picked up a PS/2 to USB converter today for about $6 and now I can easily use the model M on a modern computer. The only downside is it doesn't have a windows key, a key I use all the time. I've found lots of people online that are re-mapping the caps lock key to be a windows key. This seems like a pretty good compromise.

I found a registry key that'll do it for me.

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,5c,e0,3a,00,00,00,00,00

Just save that as a .reg file, run it, and reboot. The regular windows keys still work too.

Sunday, October 18, 2015

Try, try, try again

Well the first timelapse didn't work out because of some technical difficulties. This time I'm trying with my raspberry pi 2 and we'll see how that goes. I had it capture a 12 hour timelapse last night and it didn't drop off the network. We'll see how 5 days treats it. Luckily I had a second egg. This one is cracked all the way around so who knows if this is going to work very well.

Friday, October 16, 2015


I've been making home brew with one of my co-workers for a while. We've made about a half a dozen batches and bottling is a bit of a pain. He got a Danby kegerator and decided to make it a two tap system. I don't have any pictures of the process but it was pretty straight forward. We mounted the tower to the top, put the taps on, plumbed the gas side, and plumbed the beer side. After we put the beer in the kegs we set the CO2 pressure and it is good to go. The beer needs to sit under pressure for a week to get properly carbonated but it's still faster and easier than bottling.

I think it turned out pretty well.

In about a week we'll see if the red ale and IPA are any good.

The Ultimate Mechanical Keyboard

We cleaned out some old locations at work and found some goodies. Some were interesting but useless like the original manual for an IBM XT PC from 1983 and a manual for MS Basic from 1982 but the money was 4 IBM model M keyboards.

Those are basically the holy grail of mechanical keyboards. Buckling spring switches make for some awesome tactile feedback and some great sound to annoy your co-workers. Luckily they were the PS/2 versions so it's pretty easy to adapt them to modern computers.

I've got a reputation at work for being a keyboard snob. I can't help it if a quality keyboard makes typing a little better. I use a Das Keyboard Professional S at work with brown Cherry switches. I've put o-rings on the switches to dampen the sound a bit. I think it's at a livable level but if they ever complain about the noise I'll just start using the model  M and they'll forget all about my browns!

Saturday, October 10, 2015

Dinosaur Timelapse!

The reason I was testing out timelapse with the raspberry pi is I had a project in mind. My wife bought these hatching dinosaur eggs for my son's birthday party and it was pretty neat. You put it in a container of water and it took about 4 or 5 days to hatch. I figured that was a perfect opportunity to try this out.

I'm betting on 5 days but to hedge my bets I've doubled the amount of images I'm going to capture. So instead of assuming 10fps I'm doing 20fps. That way if the egg hatches twice as fast as I expect then I'll still be able to make a usable video. If it takes the full 5 days then I should have a smoother video. In case you're wondering 5 days is 432,000,000 milliseconds.

Here is the setup:

It took me about 5 attempts to get started. I initially just ssh'd in from my ubuntu box but I got worried thinking about the amount of time this is going to take. There is an option in putty to send a keep alive packet so the connection doesn't time out but I'm pretty sure if putty crashed I'd still lose my running proccess. I did some googling and decided to skip screen and use tmux instead. This way I can fire up my remote process, detach from it, and close my ssh window. If I want to reconnect I just ssh back in and type 'tmux attach' and it will attach me back to the running session. Pretty sweet. So as long as the raspberry pi doesn't freak out in the next 5 days I should be good. I can periodically check in and make sure it's still writing image files to make sure it's still going.

Here is what the first image looks like. It's a little out of focus because of the space I had to work in. They're just too close together.

A little distortion from the glass but I'm hoping it'll still work. I'll try and post updates as it goes.

Bad news. I know I promised updates but my pi has decided it doesn't want to be on the network anymore. For some reason the wired ethernet has disconnected from the network and now I can't ssh in. I plugged in a monitor and it looks like it's still taking pictures so I'm going to leave it but it's going to be a surprise when I finally get to see the images.

Final update. Very bad news. It looks like when the pi dropped off the network it must have frozen because I didn't get more than about 30 pictures and they all look like the image above. I think I'm going to try again with my Pi2. I'm letting it run right now to see if it stays on the network for a while. If it's still up tomorrow I'll try to redo the egg hatching.

Friday, October 09, 2015

Raspberry Pi Timelapse

I'm fascinated by timelapse photography and I'm also fascinated with single board computers. Luckily the Raspberry Pi makes it easy to mix these two interests. I use a Raspberry Pi model B and the camera module to take a bunch of still photos and then turn that into a video with software.

The video below is over 3 hours looking out my basement window. It faces north so you get lots of great shadows running across the house across the street. Unfortunately my setup was a bit unstable and it moved down a bit to show the window frame. This is just a test so it's not super important. I just wanted to make sure I had the command right and that everything worked.

My setup is the raspberry pi running raspian with the camera module connected and enabled in the configuration.

Keep in mind it's just a test so try to ignore the kleenex box.

The command to capture the images is:

raspistill -vf -hf -w 1280 -h 720 -o time_%04d.jpg -tl 18000 -t 1080000
-vf is vertical flip since my camera is upside down
-hf - horizontal flip since the image is mirrored
-w - width. The native resolution is quite high so I just capture at 720p resolution
-h - height
-o Output file name and location. %04d tells it to use a 4 digit incremental number to name the files
-tl - duration between images. If this is low, say under 2 seconds you may want to use -bm for burst mode. This keeps the camera active and you'll have fewer dropped frames
-t - total capture time. These are both in milliseconds so in the above example I was taking an image every 18 seconds for 3 hours which gives me 600 images and at 10 frames/second that is a 1 minute video.

If you have a monitor connected you may want to use the '-n' switch that prevents a preview from being displayed.

So how did I decide on my shot interval? Well I use an online calculator. I know that 10fps is good enough and I picked 1 minute as the final length so a little math or the online calculator will tell me to take an image ever 'x' seconds. You could go up to 24fps and take more images but 10 seems to work pretty well.

So now that you've got the images how do you make it into a movie? If you have access to them you can use quicktime pro quite easily or Adobe premier but I'm poor and don't have either of those. If you want you can do the encoding right on the raspberry pi with libav. It takes a while but it does work. Here is the command:

avconv -r 10 -i myimage_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 timelapse.mp4
I stole these settings from Raspberry-Spy and they seem to work. This is also where I found that 10fps was good enough.  The catch with avconv is the files need to be consecutive. Sometimes raspistill will drop a frame so you'll be missing that file and that will cause avconv to die. You can fix this with a quick bash script.

for i in *.jpg; do
new=$(printf "%04d.jpg" "$a")
mv -- "$i" "$new"
let a=a+1

This will take all the jpegs in a folder and rename them in consecutive order.

You'll need to install libav on Raspian if you want to do it this way. Apt-get install libav-tools should do it. If you do the conversion on another machine Ubuntu has libav installed by default I believe.

An easier way to do it for free is to use Windows Movie Maker. It's a free download from Microsoft and it's a little more user friendly if you like GUIs. Install and fire up Movie Maker and then add your photos. You're basically making a slide show but luckily you can set very short durations.

 You'll have to do some math to determine the duration you need. Here are a couple to get you started.

10fps = 0.1
25fps = 0.04 - can't do exactly 24fps

After you've got that set go to the file menu and choose to save your video. If you pick Android medium that'll give you a 1280x720 mp4 video.

One last thing I'll touch on, what if you don't have the camera module? Well you can use a USB webcam. I can tell you from experience that it doesn't work as well. I'm not sure if it's lack of horsepower on the pi side or what but I had to use very low resolutions to get it to work properly. The upside, motion, the software I used can do timelapse directly to a video output. That sure streamlined the expereience.

So that's the crash course in raspberry pi timelapse. I hope you enjoyed it and hopefully found it useful.

Cheese Beer Bread

It's no secret that I'm a huge Alton Brown fan, I even got to meet him once, and I like to try his recipes from time to time. Today I'm giving his cheese beer bread recipe a shot. On Good Eats he recommended a hoppy pale ale so I grabbed my last home brew IPA and I'm crossing my fingers.

The bread is in the oven and hopefully I'll remember to take a picture of it.

Well it turned out pretty well I think.

Overall this was a pretty good recipe. It was easy to make and I had everything on hand to make it. I used bread flour instead of AP because I like to and I always have it on hand. For beer I used a homebrew IPA that is very similar to New Belgium's Ranger IPA. I think the pine flavours in the beer worked really well with the dill in the bread. I also shredded too much cheese, I put about 5.5 oz in instead of 4.5 but too much cheese is never a problem. I think the best part is how fast it is to make. I had the dough ready by about the same time that my oven finished pre-heating.

Tuesday, October 06, 2015

Harvest Time

When we moved in I wanted a garden so I had one roto-tilled and then I did nothing with it. The kids came and there was no time to get out there to do weeding, etc. This year I was determined to grow a garden. I put in random potatoes that I got from friends, carrots, corn, radishes, spinach, and sunflowers. Well the sunflowers didn't come up but the rest did. It's getting pretty late in the year so I'm under the gun to get the carrots and potatoes out. I was going to do them this past weekend but the rain prevented that. I dug them last night and washed them up in the garage.

Nothing reminds me of being a kid more than the taste of carrots right out of the garden with a bit of dirt still on them. I'm going to assume the dirt helps me get vitamin B12.

Got the potatoes out and washed. Here is the whole harvest.

Not as many potatoes as I expected but I probably threw away 5 or so pounds because they were green from the sun. I'll have to do a better job of hilling them next year.

Monday, October 05, 2015

Deer Mounts

I'm not an avid hunter but I've gone every year for about the last 7 and I'm finally getting a couple mounts done. My father-in-law does taxidermy as a hobby but I think his work is better than most professionals I've seen.

I shot this whitetail deer in 2010 and the mount is almost finished. He's got to do some touch ups and final work but it's almost there. Five years is a long turn around time but I can't complain about free work. It's well worth the wait.

Last year I got drawn for mule deer and shot an amazing animal. I was about an an inch away from making the provincial record books for that year. You need to score 175 and mine scored something like 173 5/8, so it was pretty darn close.

A photobomber jumped into the second picture there. He's going to be out hunting soon I suspect.

Saturday, October 03, 2015

Another weekend project

My wife wanted a new tall shelf for the living room so I suggested we try using two short shelving units and making one large one. I bought some dowel pins and a couple straight brackets and got to work.

I think it turned out OK. I removed the bottom shelf and kick plate off the top unit to avoid having a weird double shelf but the downside is now the backing is not long enough. I'm going to leave it for now because we can use it as a cord pass through for a couple things that'll be on that shelf. I've still got to sand it and paint it as well. That's a tomorrow project.

Sunday I got some more work done on it. I picked up some wood glue so I could glue all the dowels in and started painting.

The temperature was at the minimum for the paint I was using so I hope it turns out ok.

Monday night I washed carrots and got some more paint put on.
I'm not sure what the blue glow is. Perhaps it's Cherenkov radiation.

Some fancy hi-tech lighting system I put up
I realized I didn't paint the removable shelves so I have to go buy more paint, d'oh!

Picked up some paint at lunch today and got the shelves painted tonight.

A disaster though. Put a final coat on the main chassis and had some paint buckling. I must have got it on a bit too heavy and the solvents in the fresh paint screwed up the base.

I'll let it dry and sand it a bit. It had to be on the front left corner, the one that is going to be most prominent when they are in the house.

It's now 10 days after I started this project and it's finally in the house and looks pretty good. I fixed the wrinkled paint by sanding it down and cleaning the area with denatured alcohol. One of the upsides is I gained an extra shelf because I took the bottom out of the top unit when I stacked them.

I think it looks pretty good. After 4 cans of paint I don't know if this ended up being cheaper than buying a new taller shelving unit but at least this way we didn't have to throw these ones in the landfill. That's got to count for something.