I read a blog post today about changes made to Gmail’s interface and how they stress out the author. This is why for my email I alway use IMAP and a native mail client, that and since I have several accounts to check I don’t have to have 6 browser windows open at all times. SAAS is great until you don’t like the changes they make.
Archive for Technology
Automated Backup from EC2 to S3
The server that hosts Common Folk Collective also hosts a handful of other sites. As a responsible hosting provider I try to ensure that if anything were to happen to the server all is not lost and I’d be able to get everything up and running again pretty quickly.
One thing I do is take nightly backups of the database server and all of the files. This is a guide to help you do the same.
Login into your AWS console. In the upper righthand corner click on “Security Credentials”
On the left side click on the Groups
Select “Create a New Group”
Give it a memorable name.
Set “Amazon S3 Full Access”
Next you will create a new user.
Download the credentials for the new user.
The contents of the file will look something like this:
Next add this user to the group you just created.
Next you have to create a bucket
Next you should edit the Lifecycle rules of your backups
One of the cool features of S3 is that you can retire backups. This is handy because Amazon charges you per MB. I keep my backups around for 30 days and then they disappear. If you want to save them for longer you may also retire them to Amazon Glacier where they charge much less for storage with the caveat that it will take a few hours to retrieve them.
Now you have everything in place to start backing up. Your first step is to grab a great set of tools to put files on S3 using only bash.
I put these files in /home/ec2-user/bin/ I also added the following scriptÂ
#!/bin/bash
NOWDATE=`date +%Y-%m-%d-%H-%M`
cd /home/ec2-user/bin/
/usr/bin/mysqldump -u root -pDB_PASSWORD --all-databases > all_db-$NOWDATE.sql
/bin/gzip all_db-$NOWDATE.sql
/home/dan/bin/s3-put -k 20_CHARACTER_STRING -s /home/ec2-user/bin/.robot-key -T all_db-$NOWDATE.sql.gz /robot-backups/all_db-$NOWDATE.sql.gz
/bin/rm all_db-$NOWDATE.sql.gz
/bin/tar czf all_sites-$NOWDATE.tgz /usr/local/www/*
/home/dan/bin/s3-put -k 20_CHARACTER_STRING -s /home/ec2-user/bin/.robot-key -T all_sites-$NOWDATE.tgz /robot-backups/all_sites-$NOWDATE.tgz
/bin/rm all_sites-$NOWDATE.tgz
The 20_CHARACER_STRING is the first string in the credentials you downloaded earlier. For the 40 character string put that into a file named .robot-key.
Don’t forget to chmod 700 on the your backup-file.
Test it once if you’ve its working you’ll see everything show up in your S3 bucket.
Now add a cron job to do it nightly. Run the command “crontab -e” and add the following line:
@daily /home/ec2-user/bin/backup.sh > /dev/null
This should run every night at midnight.
If I’ve missed anything please let me know in the comments.
Letters, words, numbers, symbols, objects
Hey, readers, I’m putting myself on hiatus from link-posting for the next few weeks as I move my life from one continent to another. You’re going to miss me when I’m gone, I’m sure.
From the Desk of Jackass Letters
The Strangest Neighborhood In New York City
Government in Plain Sight
What Ants to Look For
Significant Objects… and how they got that way
Symbols on the Brain
Where do African tribal prints really come from?
100 movies, 100 quotes, 100 numbers
Recipes & Menus For Your Murder Mystery Dinner Party
Gilroy Garlic Festival
Hudson Valley Garlic Festival
Cuba Garlic Festival
Cooking’s A Drag: Starring Star Trek’s William Shatner
“VOGUE BOY”: ME AT NINE, PERFORMING TO MADONNA IN SUMMER ’91!
Room Raiders Spoof- Ham Jam 2010
My Netflix Love Affair and my Carbon Footprint
The Medium Chill
Netflix – HBOGO and the Future
Reed Hastings always says “Netflix needs to become HBO before HBO becomes Netflix.” If the interface of HBOGO is any indication Netflix will be the Blockbuster of online video if they don’t tighten up their game.
PSA – Location Data in Photos
Based on a news report from KSHB out of Kansas City, MO I’ve noticed a lot of people posted the story to Facebook.
While it is true that photos from most modern mobile phones do use Exif data* which often contains your location via GPS you can prevent this information from being shared in a couple of ways. First you can turn off location services on the iPhone this is done by going to settings
Then turning off the location for your camera (if you use a different camera app you’ll have to adjust accordingly)
It should be noted though that I’ve noticed that a lot sites will strip Exif location data off of images. Craigslist, Facebook and Imgur seem to remove the data. Tumblr does now but didn’t in the past.
There is an easier way to avoid this though instead of posting images a JPEGs save them instead as PNGs which don’t contain Exif data.
*Exif data is actually pretty cool and attaches all kind of information to your photos here’s an example:
It contains a bunch of info about your camera settings and you can imagine if you were on vacation Exif data would come in handy in making a trip log.
New Toy ChargeCard
I just received the fruits of my pre-order of a Kickstarter funded project and so far it’s pretty sweet. The ChargeCard feels solidly built, in the USA no less, is it the size of a standard credit card and the thickness of about three credit cards stacked together. I find it very handy to throw in my laptop bag and not have to worry about untangling a mess of cords when I want to connect my phone.