Skip to content

Instantly share code, notes, and snippets.

View perusio's full-sized avatar

António P. P. Almeida perusio

View GitHub Profile
@perusio
perusio / ideal ops.md
Created May 29, 2012 11:55 — forked from bhenerey/ideal ops.md
ideal ops checklist

In a perfect world, where things are done well, not just quickly, I would expect to find the following when joining the company:

Documentation

  • Accurate / up-to-date systems architecture diagram

  • Accurate / up-to-date network diagram

  • Out-of-hours support plan

  • Incident management plan

@perusio
perusio / screencast.sh
Created March 25, 2012 17:09 — forked from pomeo/screencast.sh
script to make screencasts on Linux
#!/bin/bash
# list of programs we depend on
progs="xdpyinfo grep head sed ffmpeg pacat parec sox"
# check for programs we depend on
result=0
for prog in $progs
do
type -p $prog > /dev/null
@perusio
perusio / .gitignore
Created March 4, 2012 17:29 — forked from aussielunix/.gitignore
jenkins configs to github
#
# The following ignores...
# Miscellaneous Jenkins litter
*.log
*.tmp
*.old
*.bak
*.jar
*.json
(define (s:reify thunk)
(reset-at 'state (s:return (thunk))))
(define (s:reflect m)
(shift-at 'state k (s:>>= m k)))
(define (r:reify thunk)
(reset-at 'reader (return (thunk))))
(define (r:reflect m)
#!r6rs
;; Really simple generators using delimited continuations
(library (toys simple-generators)
(export make-generator
up-from
list->generator)
(import (rnrs)
(spells delimited-control))
(use-modules (ice-9 control)
(rnrs hashtables)
(web server)
(sxml simple)
(web response)
(web request)
(web uri)
(ice-9 match))
;; utilities
@perusio
perusio / memcached_keys_list.rb
Created January 27, 2012 19:09 — forked from stackdump/gist:1479007
List the keys in a given memcached instance running locally
#!/usr/bin/env ruby
require 'net/telnet'
cache_dump_limit = 100
localhost = Net::Telnet::new("Host" => "localhost", "Port" => 11211, "Timeout" => 3)
slab_ids = []
localhost.cmd("String" => "stats items", "Match" => /^END/) do |c|
matches = c.scan(/STAT items:(\d+):/)
slab_ids = matches.flatten.uniq
end
@perusio
perusio / pingfcgi.sh
Created January 15, 2012 19:31 — forked from mpasternacki/pingfcgi.sh
Ping FCGI server, using cgi-fcgi program from libfcgi library.
#!/bin/sh
set -e
# Ping FCGI server. Uses cgi-fcgi program from libfcgi library.
# Retrieves the root path (/) from host:port specified on command line.
if [ -z "$1" ] ; then
echo "Usage: $0 host:port|path/to/socket" >&2
exit 1
fi
function doHash(str, seed) {
var m = 0x5bd1e995;
var r = 24;
var h = seed ^ str.length;
var length = str.length;
var currentIndex = 0;
while (length >= 4) {
var k = UInt32(str, currentIndex);
@perusio
perusio / access.lua
Last active August 29, 2015 14:27 — forked from josegonzalez/access.lua
Simple lua file enabling oauth support for nginx via nginx-lua and access_by_lua.
- certain endpoints are always blocked
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then
ngx.exit(403)
end
-- import requirements
local cjson = require "cjson"
-- setup some app-level vars
local app_id = "APP_ID"