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 / gitio
Created May 10, 2013 11:45 — forked from defunkt/gitio
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]
@perusio
perusio / gist:5212090
Last active December 15, 2015 05:49 — forked from anonymous/gist:5212082

#Authorize.net test credentials

API Login ID: 2VcPa843DT6

Transaction Key: 9g5a2x66nL9RmUzv

Transaction mode: Developer test account transactions

Default credit card transaction type: Authorization only

@perusio
perusio / gist:5017911
Last active December 14, 2015 02:59 — forked from shrikeh/csrf-lua.conf
server {
listen 80;
root /root/to/your/docroot;
proxy_redirect off;
proxy_intercept_errors on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
@perusio
perusio / gist:4404063
Last active July 29, 2017 02:08 — forked from jpluscplusm/gist:4366287
A pirate bay proxy configuration for Nginx
server {
listen 80; # IPv4
listen [::]:80 ipv6only=on; # IPv6
server_name ~^(?<thishost>[^.]+\.)?subdomain\.example\.com$;
access_log off;
location / {
## Resolve the upstream address using this DNS server or any other.
## Choose the one that suits you.
@perusio
perusio / Vector.lua
Created October 29, 2012 12:16 — forked from mebens/Vector.lua
Vector class for my tutorial on Lua metatables.
Vector = {}
Vector.__index = Vector
function Vector.__add(a, b)
if type(a) == "number" then
return Vector.new(b.x + a, b.y + a)
elseif type(b) == "number" then
return Vector.new(a.x + b, a.y + b)
else
return Vector.new(a.x + b.x, a.y + b.y)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>index</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="Aaron Gibralter">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js" type="text/javascript" charset="utf-8"></script>
</head>
@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 / sharded-balancing-nginx.txt
Created March 21, 2012 23:58 — forked from zzzcpan/sharded-balancing-nginx.txt
Sharded load balancing with nginx and perl
# Balancing over 4 nodes by hashing URI (consistently with md5)
# onto 16 shards.
upstream x0 { server 192.168.0.2; server 192.168.0.3 backup; }
upstream x1 { server 192.168.0.2; server 192.168.0.4 backup; }
upstream x2 { server 192.168.0.2; server 192.168.0.5 backup; }
upstream x3 { server 192.168.0.2; server 192.168.0.3 backup; }
upstream x4 { server 192.168.0.3; server 192.168.0.4 backup; }
@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