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 -xe | |
EBS_DEVICE='/dev/sdh' | |
INSTANCE_ID=$1 | |
AKI=${2:-'aki-5f15f636'} | |
ARI=${3:-'ari-0915f660'} | |
ARCH=${4:-'i386'} | |
SIZE=${5:-10} | |
AZ=${6:-'us-east-1d'} | |
NAME=${7:-"ami-from-$INSTANCE_ID"} |
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
0 0 * * * /vol/conf/snapshot.sh >> /mnt/backup_ebs.log 2>&1 | |
0 2 * * * /vol/conf/manage_snaphost.sh >> /mnt/backup_ebs.log 2>&1 | |
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
--- a/littlechef.py | |
+++ b/littlechef.py | |
@@ -49,6 +49,7 @@ def new_deployment(): | |
print >>authfh, "[userinfo]" | |
print >>authfh, "user = " | |
print >>authfh, "password = " | |
+ print >>authfh, "keypair-file = " | |
print "auth.cfg file created..." | |
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
du -hx --max-depth=1 /var | |
lsof -n |grep deleted --kill -HUP <pid> |
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
Check if termination is allowed: | |
for i in `ec2-describe-instances | grep ^INSTANCE | cut -f2`; do ec2dinatt --disable-api-termination $i ; done | |
Protect: | |
for i in `ec2-describe-instances | grep ^INSTANCE | cut -f2`; do ec2minatt --disable-api-termination true $i ; done |
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
Backup the File based image firstly, making sure it is not mounted nor running as a xen domU. | |
dd if=/dev/zero of=file.img bs=1M conv=notrunc count=1 seek=2000 | |
#This resizes the file.img to 2GB. | |
losetup /dev/loop1 file.img | |
#loop1 had to be used as xen was already running a different domU via loop0. | |
e2fsck -f /dev/loop1 |
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 | |
# Run this script on the instance to be bundled | |
# tested with Canonical Ubuntu 9.10 base ami | |
EBS_DEVICE=${1:-'/dev/sdh'} | |
IMAGE_DIR=${2:-'/mnt/tmp'} | |
EBS_MOUNT_POINT=${3:-'/mnt/ebs'} | |
mkdir -p $EBS_MOUNT_POINT | |
mkfs.ext3 ${EBS_DEVICE} -L uec-rootfs |
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 | |
# | |
# Filaneme: ebs_backup | |
# | |
VOLUMES='' | |
EBS_DIR=/nfs-raid | |
ISMOUNTED=$(df -la | grep -c $EBS_DIR) | |
if [ $ISMOUNTED -gt 0 ];then |
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
log_format proxied_combined '$http_x_forwarded_for - $remote_user [$time_local] ' | |
'"$request" $status $body_bytes_sent ' | |
'"$http_referer" "$http_user_agent"'; | |
access_log logdir/access.log proxied_combined; |
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
{ | |
"Version":"2008-10-17", | |
"Id":"", | |
"Statement":[{ | |
"Sid":"Stmt1313741300912", | |
"Effect":"Allow", | |
"Principal":{ | |
"AWS":"*" | |
}, | |
"Action":"s3:GetObject", |
OlderNewer