‘vagrant ssh’ errors

I picked up a copy of Learning Puppet 4 shortly after publication and went through some of the examples and exercises. Pretty straightforward, although there were a few glitches in the examples, as is typical with any fast-moving technology. The book’s errata addressed all of these, as far as I recall.

So now it’s about two years later, and I wanted to revisit the learning environment. Of course there have been updates to just about everything, so my first task was updating VirtualBox, Vagrant, Xcode (I’m on a Mac), the learning repository, and the vagrant plugin. After going through all that, I tried to start up the first client VM:

$ vagrant up client
Bringing machine 'client' up with 'virtualbox' provider...
(lots of output omitted)
==> client: Checking for guest additions in VM...
==> client: Setting hostname...
==> client: Configuring and enabling network interfaces...
    client: SSH address: 127.0.0.1:2222
    client: SSH username: vagrant
    client: SSH auth method: private key
==> client: Rsyncing folder: /path/to/learning-puppet4/ => /vagrant
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /path/to/learning-puppet4/
Guest path: /vagrant
Command: "rsync" "--verbose" "--archive" "--delete" "-z" "--copy-links" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 2222 -o LogLevel=FATAL  -o ControlMaster=auto -o ControlPath=/var/folders/6s/_lvgcgf10395112fqhvwlr1hv5_gdx/T/ssh.804 -o ControlPersist=10m  -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i '/path/to/learning-puppet4/.vagrant/machines/client/virtualbox/private_key'" "--exclude" ".vagrant/" "/path/to/learning-puppet4/" "vagrant@127.0.0.1:/vagrant"
Error: channel 0: open failed: connect failed: Connection refused
stdio forwarding failed
ssh_exchange_identification: Connection closed by remote host
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]

Just before I ran vagrant up, I had been re-reading the book’s section on the vbguest plugin, and I got fixated on this:

In particular, this plugin helps avoid problems that happen when a new kernel is installed, such as the /vagrant shared mount not being available.

So I thought vbguest might be the cause of my problem. (Hint: it wasn’t!) I spent an inordinate amount of time deleting and re-installing everything, multiple times. When I finally hit upon the obvious idea of copy/pasting that very long rsync command into a terminal window, I quickly zeroed in on the underlying issue: my ~/.ssh/config file’s default settings will only work with the servers I manage for my employer. (Settings which I implemented after I had originally set up my ‘Learning Puppet 4’ environment.) I’m not going to go over the details, but as soon as I suspected that this might be the problem, it was pretty easy to verify:

$ mv -i ~/.ssh/config{,.save}    # Move config file out of the way

$ vagrant destroy client
    client: Are you sure you want to destroy the 'client' VM? [y/N] y
==> client: Forcing shutdown of VM...
Connection to 127.0.0.1 closed by remote host.
==> client: Destroying VM and associated drives...

$ vagrant up client
Bringing machine 'client' up with 'virtualbox' provider...
(lots of output omitted)
==> client: Rsyncing folder: /path/to/learning-puppet4/ => /vagrant
==> client: Running provisioner: shell...
    client: Running: inline script

At least I didn’t get an error on rsync this time! Now to test logging in:

$ vagrant ssh client

You should start by enabling the Puppet Labs Puppet Collection 1 release repo
   sudo yum install http://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm

Then install Puppet Agent and its companion packages
   sudo yum install -y puppet-agent

[vagrant@client ~]$ 

Success!

I’ve restored my original ssh config file, with a new Host section for the learning environment’s virtual machine. I may need to add more Hosts for the other VM’s, but hopefully I’ll remember to check here for hints if I run into this issue again.

The ssh options that I find most useful for diagnosing problems are -v (or -vv or -vvv) for verbose protocol status while initiating and breaking a connection, and -G which causes ssh to print its configuration after evaluating Host and Match blocks. To enter these options as part of a vagrant ssh connection, specify them after the target like so:

