Skip to content

Instantly share code, notes, and snippets.

@bpinto
bpinto / 429.http
Last active June 10, 2022 13:29
haproxy throttling
HTTP/1.1 429 Too Many Requests
Cache-Control: no-cache
Connection: close
Content-Type: text/html
Retry-After: 60
<html><body><h1>429 Too Many Requests</h1>
Too many requests
</body></html>
@bpinto
bpinto / gist:5afa8b05eec7a8a6e107fd39d12be4f3
Created March 22, 2018 00:03
Wireguard kill-switch ignoring docker
# Adaptation from: https://git.zx2c4.com/WireGuard/about/src/tools/wg-quick.8
PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL ! -s 172.0.0.0/8 -j REJECT
PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL ! -s 172.0.0.0/8 -j REJECT

Keybase proof

I hereby claim:

  • I am bpinto on github.
  • I am bpinto (https://keybase.io/bpinto) on keybase.
  • I have a public key whose fingerprint is 91D2 A4F5 FBC1 42F2 3B76 008C D64E D06C 5443 61A0

To claim this, I am signing this object:

set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
@bpinto
bpinto / robot.js
Created December 7, 2012 21:17
Grande Pinto
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
robot.turnLeft(robot.angle % 90);
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
@bpinto
bpinto / robot.js
Created December 7, 2012 21:12 — forked from Firvagor/robot.js
W00t #1 YEAH!!!! (Zolmesiter)
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
//robot.turnGunRight(90);
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(1);
if (robot.parentId) {
@bpinto
bpinto / robot.js
Created December 5, 2012 18:17 — forked from fabiopimentel/robot.js
[CAELUM TEAM]Megatron
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();
@bpinto
bpinto / robot.js
Created December 5, 2012 18:16 — forked from Shipow/robot.js
Shipow#001
var Robot = function(robot) {
robot.rotateCannon(-90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead();
//i'll add a clone but i need to refactor collision
//robot.clone();
};
@bpinto
bpinto / Gemfile
Created August 25, 2012 03:17
Screencast Downloader
source :rubygems
gem 'curb'
gem 'nokogiri'
gem 'ruby-progressbar'
group :test, :development do
gem 'pry'
end
@bpinto
bpinto / cpf_generator.rb
Created June 12, 2012 23:30
Ruby CPF Generator
class CPF
def self.generate
digits = []
9.times { digits << rand(9) }
2.times { digits << self.verification_digit_for(digits) }
digits.join
end
private