This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -e | |
# usage | |
# backup-image -s source-device -n max-to-save [TARGET-DIR] | |
# | |
# Example cron to run every night at 3am, saving 5 images | |
# | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.IO; | |
using System.IO.IsolatedStorage; | |
using System.Reflection; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
namespace BuddySDK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MONGO_BASE=~/mongodb/ | |
MONGO_DB=~/mongodb/db | |
MONGO_DUMP=~/mongodb/dump | |
MONGO_INSTALL=~/mongodb/bin | |
MONGO_VERSION=2.2.0 | |
mkdir -p $MONGO_BASE | |
mkdir -p $MONGO_DB | |
mkdir -p $MONGO_DUMP | |
cd $MONGO_BASE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# these make the ec2 commands just work | |
export AWS_ACCESS_KEY=[AWS access key] | |
export AWS_SECRET_KEY=[AWS secret] | |
# fetch the instance id | |
export INSTANCE_ID=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id) | |
#grep out the tag you're looking for, in this case "Name" | |
export APP_TAG=$(ec2-describe-tags | grep $INSTANCE_ID | grep -oE "Name\\W+(.+)$" | grep -oE "\\W.+$") |