View hbase_count_rows.py
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
import happybase, sys, os, string | |
# VARIABLES | |
# HBase Thrift server to connect to. Leave blank for localhost | |
server = "" | |
# Connect to server | |
c = happybase.Connection(server) | |
# Get the full list of tables |
View hbase_export_csv.py
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
import happybase, sys, os, string | |
# VARIABLES | |
# Output directory for CSV files | |
outputDir = "/mnt" | |
# HBase Thrift server to connect to. Leave blank for localhost | |
server = "" | |
# Connect to server | |
c = happybase.Connection(server) |
View write_speed.php
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
<?php | |
// Length of each line | |
$length = 40; | |
// Open up a file | |
$file = fopen("test.txt", "w"); | |
// Generate 10,000 strings | |
for ($iii=0; $iii<=10000; $iii++) { |
View ec2_mount.sh
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
# Variables | |
VOLUME=/dev/sdf | |
DIRECTORY=/var/www/html/ | |
USER=apache | |
GROUP=apache | |
# Commands | |
mkfs -t ext4 $VOLUME | |
mount $VOLUME $DIRECTORY | |
echo "$VOLUME $DIRECTORY ext4 noatime 0 0" | sudo tee -a /etc/fstab |
View glacier_layer2.py
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
# Author: Suman | |
# Import boto's layer2 | |
import boto.glacier.layer2 | |
# Various variables for AWS creds, vault name, local file name | |
awsAccess = "AKIAxxxx" | |
awsSecret = "YouRSecRetKeY" | |
vaultName = "YourVaultName" | |
fileName = "LocalFileName" |
View runEC2instances.py
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
#!/usr/bin/python | |
# | |
# Start new EC2 instances | |
# | |
import boto, sys, time | |
print "Please enter your AWS credentials below." | |
# AWS credentials |
View ec2_auto_stop_start.py
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
#!/usr/bin/python | |
# | |
# Auto-start and stop EC2 instances | |
# | |
import boto, datetime, sys | |
from time import gmtime, strftime, sleep | |
# AWS credentials | |
aws_key = "AKIAxxx" | |
aws_secret = "abcd" |
View ec2_spot_prices_total.py
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
import boto, datetime, time | |
# Enter your AWS credentials | |
aws_key = "YOUR_AWS_KEY" | |
aws_secret = "YOUR_AWS_SECRET" | |
# Details of instance & time range you want to find spot prices for | |
instanceType = 'm1.xlarge' | |
startTime = '2012-07-01T21:14:45.000Z' | |
endTime = '2012-07-30T23:14:45.000Z' |
View linux_user_keys.sh
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
# Change to sudo | |
sudo su | |
# Export the username you want to create | |
export USERNAME=name | |
adduser $USERNAME | |
cd /home/$USERNAME | |
# Create the SSH keys | |
mkdir .ssh |
View asgard_setup.sh
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
################# | |
# Update packages | |
################# | |
sudo yum -y update | |
sudo yum -y upgrade | |
######################## | |
# Install the Oracle JDK | |
######################## |
NewerOlder