Skip to content

Instantly share code, notes, and snippets.

View sirhopcount's full-sized avatar

Adrian van Dongen sirhopcount

View GitHub Profile
@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 / .bashrc
Last active April 25, 2016 14:10
Make vim and tmux place play nic
# Needed for tmux and vim to play nice
if [ "$TERM" == "screen-256color" ]; then
bind '"\e[1;5C": forward-word'
bind '"\e[1;5D": backward-word'
fi
@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"]
@sirhopcount
sirhopcount / mopidy.liq
Created November 8, 2015 16:59 — forked from dz0ny/mopidy.liq
Gapless streaming for mopidy
#!/usr/bin/liquidsoap
set("log.file.path", "/dev/null")
set("log.stdout", true)
set("server.telnet", false)
set("harbor.bind_addr","0.0.0.0")
# tweak these values if you have lag, skipping, buffer underrun etc
# set("frame.duration",0.04)
# set("root.max_latency",60.)
@sirhopcount
sirhopcount / volume.rb
Created October 20, 2015 16:30 — forked from uriel1998/volume.rb
Set PulseAudio volume, mute, unmute, and change default sink (and automagically switch running audio streams) from the commandline
#!/usr/bin/ruby
#
# Moved to: https://github.com/uriel1998/volumerb
#
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
# Unported License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-sa/3.0/.
#
# Forked/derived from original by Jasper Van der Jeugt (jaspervdj);
@sirhopcount
sirhopcount / genhttplogs.rb
Last active September 11, 2015 08:09 — forked from fetep/genhttplogs.rb
apache log generator
#!/usr/bin/ruby
class IPGenerator
public
def initialize(session_count, session_length)
@session_count = session_count
@session_length = session_length
@sessions = {}
end