Skip to content

Instantly share code, notes, and snippets.

@adamenger
adamenger / gist:11a1f468e22d93cd0de3
Created January 22, 2015 20:35
limit_req in location block
server {
server_name reverb.com;
# awesome vhost configuration goes here
location ~* ^/my/endpoint {
limit_req zone=global_zone;
}
}
@adamenger
adamenger / gist:1cd5a8bb462f1c824f21
Created January 27, 2015 19:37
CVE-2015-0235 (GHOST) vulnerability script
#!/bin/sh
wget https://gist.githubusercontent.com/koelling/ef9b2b9d0be6d6dbab63/raw/de1730049198c64eaf8f8ab015a3c8b23b63fd34/gistfile1.c
gcc gistfile1.c -o CVE-2015-0235
./CVE-2015-0235
@adamenger
adamenger / gist:63ea92c9f23a240f2997
Last active August 29, 2015 14:14
One liner for GHOST vulenrability
curl -o ghost-test.sh https://gist.githubusercontent.com/adamenger/1cd5a8bb462f1c824f21/raw/8a19de2e4b9d56c4daf35d5f4d30200444d8725d/gistfile1.sh && sh ghost-test.sh
@adamenger
adamenger / gist:73c087685a7855b63ff1
Created January 27, 2015 19:48
one-liner for updating CVE-2015-0235
sudo apt-get update && sudo apt-get install --only-upgrade libc6 -y && dpkg -s libc6 | grep Version && ./CVE-2015-0235
lsof | grep libc | awk '{print $1}' | sort | uniq
@adamenger
adamenger / gist:b1ead7694d3096388388
Last active August 29, 2015 14:14
simple deploy script
#!/bin/bash
# Simple bash deploy script by Adam Enger <[email protected]>
# Do what you want with this, no support or warranty given.
servers="1.2.3.4 1.2.3.5"
local_code_dir="/home/user/code"
remote_code_dir="/home/user/code"
deploy_user="user"
for server in $servers; do
@adamenger
adamenger / gist:9e7019a491165072836e
Created May 9, 2015 03:07
Angry Caching Proxy Dockerfile
FROM ubuntu:14.04
RUN apt-get update \
&& apt-get install curl -y -q \
&& curl -sL https://deb.nodesource.com/setup | sudo bash - \
&& apt-get install nodejs -y
RUN npm install -g angry-caching-proxy
RUN mkdir cache
Host github.com
IdentityFile ~/.ssh/id_rsa
Host 10.0.*.*
IdentityFile ~/.ssh/reverb.pem
@adamenger
adamenger / rolypoly.rb
Last active December 16, 2021 12:42
Elasticsearch Rolling Restart Script
require 'aws-sdk'
require 'elasticsearch'
require 'httparty'
require 'socket'
ec2 = AWS::EC2.new
# elasticsearch_cluster is just an array of ip's, so you could manually replace or use your api of choice to get them
elasticsearch_cluster = ec2.instances.with_tag('es_cluster_name', 'es_test').filter('instance-state-name', 'running').map{ |i| i.private_ip_address }
start_time = Time.now.to_i
@adamenger
adamenger / staging.tf
Created October 9, 2015 16:31
terraform staging example
variable "user_home" {}
variable "db_pass" {}
provider "aws" {
region = "us-east-1"
}
resource "aws_elb" "example" {
name = "example"