Skip to content

Instantly share code, notes, and snippets.

View cerdman's full-sized avatar

colin b. erdman cerdman

  • TriNetX Inc.
  • United States
View GitHub Profile
@cerdman
cerdman / README.md
Created September 17, 2013 03:22 — forked from gniemetz/README.md

d3js Multiline chart with brushing and mouseover

import boto
#type that you want to get pricing on
MY_TYPE = u'm1.small'
ec2 = boto.connect_ec2()
spots = ec2.get_spot_price_history(instance_type= MY_TYPE)
spot_prices = [i.price for i in spots]
@cerdman
cerdman / spot.py
Created December 11, 2013 18:19 — forked from tristanwietsma/spot.py
import os
import boto.ec2.connection as boto
AWS_ACCESS_KEY = os.getenv('AWS_ACCESS_KEY')
AWS_SECRET_KEY = os.getenv('AWS_SECRET_KEY')
conn = boto.EC2Connection(aws_access_key_id=AWS_ACCESS_KEY, aws_secret_access_key=AWS_SECRET_KEY)
results = conn.get_spot_price_history( instance_type='cg1.4xlarge', product_description='Linux/UNIX')
for r in results:
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'
# Protodash
class Instance(Resource):
resource_type = "instance"
metric_resource_type = resource_type
api_key = "instances"
id_key = "instance_id"
metric_id_key = "instance" #our resource ids are chaos
metric_column = "InstanceMetric"

After provisioning an EC2 instance and opening up HTTP traffic, here are the commands I ran via ssh:

sudo yum install httpd

sudo apachectl start

sudo yum install R

which R

#!/bin/bash
SNAPID="SNAP"
BACKUPDBID="TEMPDB"
#config groups
SECURITYGROUP="Mysecgrup"
PARAMSGROUP="Myparamsgrup"
#rds verifying commands
import luigi
import os
#from WorkflowUtils import WorkflowUtils
import logging as log
class ATask(luigi.Task):
# Task parameters
dataset_name = luigi.Parameter()
upstream_task = luigi.Parameter()
import luigi
import tempfile
import datetime
from luigi.contrib import rdbms
from lib.luigi import logger
from luigi.postgres import MultiReplacer
try:
import MySQLdb
@cerdman
cerdman / freshstart
Last active August 29, 2015 14:10 — forked from dbogart/freshstart
//stops all files in root directory from being tracked in git
git rm --cached . -r
//if you need to modify .gitignore, or create it again because it disappeared, do it before the next command
//tracks all files except those in .gitignore
git add .
//commit
git commit -m 'commit message'