Monthly Archives: August 2015

ZFS: automatic snapshots

ZFS: Setting Up Automatic Snapshots

I considered writing a script to take care of this. Luckily, before I got too far down that rabbit hole, I stumbled upon Bryan Drewery’s zfstools on GitHub.

The zfstools installs a few Ruby (programming language) scripts that make managing automatic ZFS snapshots really easy. While you can customize the snapshot retention, the defaults will probably serve you well.

The default snapshot schedule is to snapshot your selected ZFS datasets:

  • every 15 minutes – keeping the last 4 quarter-hour snapshots
  • every hour – keeping the last 24 hourly snapshots
  • every day – keeping 7 daily snapshots
  • every week – keeping 4 weekly snapshots
  • every month – keeping 12 monthly snapshots

The setup is easy on FreeBSD. It only takes 3 steps:

  1. install the scripts
  2. turn on auto snapshotting
  3. update the /etc/crontab file

Start by installing zfstools from the FreeBSD package system:

$ sudo pkg install zfstools

Then, determine which ZFS datasets to automatically be snapshot. Turn on auto-snapshotting for these ZFS datasets:

$ sudo zfs set com.sun:auto-snapshot=true ZPOOL/DATASET

Where ZPOOL is the name of the zpool and where DATASET is the name of the ZFS dataset that you want to be automatically snapshot.

Next, it is time to update your machine’s /etc/crontab file to run the script. If you have never touched your /etc/crontab file before, take a moment to read the manual page for this magical file:

$ man 5 crontab

Next, copy the 5 crontab lines from file. Look for the lines that have tons of asterisks – the manual page listed above explains what these asterisks and the rest of the fields represent.

Also, make sure the /etc/crontab PATH line contains the directories where ruby and zfs-auto-snapshot live. On my machine these were:

  • /usr/local/bin/
  • /usr/local/sbin/

You can figure out what yours are by typing:

$ which ruby


$ which zfs-auto-snapshot

The PATH line in my /etc/crontab file ended up looking like this:


Wait for the clock to pass the quarter hour then look for the automatic snapshots:

$ zfs list -t snapshot

You will see automatic snapshots start to pile up.

Ting: a positive mobile experience

My wife and have had iPhone since they first came out. These are expensive phones …too expensive when phone and data plans cost so much. After our Sprint contracts on our iPhone 4S phones was over I searched for and found a plan that saved us a ton of money: Ting.

Ting is a mobile virtual network operator (MVNO) that provides cell phone service riding on top of the T-Mobile and Sprint cell phone networks. Ting only charges you for what you use in the categories of data, phone, and text messages. Ting charges each category separately.

Our first full month on Ting was December, 2013. Before switching to Ting our Sprint bill for two iPhones was $143 per month. Since we shifted to Ting, our monthly bills have averaged $65 – less than half of what we paid to Sprint.

ting dashboard

Screenshot of the ting dashboard with price breakdown by category (image: Eduardo Sanchez CC-BY-NC)

Ting is not the only MVNO out there. Search around and you can find multiple MVNOs on the major carriers.

I highly recommend Ting. You can move your unlocked Sprint or T-Mobile phone over to Ting or you can buy a new phone to use on the Ting network. Break free of unnecessary contracts and switch to an MVNO like Ting.

Coursera: Programming for Everybody (Python)

Certificate of Completion - Programming for Everybody

Certificate of Completion – Programming for Everybody

I managed to get a lot done this summer. One of my two major projects (I’ll save the 2nd one for its own post) was to take a computer programming course. I took the University of Michigan’s Programming for Everybody (Python) course.

This 10-week course is designed to teach the basics of programming computers. I took this course through Coursera, the site that is the home to many massive open online courses.

Here’s what I liked about it:

  • professor wrote the book we used
  • got to learn all about foundation ideas of programming (many of which I learned a long time ago then promptly forgot)
  • some of the homework problems challenged my brain
  • cool educational technology combining slides, video, drawing, and screencasting helped in making the programming easier to understand
  • nice use of humor
  • all course materials were licensed through Creative Commons (CC-BY)
  • textbook was free
  • cool online auto-grader for coding homework assignments
  • aimed at beginner programmers
  • lecture videos were available at Coursera and within the iBooks version of the text

Now that I have taken this course, I plan to take another Python programming class. I am eyeing the course offered by MITx, Introduction to Computer Science and Programming Using Python, 6.00.1x. With work and my other college classes I don’t know if I’ll have enough time to take it this fall, but I hope to take it in the spring or next summer.

As an educational technology nerd, I really enjoyed taking this class. It was cool to see how the instructor used the different edtech tools to deliver, grade, and collaborate on this class.

I give Professor Charles Severance and his class an A.

Read about the Creative Commons Attribution license by clicking on the CC-BY image below:
Creative Commons Attribution License

Setting aside time each day to read

I love to read. That said, I am also easily distracted by shiny things …ooh, look there’s the www and …ooh, baseball game…

My wife went to Ireland with her mom a week ago. While she was gone I decided to read for a couple of hours everyday.

I have managed to keep up the habit. I really like it. Dedicating time each day to reading helps me get to all the books in my ‘to read’ stack.

Here is what I’m reading now.

books i am reading as of August 22, 2015

What I’m reading …as of August 22, 2015.

Yes, I read more than one book at a time. I know, focus! 🙂

And here’s an image of my ‘to read’ stack.

My 'to read' list

My ‘to read’ list (not in order)

Slowly, slowly, catchy monkey.

bash tab completion in tmux on Ubuntu GNU/Linux

I installed tmux on my Ubuntu laptop. I was confused about why tab completion was not working.

Silly me, it turns out that the default shell on tmux is /bin/sh and not the typical Bash (/bin/bash) shell typically used in GNU/Linux.

The simple fix was adding this to my $HOME/.tmux.conf file to ensure subsequent tmux sessions used /bin/bash.

set-option -g default-shell /bin/bash