Skip to content

Instantly share code, notes, and snippets.

FROM python:2.7
ENV PYTHONUNBUFFERED 1
WORKDIR /app
EXPOSE 7001
ENTRYPOINT gunicorn -b 0.0.0.0:7001 leaderboard.wsgi
RUN apt-get update && apt-get install -y binutils libproj-dev gdal-bin && apt-get -y clean
COPY ./requirements.txt /app/requirements.txt
@mostlygeek
mostlygeek / lambda_cloudsearch.js
Created November 3, 2015 23:45 — forked from fzakaria/lambda_cloudsearch.js
Send CloudTrail events to CloudSearch with AWS Lambda
console.log('Loading event');
var CLOUDSEARCH_ENDPOINT = < INSERT HERE >
var async = require('async');
var jpath = require('json-path')
var zlib = require('zlib');
var aws = require('aws-sdk');
var s3 = new aws.S3({
apiVersion: '2006-03-01'
});
@mostlygeek
mostlygeek / setup-storage.txt
Created September 16, 2015 22:03
docker storage (non loop back) for centos 7
Assumes Linux!
1) Create a new PV for docker
pvcreate -ff /dev/<free device or partition>
2) Create a new VG for docker (docker-vg)
vgcreate docker-vg /dev/the-one-you-used-above
3) Create a new LV for docker-data and docker-metadata; data should be much larger than meta. (docker-{data,meta})
lvcreate -n docker-data -L <size>G /dev/docker-vg
@mostlygeek
mostlygeek / cron splice
Created July 18, 2015 18:25
splice hacks
# cron changes
# Puppet Name: tiles_monitor_splice_tiles_index_crawl
SPLICE_SETTINGS=splice_config.SpliceConfig
* * * * * /usr/local/bin/splice_tiles_index_crawl.sh 2>&1 | logger -t splice_tiles_index_crawl
# due a bug in splice_tiles_index_crawl.sh failing sometimes, (greenlets, ew)
* * * * * /usr/local/bin/splice_tiles_watchdog.sh 180 | logger -t splice_tiles_index_crawl
@mostlygeek
mostlygeek / rds-restore-tests.md
Created July 3, 2015 20:22
RDS Point in time Restore tests

Point RDS time TESTING INFORMATION (1hr, 6hr, 12hr, 24hr)

1 HOUR TEST

Summary Info:
--------------------------------------
Snapshot create time: 2015-06-21T16:01:28+00:00
Restore delta       : +60 minutes
Restored to : 2015-06-21T17:01:28+00:00
@mostlygeek
mostlygeek / gist:578d16b3bd4a0515aa92
Created April 27, 2015 22:36
override x-forwarded-for for openresty
# NGINX
location / {
set $forwarded_for $proxy_add_x_forwarded_for;
if ($http_x_verify_ip) {
set $forwarded_for $http_x_verify_ip;
}
@mostlygeek
mostlygeek / gist:390bdd6fdf1e688ec336
Created April 15, 2015 17:24
Bash function to make validating cfn templates easier
function cfnvalidate {
aws cloudformation validate-template --template-body file://$1
}
@mostlygeek
mostlygeek / setup.sh
Last active August 29, 2015 14:06
setup-systemd-test-shutdown.sh
#!/bin/sh
rm /tmp/process-log-shutdown.txt
rm /tmp/last-shutdown.txt
cat > "//usr/local/bin/fake-daemon.sh" << 'EOF'
#!/bin/sh
OUTFILE=/tmp/process-log-shutdown.txt
SLEEP_PID=
@mostlygeek
mostlygeek / gist:196fa15c2216029b8168
Created September 8, 2014 03:15
realtor.ca grease monkey script
// ==UserScript==
// @name realtor-ca-tweaks
// @namespace mostlygeek.com
// @description realtor.ca tweaks
// @version 1
// @grant none
// @requiref https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js
// ==/UserScript==
var el = $('#m_property_dtl_address')
var address = el.text()
@mostlygeek
mostlygeek / max.sh
Last active August 29, 2015 14:05
ec2 tcp max it out!
#!/bin/sh
sysctl -w net.ipv4.ip_local_port_range='2000 65000'
sysctl -w net.ipv4.tcp_window_scaling='1';
sysctl -w net.ipv4.tcp_max_syn_backlog='3240000';
sysctl -w net.core.somaxconn='65535';
sysctl -w net.ipv4.tcp_max_tw_buckets='1440000';
sysctl -w net.core.rmem_default='8388608';
sysctl -w net.core.rmem_max='16777216';
sysctl -w net.core.wmem_max='16777216';