$ vagrant ssh client -- -G
Posted in FreeBSD | Tagged , , , , , , | Leave a comment

Coffee roasting

Last year my wife bought me a countertop coffee roaster, and I’ve been hooked on home-roasting coffee ever since. Lately I’ve also been roasting in our convection open, which works great for medium- to medium-dark roast. (I use the countertop roaster for light- to medium-roasted coffee.)

Here’s a typical oven roasting session. Prep the house by opening several windows, because this will generate quite a bit of smoke! I pre-heat the convection oven to 500 °F (260 °C), the max for our oven. I also have some baking stones in there to help maintain an even temperature.

Green coffee, ready to roast

Load a perforated baking sheet (~12 x 18 inch) with about 12 oz (350 g) of green coffee — today I’m roasting Sweet Maria’s GCX-5443, Ethiopia Gera Jimma Nano Challa Co-op, my current favorite for medium-dark roast.

The coffee being roasted today

Put the loaded roasting pan into the oven, and listen for “first crack” (when the first coffee bean audibly pops open). Usually that’ll be about 5:00 minutes for me. About a minute later, it’s time to rotate the pan–this helps the coffee roast more evenly.

Beans mid-roast

Ten minutes or so into the roasting process, I’ll start to see a bit of smoke coming from the oven. At that point, it’s time to start checking the coffee every minute or so. I pull the pan out of the oven just before I think the beans look “done”, because they’ll keep roasting a bit more from their internal heat. I pulled this batch out after 11-12 minutes. (I forgot to check the time.)

Untitled

Now comes the hardest part: getting the 500-degree coffee beans from the pan into a colander. Then I take this and another colander outside, and pour the beans from one colander into the other. This helps the beans air-cool quickly, and also releases most of the chaff. Once the beans are cool enough to touch, I put them into a vented container and let them cool completely.

My coffee roasting guidebook

For more information on roasting your own coffee, check out Home Coffee Roasting: Romance and Revival by Kenneth Davids.

Posted in Recipes | Tagged , , | Leave a comment

Finally moving to https!

I haven’t been using my blog lately because I’ve been trying to find a reasonably-priced service that offers encrypted web connections, i.e. https://example.com. A few weeks ago my current hosting provider, Pair, started offering that as a free service. Woot! I’ve now got that set up, including a permanent redirect from http->https. I found redirect-checker to be pretty helpful in validating my redirect rules.

I’ve spent some time upgrading my site, which unfortunately broke some of my plugins. I switched to a new recipe plugin, WP Recipe Maker. But I haven’t found a way to use the free version of this tool to import my old recipes automatically. I’ll probably just go through my recipes and reformat them manually. Sounds tedious, but it’ll be a good opportunity to look through them all again.

Another plugin that broke was my markdown formatter. This has left a bunch of raw markdown in some of my posts, but that’s pretty easy to fix. one. post. at. a. time. le sigh

Posted in Uncategorized | Tagged , | Leave a comment

Viruses and OSX Time Machine

Argh! I did a full scan of my Mac and discovered a virus on the Time Machine volume. I wrote about this a few years ago, and the tweaks to my mail/anti-virus/Time Machine work flow have served me well. But I guess a virus slipped through the cracks somehow, and it’s kind of a pain to eradicate an infected file within the Time Machine software — First problem is the viruses are normally attachments, which are stored within the ~/Library folder, which is normally hidden. Second issue is the Time Machine interface, which (as far as I know) precludes using Spaces and app switching. And finally, the mail attachments are buried deep within the directory tree with somewhat meaningless path names. But it finally occurred to me to copy the offending path from the antivirus log file then go into Time Machine and paste it into the search bar. After that, it’s just a matter of scrolling back in time until you find the most recent backup with the infected file. If the file is from a really old TM backup, just take a look at the backup date/time in the path from the antivirus log to home in on it within Time Machine.

