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
# Create required directories | |
sudo mkdir /data | |
sudo mkdir /data/db | |
sudo mkdir /data/configdb | |
sudo mkdir /data/logs | |
# Give correct permissions | |
sudo chown -R ec2-user:ec2-user /data | |
# Start mongod server and shard server |
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 | |
c = happybase.Connection() | |
for t in c.tables(): | |
c.disable_table(t) | |
c.delete_table(t) | |
print (t + " deleted") |
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
from multiprocessing import Pool | |
import happybase, os, random, base64, time, sys | |
# Total number of rows to be inserted | |
TOTAL_PUTS = 100000000 | |
# Number of inserts that are in one batch operation | |
BATCH_PUTS = 10000 | |
# Output is displayed after how many iterations | |
OUTPUT_ITERATIONS = 50000 | |
# Number of simultaneous threads (actually processes) |
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
sudo yum -y groupinstall "MySQL Database" "PHP Support" | |
sudo yum -y install php-mysql | |
sudo service mysqld start | |
mysql -u root -e "CREATE DATABASE cake" | |
wget https://raw.github.com/gist/3139201/6cc45f51c6fce82296a7080a33e800576879eacb/mysql_insert_select_test.php | |
php mysql_insert_select_test.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 | |
$dbhost = "localhost"; | |
$dbuser = "root"; | |
$dbpass = ""; | |
$dbname = "cake"; | |
$con = mysql_connect($dbhost, $dbuser, $dbpass); | |
if (!$con) die('Could not connect: ' . mysql_error()); | |
mysql_select_db($dbname, $con); |
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
KEYNAME=Suman1 | |
# Amazon EBS AMI | |
# AMI=ami-aecd60c7 | |
# Ubuntu instance-store AMI | |
AMI=ami-012b8568 | |
REGTYPES=( t1.micro m1.small m1.medium m1.large m1.xlarge c1.medium c1.xlarge m2.xlarge m2.2xlarge m2.4xlarge hi1.4xlarge ) | |
CLUTYPES=( cc1.4xlarge cg1.4xlarge cc2.8xlarge ) |
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
sudo apt-get -y install mysql-server php5 php5-mysql | |
mysql -u root -e "CREATE DATABASE cake" | |
wget https://raw.github.com/gist/3139201/6cc45f51c6fce82296a7080a33e800576879eacb/mysql_insert_select_test.php | |
php mysql_insert_select_test.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
################# | |
# Update packages | |
################# | |
sudo yum -y update | |
sudo yum -y upgrade | |
######################## | |
# Install the Oracle JDK | |
######################## |
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 |
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' |
OlderNewer