Skip to content

Instantly share code, notes, and snippets.

View fabriceleal's full-sized avatar
😫
meh

Fabrice Ferreira Leal fabriceleal

😫
meh
  • Leiria, Portugal
View GitHub Profile
@fabriceleal
fabriceleal / gist:5900143
Last active March 31, 2022 19:59
Recursively download site with wget
wget -r -k -p the-site -X exclude-dir-1,exclude-dir-2
(* author: Dimitur Krustev *)
(* started: 20130616 *)
(* based on: http://siek.blogspot.com/2013/05/type-safety-in-three-easy-lemmas.html *)
Require Import Arith List Bool.
Set Implicit Arguments.
Section Lang.
@fabriceleal
fabriceleal / gist:5865950
Created June 26, 2013 09:13
Create file-as-black-hole
ln -s /dev/null php.log
@fabriceleal
fabriceleal / gist:5812580
Created June 19, 2013 08:18
git compare branches
# http://stackoverflow.com/questions/9834689/compare-two-branches-in-git
# https://www.kernel.org/pub/software/scm/git/docs/git-diff.html
# Normal diff
git diff a_branch..master
# Only filenames
git diff --numstat a_branch..master
@fabriceleal
fabriceleal / gist:5776544
Last active December 18, 2015 11:38
Polymorphism in Javascript
Object.prototype.test = function(){ console.log('an object')};
Array.prototype.test = function(){ console.log('an array')};
Number.prototype.test = function(){ console.log('a number')};
var a = {};
a.test(); // prints "an object"
a = [];
a.test(); // prints "an array"
@fabriceleal
fabriceleal / gist:5766186
Created June 12, 2013 15:15
Manage cached network credentials
rundll32.exe keymgr.dll, KRShowKeyMgr

Guide to how fucked is SSL?

Thanks to Jacob Kaplan-Moss, Donald Stufft, David Reid, Allen Short, Zain Memon, and Chris Armstrong for review.

This is a guide for technical individuals to understand in what circumstances SSL communications are secure against an observer-in-the-middle (for all intents and purposes: the NSA).

@fabriceleal
fabriceleal / gist:5755525
Created June 11, 2013 09:12
Git: How to remove file from history
# From http://stackoverflow.com/a/8741530
git filter-branch --index-filter 'git rm --cached --ignore-unmatch Smarty/templates_c/*' --tag-name-filter cat -- --all
@fabriceleal
fabriceleal / gist:5755234
Created June 11, 2013 08:16
How to recursively find and list the latest modified files in a directory with subdirectories and times?
# From http://stackoverflow.com/a/7448828/1647507
find . -type f -exec stat --format '%Y :%y %n' {} \; | sort -nr | cut -d: -f2- | head
@fabriceleal
fabriceleal / gist:5669525
Last active February 19, 2016 09:42
mysql - usefull stuff with users
-- http://dba.stackexchange.com/questions/13083/cant-remove-grant-usage
-- in host, use '%' as wildcard
grant usage on *.* to 'user'@'host' identified by 'password';
grant all privileges on database.* to 'user'@'host';
show grants;
show grants for user;
show grants for user@host;
grant super on *.* to 'user'@'host' identified by 'password';