I’m using the free Sophos antivirus software. To open the log (after doing a virus scan), go to the menu and select Scan -> View Scan Log. The infected file(s) should be listed at the end of the log. For infections that are only on the Time Machine volume, the path will look like this:

/Volumes/TimeMachine/Backups.backupdb/(MACHINE NAME)/(BACKUP DATETIME)/Macintosh HD/Users/(USERNAME)/...

(Assuming you didn’t rename either the TimeMachine or ‘Macintosh HD’ volume names.) Copy the elements of the path following your username. Then start the Time Machine app. Go to the search bar (top right of the TM Finder window) and enter ‘~/’ and paste in the path you copied from the antivirus log. Scroll back to a backup in which that file exists. (You can zoom in on the correct time frame based on the date/time shown in the full path from the antivirus log.) Once you find any copy of the file in Time Machine, select the “Delete all copies of Such-and-Such file” from the action menu.

Posted in Mac OS X | Tagged , , | Leave a comment

ISS Above installation via Mac OSX

I recently backed the ISS Above wearable project on Kickstarter, which got me thinking about (and tinkering with) my first ISS Above. What is it? Just a super-cool little widget that you can build on top of a Raspberry Pi which will notify you when the International Space Station is about to pass over your location.

ISS-Above on a Raspberry Pi, showing the ISS will soon pass almost directly over my house.

Unfortunately, when I tried to update my ISS Above, I wasn’t able to successfully write to the old SD card in my RasPi. Not the first SD card that I’ve roached, and I have most of the data from the old card. So I thought I would take this problem opportunity to write up the steps I use to [re-]build an ISS Above gizmo using my Mac.

Items needed:

  • Raspberry Pi computer, complete with 8 GB SD card, power, and case. As far as I know, any model of RasPi will work.
  • Wired network connection, at least during setup. (I’ll show how to migrate it to wifi below.)
  • One of the supported display options. I’m using the PiGlow in this case.
  • An SD card writer/reader. I like the itty bitty one that AdaFruit sells.
  • The ISS-Above code. I have the HD version, which allows the Pi to show live video from the ISS.
  • Pi Filler app, from Ivan’s RasPi site. While you’re there, grab Pi Copier and Pi Finder.

Steps (edited–one of the Bootstrapper packages seems to be interfering with ISS-Above):

  1. DON’T plug in the SD card/writer yet. You’ll be prompted for that in a moment.
  2. Get the ISS Above image (unzipped) onto the Mac. I had trouble unzipping on OSX, so instead of fixing whatever the problem was, I took the easy way out and unzipped on a PC.
  3. Launch the Pi Filler app to write the ISS Above image to an 8 GB SD card. It will prompt you for your ISS Above image file, (e.g. ~/Downloads/issaboveV2015-10-02-14-MASTER.img), and tell you when to insert the SD card/writer. This will take a while, possibly up to half an hour depending on all of your hardware. It took about 10 minutes on my system. I’m pretty sure the Pi Filler unmounts the SD card when finished.
  4. Insert the freshly-written SD card into your Pi, hook up your network cable, and power it up!
  5. Wait about 30 seconds for the Pi to finish booting.
  6. (Optional — If you don’t know how to set up DHCP addresses on your network, skip this step.) Fire up Ivan’s Pi Finder app. This has a handy “Copy MAC address” button. Configure your new wired DHCP address (and restart the DHCP server if necessary), then reboot your Pi to pick up the new address.
  7. It’ll take about a minute for the Pi to reboot and start the web server. Point your web browser
  8. Use Adafruit’s Pi Bootstrapper to install some useful software. Just run the following command on an OSX Terminal window:
    curl -SLs https://apt.adafruit.com/bootstrap | bash
  9. Bootstrapper took about 10 minutes on my system. Once that was done, I logged in via ssh (using Pi Finder again) to edit /boot/occidentalis.txt and set up my hostname and wifi credentials. (I could also have done this in advance, but I didn’t have the wifi password handy at the time.)
  10. Shut down the Pi: sudo shutdown -h -P now
  11. Plug in the wifi dongle. Be sure to leave the wired network connected for the time being.
  12. (Another optional step.) Power up the Pi, wait 30 seconds, and use Pi Finder to log in again. (I should have done this on the earlier ssh connection, but I wasn’t thinking about it at the time.) Get the MAC address for the wifi interface. I used:
    ifconfig
    and set up another DHCP address for the Pi-wifi MAC address from the wlan interface. Shut down the Pi again: sudo shutdown -h -P now
  13. Set up the new ISS-Above appliance where you’d like it to live. Ideally, this will be some place where the Pi itself is visible (so people will notice the blinking PiGlow), with an HDMI display within reach for a graphical display.
  14. Power it up and wait for the ISS to pass overhead!

