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 | |
$sizes = array("small", "medium", "large"); | |
$periods = array("hour", "day", "week", "month", "year"); | |
if(in_array($_GET['size'], $sizes)) { | |
$size = $_GET['size']; | |
} else { | |
$size = "medium"; | |
} | |
if(in_array($_GET['period'], $periods)) { | |
$period = $_GET['period']; |
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 boto import ec2 | |
from boto.ec2 import elb | |
c = ec2.connect_to_region("us-east-1") | |
elb_c = elb.connect_to_region("us-east-1") | |
all_sgs = set() | |
in_use = set() |
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
'use strict'; | |
const https = require('https'); | |
exports.handler = (event, context, callback) => { | |
const request = event.Records[0].cf.request; | |
let username = 'Guest'; | |
if (request.headers['user-name']) { | |
username = request.headers['user-name'][0].value; |
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/env python3 | |
import sys | |
import boto3 | |
S3 = boto3.resource("s3") | |
def list_keys(bucket_name, prefix=''): |
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
use std::env; | |
use std::net::TcpStream; | |
use std::thread; | |
use std::time::Duration; | |
const SLEEP_SECONDS: u64 = 604800; | |
fn start_connections(conns: i32, addr: &str, start_port: u16, end_port: u16) -> thread::JoinHandle<()> { | |
let addr = String::from(addr); |
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/env python | |
import argparse | |
import glob | |
import os | |
def headervalue(l): | |
parts = l.split(": ", 1) | |
key = parts[0] |
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
#!/bin/bash | |
set -e | |
P12CERT=$1 | |
CERTNAME=${P12CERT%.p12} | |
openssl pkcs12 -in "$P12CERT" -nocerts -nodes -out "${CERTNAME}.key.pem" | |
openssl pkcs12 -in "$P12CERT" -clcerts -nokeys -out "${CERTNAME}.crt.pem" |
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
#!/bin/bash | |
set -e | |
curl -L 'https://storage.googleapis.com/golang/go1.7.4.linux-amd64.tar.gz' | tar -xz -C /usr/local | |
cat > /etc/profile.d/go.sh <<'FOO' | |
export GOPATH=~/go | |
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin | |
FOO |
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
package main | |
import ( | |
"bufio" | |
"encoding/json" | |
"flag" | |
"log" | |
"os" | |
"strings" |
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 argparse | |
import json | |
import time | |
import requests | |
from boto.sqs import connect_to_region | |
from boto.sqs.message import RawMessage | |
def get_messages(queue, region='us-west-2'): |