Skip to content

Instantly share code, notes, and snippets.

View adulau's full-sized avatar
👨‍💻
Doing stuff

Alexandre Dulaunoy adulau

👨‍💻
Doing stuff
View GitHub Profile
dnstap-ldns
./configure libldns_CFLAGS="-I/usr/local/include" libldns_LIBS="-lldns"
fstrm_capture -t protobuf:dnstap.Dnstap -u /tmp/dnstap.sock -w - -ddddd | ..git/dnstap-ldns/dnstap-ldns -r -
@adulau
adulau / iporigin.pl
Created November 14, 2010 09:45
Lookup origin, country and BGP Ranking for a given IP address
#!/usr/bin/perl
#
# Takes as input IP address (one per line)
# and output the guessed IP location along with ASN origin and its description
# and the BGP Ranking of each ASN
#
#perl ip2asn.pl
# www.microsoft.com
# US;AS8075;MICROSOFT-CORP---MSN-AS-BLOCK - Microsoft Corp;65.55.12.249;8075,1.00036643769349,3/9
# 8.8.8.8
@adulau
adulau / tabula_recta.py
Created February 11, 2011 21:34 — forked from maxcountryman/tabula_recta.py
Generates a string from a randomly generated tabula recta that is hopefully secure.
#! /usr/bin/env python
import sys
import json
import argparse
from string import uppercase, digits, letters, punctuation
from random import SystemRandom
FULL_MAP = letters + digits + punctuation
@adulau
adulau / gist:1671774
Created January 24, 2012 18:36
Vim blueish stuff
set background=dark "or light
highlight clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "vivify"
set t_Co=256
highlight Boolean guifg=#00ffff ctermfg=14 gui=none cterm=none
highlight CTagsClass guifg=#eeeeee ctermfg=255 gui=none cterm=none
@adulau
adulau / pr.md
Created September 18, 2012 09:57 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@adulau
adulau / gist:3881180
Created October 12, 2012 19:59
CRL revocation reasons from 2011 to 2012 (some notes)
Updated data from my analysis of X.509 Certificate Revocation Reasons (from public Certificate Revocation List) from 2011 to 2012.
http://www.foo.be/cgi-bin/wiki.pl/2011-12-17_Certificate_Revocation_Reasons_2011
Current dataset size (one day): 364MBytes
Overall history (from 2011 to 2012): 15GBytes (compressed)
== 20111218 ==
1 10
@adulau
adulau / MySQL Dump Tables
Created November 25, 2012 09:33 — forked from stupergenius/MySQL Dump Tables
Bash script that dumps all the tables of a given database, each table to its own file.
#!/bin/bash
if [ "$1" == "" ]; then
echo "Usage: $0 [output-path]"
exit 1
fi
TABLES=`mysql -B -N -e "select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='$1'"`
OUT="$2"
@adulau
adulau / gist:4706836
Last active December 12, 2015 03:28
Convert Windows NTFS 64bit timestamp to epoch timestamp
def ntfsts2epoch(ts):
filetime_posix=11644473600L*10000000 #from 64bit NTFS timestamp (16010101) to 64bit epoch timestamp (19700101)
return int(str((ts-filetime_posix))[:10])
print ntfsts2epoch(130042164473271112)
@adulau
adulau / aive-data.md
Last active December 15, 2015 07:58
Notes about analyzing data from AIVE

AIVE Waste Analysis

Source

JP Florent gave me an XLS file containing the statistic of the waste collected from 2010, 2011 and 2012. The initial file is not really machine friendly as the spreadsheet is used for human reading. This is another important point with open data. Usually a lot of claimed to be "open data" is in an format that you cannot easily parse and need a lot of conversion to be understandable by a machine.

Conversion

@adulau
adulau / HRNG.md
Last active December 30, 2015 21:19
Hardware Random Generator