This file contains hidden or 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
################ | |
# This script was written to take a large file over 2G and split it into smaller files then push these to Rackspace's cloud files daily. | |
# The following day it will remove the next backup once the current backup has been pushed. | |
# It expects the filename and path to the file to be backed up to be passed to it as a calling argument | |
# Sample path - /opt/backup/store/Server1.Thu.2 # Where Thu is day of the week of the backup and 2 is the week of the month. | |
# Update XXXX with the appropriate values in the appropriate places | |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'cloudfiles' |
This file contains hidden or 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 | |
# This script is expected to be run once every ten minutes | |
# | |
list="/tmp/backup_list_`date +%s`" | |
find $1 -mmin -800 -type f -print > $list | |
for i in `cat $list` | |
do | |
echo "Backing up: "$i | |
/usr/local/bin/to_cloud.rb $i |
This file contains hidden or 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 | |
# The raw copy of the virtual server should be extracted to /vz/private/$CTID from there it can be customised using thi script to get it ready for packaging as an openvz tempalte. | |
CTID=101 | |
export CTID | |
echo "none /dev/pts devpts rw 0 0" > /vz/private/$CTID/etc/fstab | |
echo "proc /proc proc defaults 0 0" >> /vz/private/$CTID/etc/fstab | |
echo "tmpfs /dev/shm tmpfs defaults 0 0" >> /vz/private/$CTID/etc/fstab | |
mkdir /vz/private/$CTID/dev |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# This script downloads the current backup from Rackspace Cloud file storage as made by the too cloud script and mounts the raw disk image checking the contents of the /var/log/date file for validity of the current date. (which was created by an hourly cronjob on the live running guest before the backup was taken). | |
require 'rubygems' | |
require 'cloudfiles' | |
guest = ARGV[0] | |
path = ARGV[1] ||= "/opt/dump" | |
container = ARGV[2] ||= "eudc" | |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'cloudfiles' | |
guest = ARGV[0] | |
path = ARGV[1] ||= "/opt/dump" | |
container = ARGV[2] ||= "eudc" | |
def list_file(guest, container, cf, path) |
This file contains hidden or 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
var blah = function(x, y, z) { | |
return function() { | |
console.log(x,y,z) | |
} | |
} | |
setTimeout(blah(1,2,3), 100); |
This file contains hidden or 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
mkdir -p /etc/chef | |
( | |
cat <<'EOP' | |
<%= validation_key %> | |
EOP | |
) > /tmp/validation.pem | |
awk NF /tmp/validation.pem > /etc/chef/validation.pem | |
rm /tmp/validation.pem |
This file contains hidden or 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
#!/usr/bin/env python | |
# CPU Alert levels - based on number of CPU in machine | |
from __future__ import division | |
import multiprocessing | |
cpu = multiprocessing.cpu_count() | |
if cpu <= 2: | |
cpu = 3 |
This file contains hidden or 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
startup | |
__init__.py | |
mount | |
__init__.py | |
mount.py | |
passwd | |
__init__.py | |
getpasswd.py | |
###### |
This file contains hidden or 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 | |
# | |
# Evaluate system path | |
# | |
echo "System PATH - $PATH" | |
exit 2 |
OlderNewer