Skip to content

Instantly share code, notes, and snippets.

View rodrigobaron's full-sized avatar
👾

Rodrigo Baron rodrigobaron

👾
View GitHub Profile
@rodrigobaron
rodrigobaron / basic.firewall
Last active September 26, 2015 11:47
Script iptables basico
#! /bin/bash
#Autor: B4R0n
#Agradecimentos: Alexandre, Carlos, C00ler_, D3lf0, rem
#
echo "Configurando Firewall (basico) .."
iptables -N basic-chain
iptables -A basic-chain -j LOG
#ping da morte e scans default de nmap (noobs)
@rodrigobaron
rodrigobaron / pf.conf
Created July 20, 2011 02:57
Regras basicas para packet filter
#Autor: B4R0n
#Organizacao: geekvigarista.com
#Agradecimentos: Alexandre, Carlos, C00ler_, D3lf0, Tito, Sexta ...
#
#minha interfaces de rede
if_ext = "{re0 wlan0}"
#tabela dos fdp
table <fdp> persist
# Nao filtra na interface loopback
@rodrigobaron
rodrigobaron / mvps_hosts.sh
Created May 29, 2013 12:25
Block ads .. banner and another shits ..
# -*- coding: UTF-8 -*- # ###################################################
# #
# mvps_hosts - Sync MVPS HOSTS #
# #
# DESCRIPTION #
# The Sync MVPS HOSTS backup your hosts file ... download the mvps hosts #
# and join into the new hosts file... if you need add or remove a custom host #
# change the older file "/etc/hosts_bak" #
# #
# REQUERIMENT #
@rodrigobaron
rodrigobaron / gist:5956591
Created July 9, 2013 11:16
solve strong_parameters issue for cancan + rails 4 .. source: https://github.com/ryanb/cancan/issues/835
#Add this code in ApplicationController
before_filter do
resource = controller_name.singularize.to_sym
method = "#{resource}_params"
params[resource] &&= send(method) if respond_to?(method, true)
end
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
// Sample grunt-jekyll grunt.js file
// https://github.com/dannygarcia/grunt-jekyll
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jekyll: {
@rodrigobaron
rodrigobaron / FigBoot2docker
Created February 17, 2015 16:14
Fig support on boot2docker
alias fig='docker run --rm -it \
-v $(pwd):/app \
-v /var/run/docker.sock:/var/run/docker.sock \
-e FIG_PROJECT_NAME=$(basename $(pwd)) \
dduportal/fig'
# soucer https://github.com/docker/fig/issues/598#issuecomment-62174187
@rodrigobaron
rodrigobaron / gist:9a1599c64c87adfcf23f
Created February 17, 2015 21:42
boot2docker guest additionals
1 - Download from http://static.dockerfiles.io/boot2docker-v1.1.2-virtualbox-guest-additions-v4.3.12.iso
2 - Move to $HOME\.boot2docker
3 - /c/Program\ Files/Oracle/VirtualBox/VBoxManage.exe sharedfolder add boot2docker-vm -name home -hostpath $HOME
xrandr --output $SEC_SCREEN --right-of $MAIN_SCREEN