Skip to content

Instantly share code, notes, and snippets.

View sirhopcount's full-sized avatar

Adrian van Dongen sirhopcount

View GitHub Profile
@sirhopcount
sirhopcount / dns-hack.sh
Created August 8, 2016 12:55 — forked from neilellis/dns-hack.sh
Fixes links on Alpine Linux
#!/usr/bin/with-contenv sh
if [ ! -f /etc/dnsmasq-resolv.conf ]
then
cp -f /etc/resolv.conf /etc/dnsmasq-resolv.conf
echo "nameserver 127.0.0.1" > /etc/resolv.conf
fi
while ! ps -ef | grep -v grep | grep dnsmasq-resolv.conf
do
sleep 1
@sirhopcount
sirhopcount / gist:b8b0404bb4d8adbec71d59e35ac3894e
Created August 4, 2016 19:15 — 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-840a0899"
},
"ap-northeast-1" : {
"AMI" : "ami-6c5ac56c"
@sirhopcount
sirhopcount / docker-register-2-list-images.sh
Created July 26, 2016 09:55 — forked from OndrejP/docker-register-2-list-images.sh
list all images on Docker Register v2
#!/bin/bash
export Register=https://register.example.com
export cLink="/v2/_catalog?n=10"
export cFile=docker.register.catalog
export tFile=docker.register.tags
function listFullCatalog {
while true; do
@sirhopcount
sirhopcount / README.md
Created July 22, 2016 12:39 — forked from jfromaniello/README.md
CoreOS template for CloudFormation with two EBS disks on /var/lib/docker

This is a fork from the original CoreOS cloud formation template. It adds two EBS disks of 30G, mounted to /var/lib/docker.

This is intended to be used with an m3.large machine which comes with 30G of SSD.

The reason I add two of 30 and not one of 60 is because a BTRFS limitation.

You can use the "btrfs add" approach in the units to create a BTRFS raid.

@sirhopcount
sirhopcount / scaleway-vagrant.txt
Last active July 4, 2016 13:21 — forked from Rahul91/Building custom kernel module
Howto install vagrant on a Scaleway C2L
Execute as root
* Install kernel headers
apt-get update && apt-get dist-upgrade
apt-get install -y build-essential libssl-dev
arch="$(uname -m)"
release="$(uname -r)"
upstream="${release%%-*}"
local="${release#*-}"
@sirhopcount
sirhopcount / System Design.md
Created April 22, 2016 14:58 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@sirhopcount
sirhopcount / chartjs_responsive_ajax_example.html
Created April 5, 2016 16:14 — forked from dancameron/chartjs_responsive_ajax_example.html
Responsive Chart.js Example with AJAX Callback
<canvas id="invoice_status_chart" min-height="300" max-height="500"></canvas>
<script type="text/javascript" charset="utf-8">
var invoice_status_data = {};
function invoice_status_chart() {
var can = jQuery('#invoice_status_chart');
var ctx = can.get(0).getContext("2d");
var container = can.parent().parent(); // get width from proper parent
@sirhopcount
sirhopcount / tmux.conf
Created April 1, 2016 06:24 — forked from atelic/tmux.conf
A vim-friendly tmux config
# change prefix to Ctrl-a (like in gnu-screen)
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# shell
set -g default-command /bin/zsh
set -g default-shell /bin/zsh
@sirhopcount
sirhopcount / tmux-cheatsheet.markdown
Created March 1, 2016 09:01 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sirhopcount
sirhopcount / gist:339f66b5e19fe2e4919b
Created December 14, 2015 09:51 — forked from gwenshap/gist:11390102
Generate fake apache access logs
#!/usr/bin/python
import time
import datetime
import random
timestr = time.strftime("%Y%m%d-%H%M%S")
f = open('access_log_'+timestr+'.log','w')
ips=["123.221.14.56","16.180.70.237","10.182.189.79","218.193.16.244","198.122.118.164","114.214.178.92","233.192.62.103","244.157.45.12","81.73.150.239","237.43.24.118"]
referers=["-","http://www.casualcyclist.com","http://bestcyclingreviews.com/top_online_shops","http://bleater.com","http://searchengine.com"]