Skip to content

Instantly share code, notes, and snippets.

@abhiyerra
abhiyerra / seespot.sh
Created October 28, 2016 18:22
seespotrun
seespot -health-port=8686 -health-path=/health -app-health=”https://localhost:8080/health" -cleanup-task=/path/to/cleanup.sh
@abhiyerra
abhiyerra / parkingspot-docker-machine.sh
Last active October 5, 2016 01:12
docker-machine and docker-compose
PARKINGSPOT_API_KEY=yourapikey
$(parkingspot -memory 2000 -cpu 6 -max-bid 0.50) docker-machine create --driver amazonec2 \
--amazonec2-request-spot-instance \
--amazonec2-region "${PARKINGSPOT_REGION}" \
--amazonec2-spot-price "${PARKINGSPOT_BID}" \
--amazonec2-instance-type "${PARKINGSPOT_INSTANCE_TYPE}" \
parkingspot-worker
# If you want to use Docker Compose
@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.sh
Last active September 27, 2016 22:30
parkingspot-curl
curl -i \
-H "Content-Type: application/json"
-H 'X-PARKINGSPOT-API-KEY: yourkey' \
-X POST
-d '{"MaxBid": 0.25, "Region": "us-west-2"}'
https://api.parkingspot.bid/v1/spot/me
# You can also just use our CLI tool:
# https://github.com/acksin/parkingspot
@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"
}