Automate Taking Snapshots of Your DigitalOcean Droplets with DOSnapshot

Multi-threading. Auto-cleanup. Cron optimized.

There are a lot of neat tools people have built for DigitalOcean.

The app I’m really in love with is DOSnapshot, and is hosted on GitHub. DOSnapshot does exactly what its name would suggest, it takes snapshots of your droplets.

As of this post, I’m the only one that’s left a comment on the DOSnapshot Community Projects page, which took me a bit by surprise, given the quality of the tool.

Taking a snapshot of a DigitalOcean Droplet is essentially like making an exact copy of the Droplet (server) that you can then use again at a later time. Very useful for scaling and updating a Droplet to a newer version of your Linux distribution without losing all of the Droplet’s configuration.

Etel Sverdlov does a very good job of explaining the difference between snapshots and backups in this DigitalOcean community tutorial. I suggest you read it if you’re unsure what the differences between a backup and snapshot are.

1. Install DOSnapshot

DOSnapshot can be installed as a ruby gem, which is what I chose to do because it’s just so easy. Don’t install this on your DigitalOcean Droplet! It’s meant to run from your local machine. Installing DOSnapshot as a Rubygem is as simple as:

sudo gem install do_snapshot

Pre-built binaries are also provided for Linux users, and OSX users have the option of installing via Homebrew Tap.

2. Set Your DigitalOcean Client ID and API Key

Once you’ve got it installed, you’ll need to set your DigitalOcean Client ID and API Key. You can set them as environment variables, or you can pass them as parameters when actually running DOSnapshot. This is straight from the README:

First you may need to set DigitalOcean API keys:

$ export DIGITAL_OCEAN_CLIENT_ID=”SOMEID”
$ export DIGITAL_OCEAN_API_KEY=”SOMEKEY”

If you want to set keys without environment, than set it via options when you run do_snapshot:

$ do_snapshot –digital-ocean-client-id YOURLONGAPICLIENTID –digital-ocean-api-key YOURLONGAPIKEY

3. Take A Snapshot

Please remember that running the do_snapshot command will cause your droplet to shutdown so the snapshot can be taken.

DOSnapshot has a pretty large number of options that you can specify. I’m going to keep this simple so you get the basics of it. Learning a few of the main options will be mostly what you need to know, after you’ve got them figured out, setting up a cronjob is cake.

You can take snapshots of all of your droplets at once, you can specify which droplets to take snapshots of, and you can specify droplets that you don’t want to take a snapshot of. I typically take a snapshot of a single droplet at a time, and I do it like this:

do_snapshot --only 1111 -k 3 -c -v

The above will take a snapshot of only one droplet, a droplet with an ID of 1111, replace 1111 with the ID of your droplet. You can find your droplets ID in your browser URL bar while managing the droplet. So if you see https://cloud.digitalocean.com/droplets/1234567, your droplet’s ID is 1234567.

Here’s all of the options.

4. Scheduling With Cron

First, you must have cron installed. There’s plenty of tutorials on how to do that. That tutorial even explains how to configure a cron job using the crontab utility. There’s an example crontab entry in the DOSnapshot README. Mine is pretty simple:

0 4 * * 2 do_snapshot --only 1111 -k 3 -c -v

If you have questions about setting any of this up, feel free to leave a comment!

0

My Portfolio

I finally have one!

I’ve known for a long time that I need some type of portfolio, especially since I’m doing freelance web development full-time now.

A potential client wanted to see my portfolio. I explained that I didn’t have one for various reasons, and instead described to him some of the more interesting projects I’ve done.

After the long email describing previous projects, I decided to create an online portfolio. I had recently bought the domain longrendev.io, but wasn’t using it for anything. So, I found a nice Twitter Bootstrap based portfolio WordPress theme and got to work. The theme needed some tweaking, the grid displaying the projects was a bit messed up and needed fixed, which was very easy.

The theme I chose was StanleyWP, a simple, minimalistic portfolio theme. The best thing about it was it’s price, free.

It’s built with Twitter Bootstrap 3.0.3, which is a little old, but still gets the job done. The current version of Twitter Bootstrap is 3.2.0.

Once I get some client projects finished up, I’ll probably take some time to update StanleyWP to use Twitter Bootstrap 3.2.0, or whatever the newest version is at that point in time.

Anyway, check it out and let me know what you think. There’s a LOT of projects I still need to add, so the list of projects right now is fairly minimal. I am also going to be using that site to take project requests.

If you need a portfolio site and would like to use StanleyWP, let me know if you need help fixing up the grid issues. It’s very simple to do, but may not be so simple for someone who isn’t a developer, like a designer. :)

0

Meet Unyson, A Drag & Drop WordPress Framework

Features a visual drag & drop page builder that will let your users create countless pages at a drop of a dime

