Skip to content

Instantly share code, notes, and snippets.

@wellsie
wellsie / gist:6150926
Created August 4, 2013 16:39
sudo su
sudo su jenkins -s /bin/bash
@wellsie
wellsie / gist:6150991
Created August 4, 2013 16:56
history without line numbers
history | cut -c 8-
@wellsie
wellsie / gist:6156651
Created August 5, 2013 15:08
scan local subnet ports 80 and 22
sudo nmap -sS -p22,80 192.168.10.0/24
# -*- coding: utf-8 -*-
"""Calculate the current package version number based on git tags.
If possible, use the output of “git describe” modified to conform to the
versioning scheme that setuptools uses (see PEP 386). Releases must be
labelled with annotated tags (signed tags are annotated) of the following
format:
v<num>(.<num>)+ [ {a|b|c|rc} <num> (.<num>)* ]
@wellsie
wellsie / travisci-aws-creds.sh
Last active August 29, 2015 14:04 — forked from kzap/gist:5819745
Shell script that adds AWS credentials from your environment and packages them in your projects .travis.yml file. The script accepts a file parameter that points the to a pem file that you wish to encrypt and include in your project. A symmetric key is generated and it itself is encrypted and included in your .travis.yml file. This key is used t…
#!/bin/sh
#
# Author:: Jono Wells (_@oj.io)
# http://oj.io
# Encrypt AWS creds for travis-ci
#
# Copyright 2014, Jono Wells
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@wellsie
wellsie / boot.js
Last active August 29, 2015 14:09 — forked from jdx/boot.js
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run
var casper = require('casper').create();
var webpage = "http://wordpress.org/";
casper.on('resource.requested', function(resource) {
for (var obj in resource.headers) {
var name = resource.headers[obj].name;
var value = resource.headers[obj].value;
if (name == "User-Agent"){
@wellsie
wellsie / gist:7be4f8e536f53b567e0b
Last active June 7, 2017 10:49 — forked from tjcorr/gist:3baf86051471062b2fb7
CloudFormation to demo etcd-aws-cluster
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "An etcd cluster based off an auto scaling group",
"Mappings" : {
"RegionMap" : {
"eu-central-1" : {
"AMI" : "ami-ffafb293"
},
"ap-northeast-1" : {
"AMI" : "ami-dae8c1b4"
@wellsie
wellsie / docker-compose.yml
Created January 11, 2016 22:52
kubernetes in docker-machine
etcd:
image: gcr.io/google_containers/etcd:2.0.12
net: host
command: /usr/local/bin/etcd --addr=127.0.0.1:4001 --bind-addr=0.0.0.0:4001 --data-dir=/var/etcd/data
kubernetes:
image: gcr.io/google_containers/hyperkube:v1.0.1
net: host
pid: host
privileged: true
@wellsie
wellsie / module_publish_to_aws_cloudwatch_logs.tf
Created January 18, 2016 06:36 — forked from conorgil/module_publish_to_aws_cloudwatch_logs.tf
Sharing IAM Role Policies between multiple IAM Roles
# AWS Cloudwatch Logs install documentation:
# https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/QuickStartEC2Instance.html
# By defining this IAM Role Policy in a module, it can be referenced anywhere it is required
# for an IAM Role. This is preferrable to copy/pasting the IAM Policy statement because changes
# made to this role will automatically apply to all IAM Roles referencing this module.
###
# Variables
###