I’ve got this up and running for now, but there are some things I’d like to fix. For one thing, the instructions above could be more streamlined. (I just wrote everything down as I did it.) Also, I haven’t got the live feed from the ISS set up. But those tweaks can be done later. Right now, I’m going to keep an eye on the next pass of the ISS, practically right over my house!

Posted in Mac OS X | Tagged , , , , , , | Comments Off on ISS Above installation via Mac OSX

Let’s Make something at Hacker Lab!

Earlier this month I became one of the Facilitators at Hacker Lab in Sacramento.
As such, I’ll be working in the Maker Space once or twice a week, helping users with the plethora of tools and equipment they have available.

One of the first tasks assigned to new Facilitators is writing up a short bio.
So of course I headed straight for my blog and put up my Facilitator page. 😉

Currently I’m working every Wednesday evening, after I finish my day job.
I also plan to work a shift every 2-3 weekends starting next month.
Come on out to Midtown (I Street at 17th), and let’s Make something at Hacker Lab!

Posted in Uncategorized | Leave a comment

iOS7, battery killer!

I finally upgraded my iPhone 4S to iOS7 the other day, plugged in my charger that night, and started the day with a shiny new OS. But in less than an hour, my battery was dead. WTH?!?
Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

Cranberry-satsuma relish

The 2012 Thanksgiving issue of Bon Appétit had a cranberry-orange-mint relish recipe that looked pretty good, except that my wife can’t stand mint. So I left out the mint, substituted satsumas for the oranges, and used star thistle honey instead of sugar. I like to let this sit in the refrigerator overnight to allow all the flavors to meld. It makes a refreshingly tart complement to many meals, not just Thanksgiving.

Cranberry-satsuma relish

Continue reading

Posted in Recipes | Tagged , , , , | Leave a comment

blog software updates

Wow, I had really let this blog fall by the wayside! 🙁

When I started the [30-day challenge][zero-to-hero] earlier this month, I knew one of the urgent things that needed to be done was a full update of the blog software, theme, and plug-ins. I finally got it done! WordPress is up-to-date, along with the [twentyten][] theme and all my active plug-ins. I also took this opportunity to delete old themes and plug-ins that are obsolete, stale, or unlikely to be used.

When I updated the twentyten theme, I was expecting to see a widget for images in my admin panel. After all, the Zero-to-Hero post links to an [image widget][] page which makes it seem like that’s a regular feature. Or maybe it’s only applicable to a [wordpress.com][] hosted site? Anyway, I wanted to add a zero-to-hero badge/widget, and since there doesn’t seem to be one built in I’m trying out [Image-widget][] and [Simple-image-widget][].

Some other plug-ins/features that I’d like to add are:

* additional spam protection ([Akismet][] is great, but I get too much comment spam to check for false positives — [Stop Spammers][] is looking good!)
* recipe support, maybe [Easy Recipe][]?
* the official [Facebook plugin][] and possibly [Simple Share Buttons][]
* [syntax highlighting][] (for source code)
* some “support” plugins such as [Jetpack][], [broken link checker][], and [GoogleMaps][]

I’ve uploaded all of those, but I still have to activate and test them, including making sure they don’t interfere with each other!