Got an email from Olga at ThemeFuse yesterday announcing the release of their new drag & drop WordPress framework named Unyson.

Unyson comes with many built-in extensions, and the documentation seems to be very helpful and complete. Some highlights from the Unyson home page:

  • All the built in extensions & options work in perfect harmony. You’ll find developing on Unyson a breeze.
  • Your users will love the drag and drop page builder and the customization options built into
  • All you need to do is download the Unyson WordPress framework and start developing your theme.
  • We have a lot of tools ready to help you along the way: developer manual, Trello, GitHub Support and more.

unyson-docs
Unyson also includes an extensive list of customizations and options:

  • Page Builder
  • Option Types
  • Styling
  • Sidebars
  • Megamenu
  • Backup
  • Sliders
  • SEO
  • Breadcrumbs
  • Portfolio
  • Custom Widgets

I enjoy this theme so much because it has many features that premium or paid themes have, but Unyson is free! You can download the source on GitHub.

Getting started with Unyson is extremely easy, but slightly different than how you’d typically upload a theme. Installation of Unyson is like so:

  1. Download the framework archive from the framework’s GitHub repository
  2. Extract it to your parent theme directory. After this you must have framework/ directory in parent theme. It’s mandatory to have this exact same folder structure otherwise it will not work.
  3. Include the Unyson framework by adding this line in your theme’s functions.php:

require_once TEMPLATEPATH .’/framework/bootstrap.php’;

After that, you’ll need to add some more code to the beginning of all the PHP files associated with your theme. I suggest you go over the Getting Started guide and really pay attention so you get a good understanding of what Unyson can do. The documentation is really awesome, most issues or questions you could have are more than likely covered in the docs.

I haven’t had much of a chance to play with Unyson, but will get the opportunity to on an upcoming client project, so I’m really looking forward to that.

Unyson is quite new, so hopefully we will see more features as it matures. It’s definitely worth checking out.

0

Dark GitHub

GitHub Lights Out

I love the GitHub explore today emails. It’s a daily email consisting of currently trending repositories, repositories starred by people you follow, and repositories that have been starred by GitHub staff members.

The September 06, 2014 email included a repository that caught my eye, StylishThemes/GitHub-Dark. Apparently one of the people I follow on GitHub starred it, which is awesome. I may not have found this otherwise.

Dark GitHub requires that you have the Stylish extension installed for your browser. Stylish can be easily installed in Google Chrome or Mozilla Firefox.

So, before you go any further, make sure you have the Stylish extension installed. Click here for Stylish for Google Chrome, and click here for Stylish for Mozilla Firefox. Stylish is a very useful tool for changing the style of websites, they have an extensive repository of styles that you can apply to your favorite websites. As of this post, they have custom styles for 59,197 websites. Stylish is powered by userstyles.org.

The Dark GitHub userstyle comes with a variety of syntax highlighting themes, the ability to set your own background image, setting a base color scheme, and changing the code tab size (defaults to 4).

Installing the Dark GitHub Stylish Extension
Installing the Dark GitHub Stylish Extension

To install Dark GitHub, visit the GitHub-Dark userstyles.org page. Select your options (ie: syntax highlighting theme, background image, etc). I typically just leave everything at their defaults.

Once you’ve got the options set how you want, click the green Install With Stylish button, as seen in the image above. You’ll be asked if you’re really sure that you want to proceed with installing the GitHub Dark userstyle. If you do want to install it, just click OK.

Now visit GitHub and enjoy the dark colors! :)

dark-github
0

Growth Hacking WordPress Plugin from Qunb

I’ve been using qunb for quite a while. They generate what they call datastories for your sites using Google Analytics data. The datastories include data like number of visitors, top countries, and most viewed pages. They do a really nice job of presenting your analytics data in a more human readable fashion, a good birds-eye view of it all.

I got an email from qunb announcing the release of their WordPress plugin, Growth Hacking Analytics by qunb.com. It’s available in the WordPress plugin directory.

After installing the plugin, you’ll need to authorize it to use your Google Analytics account. You can also connect your Facebook page and Twitter account, but those don’t require any special permissions.

Qunb has also setup a Google Group that will host discussions about bugs and ideas for improvements. As of this post, however, the Google Group gives me a page titled “Authorization Failed“, with a message stating “Please sign in with an authorized account to view this content“.

The WordPress plugin will add a new sub-menu to the main Dashboard menu. It has 4 main parts to it. The first shows stats about visitors or pageviews, you can select which you want to view. The second part shows pageview stats on the most recent post. The third part, titled Tops of the day, lists your top posts, best social network in terms of referrals, and the best non-social referrer. The fourth and last part displays the growth comparison compared to the last week. You can also view growth comparison for the last month, but you’ll need to have a paid qunb account for that.

The starter plan is $5/month and includes unlimited datastories, and there’s no limit on the number of websites you track.

0