Skip to content

Instantly share code, notes, and snippets.

@abhiyerra
abhiyerra / parkingspot-terraform-spot-instance.tf
Last active September 28, 2016 03:34
parkingspot-terraform-spot-instance
variable "spot_price" {
type = "string"
}
variable "instance_type" {
type = "string"
}
variable "region" {
type = "string"
@abhiyerra
abhiyerra / parkingspot-terraform-spot-fleet.tf
Created September 26, 2016 20:11
parkingspot-terraform-spot-fleet
resource "aws_spot_fleet_request" "cheap_compute" {
iam_fleet_role = "arn:aws:iam::12345678:role/spot-fleet"
spot_price = "0.03"
allocation_strategy = "diversified"
target_capacity = 6
valid_until = "2019-11-04T20:44:20Z"
launch_specification {
instance_type = "m4.10xlarge"
ami = "ami-1234"
spot_price = "2.793"
@abhiyerra
abhiyerra / parkingspot-packer.sh
Last active September 26, 2016 22:52
parkingspot-packer-run
$(parkingspot -max-bid 0.25 -region us-west-2) packer parkingspot-packer.json
@abhiyerra
abhiyerra / parkingspot-packer.json
Last active September 26, 2016 22:52
parkingspot
{
"builders": [
{
"type": "amazon-ebs",
"region": "{{env `PARKINGSPOT_REGION }}",
"source_ami": "ami-fa82739a", // Have to do some logic to make sure that the AMI is correct. Also pass the -region flag to limit machines to a certain region.
"spot_price": "{{env `PARKINGSPOT_BID`}}",
"instance_type": "{{env `PARKINGSPOT_INSTANCE_TYPE`}}",
"vpc_id": "vpc-79f9021d",
"ssh_username": "ubuntu",
# ` is an interesting key for a prefix
set-option -g prefix `
# set-option -g prefix C-a
set -sg escape-time 0
#unbind-key C-b
bind-key C-a last-window
bind-key ` last-window
bind-key a send-prefix
var experiments = {
"YvvWWQlbSLSUqKvi6YD": [
function() {},
function() {
$("#support-nav").html("Support");
}
],
"CeK01Si7S_m_c7iYjyu9Nw": [
function() {},
function() {
@abhiyerra
abhiyerra / ParkingSpotCurl.json
Last active July 13, 2016 22:40
ParkingSpot curl
{
"AZ": "us-west-2b",
"RecommendedBid": "0.023492497666109377",
"Mean": "0.02",
"Median": "0.02",
"StdDev": "0.0034924976661093749",
"SavingsPercent": "82.33646792021851",
"OnDemandPrice": "0.133",
"DataSet": "647"
{
"Services": {
"landing_page.emails": {
"AWS": {
"AccessKey": "AWS-Access-Key",
"SecretKey": "AWS-Secret-Key",
"Region": "us-west-2"
},
"FunctionName": "arn:aws:lambda:us-west-2:1234:function:landing_page_emails-dev"
}
# Need to convert this to Emacs Lisp. But this should show the issues.
curl -u "username:password" "https://api.github.com/orgs/workmachine/issues?filter=created&state=open" | jq '.[] | @text "\(.repository.name) - \(.title) \(.html_url)"' | sed -e 's/"//g'
# Get information about your notes
# create table notebooks (
# title varchar(255),
# num_notes int,
# avg_time int,
# created_at timestamp default now()
# );