[zero-to-hero]: http://dailypost.wordpress.com/zero-to-hero/
[twentyten]: http://wordpress.org/themes/twentyten
[image widget]: http://en.support.wordpress.com/widgets/image-widget/
[wordpress.com]: http://wordpress.com
[Image-widget]: http://wordpress.org/plugins/image-widget/
[Simple-image-widget]: http://wordpress.org/plugins/simple-image-widget/
[Akismet]: http://wordpress.org/plugins/akismet/
[Stop Spammers]: http://wordpress.org/plugins/stop-spammer-registrations-plugin/
[Easy Recipe]: http://wordpress.org/plugins/easyrecipe/
[Facebook plugin]: http://wordpress.org/plugins/facebook/
[Simple Share Buttons]: http://wordpress.org/plugins/simple-share-buttons-adder/
[syntax highlighting]: http://wordpress.org/plugins/syntaxhighlighter/
[Jetpack]: http://wordpress.org/plugins/jetpack/
[broken link checker]: http://wordpress.org/plugins/broken-link-checker/
[GoogleMaps]: http://wordpress.org/plugins/comprehensive-google-map-plugin/

Posted in Uncategorized | Tagged , , , | Leave a comment

Tiny Arduinos

I’ve been playing with Arduino boards for the past year or two. These were designed as micro controllers for the masses — easy to program and simple to wire up. You need only the most rudimentary computer and electronics skills to get started playing with these excellent boards. They’re also relatively inexpensive. You can get an Arduino Uno board, (the most commonly mentioned Arduino in 2013), for about US$30.

But if you decide to start using these for real, i.e. deploying a prototype permanently or long-term, suddenly “relatively cheap” may not be quite as inexpensive as you’d like. Thirty bucks is reasonable for something that sits on your workbench, but that’s kind of expensive if you want to use a handful of them to monitor the temperature throughout your house: $30 x 5 is $150, which suddenly isn’t looking inexpensive at all.

There are cheaper alternatives, especially if all you need is a few I/O pins. The two that I’ve been playing with lately are Digistump’s Digispark and Adafruit’s Trinket. Both of these are priced under US$10 and use the ATtiny85 micro controller chip, the diminutive little brother of the chip in a regular Arduino.

Main differences between these two boards:

  • Trinket is a bit cheaper (about $1) than Digispark.
  • Digispark exposes all 6 GPIO pins, whereas Trinket has 5.
  • Trinket has a RESET switch. (You “reset” the Digispark via power cycling.)
  • Digispark supports “shields” (add-on boards) and currently offers ~20 shields.
  • Trinket is available in both 3.3V and 5V, Digistump is 5V only.
  • Digispark is smaller, but Trinket has mounting holes.

In general, I prefer the Trinket unless I need all 6 GPIO’s or the slightly smaller form factor of the Digispark. The Digispark shields can also be handy, but I only use those on workbench prototypes.

The Trinket tutorial has a wealth of information. Below are some of the things that I’m always looking up there.

  • GPIO output is 20 mA max, same as a regular Arduino.
  • I2C pins are GPIO #0 (I2C data) and GPIO #2 (I2C clock).
  • USB communication uses pins #3 and #4. Hardware on these pins can interfere with the USB interface, e.g. reprogramming the Trinket. So it’s a good idea to provide some sort of disconnect ability if you use either of these two pins.
  • PWM output available on pins #0, #1, and #4.
  • ADC (analog input) pins are GPIO #2, #3, and #4. Keep in mind that the GPIO/digital pin numbers are ”’not”’ the same as the analog inputs! The printed labels on the Trinket are the ”digital” pin numbers.
    • GPIO/digital #2 is analog (ADC channel) 1
    • GPIO/digital #3 is analog (ADC channel) 3
    • GPIO/digital #4 is analog (ADC channel) 2 — Yes, the analog numbers are out of order
Posted in Uncategorized | Tagged , , , , , | Leave a comment