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
@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 / vcard2qrcode.pl
Created December 6, 2010 20:56
VCARD to QRcode
#!/usr/bin/perl
#
use GD::Barcode::QRcode;
open(X, ">./out.png");
binmode(X);
my $vcard = "
BEGIN:VCARD
N:Lastname;Firstname
@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 / hn2bookmarks.pl
Created April 24, 2011 15:32
Perl script to dump the urls submitted by an HN user (news.ycombinator.com)
#!/usr/bin/perl
#
#
# This perl script is dumping the urls submitted
# by an HN user. Sometime it's better than any
# del.icio.us stream when the HN user has some
# special interests.
#
# Usage:
#
@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 / DumpLinuxMemory.md
Created March 5, 2013 22:03
Acquiring memory from a running Linux system (notes)

How to acquire memory from a running Linux system

Dumping memory on Linux system can be cumbersome especially that the behavior might be different among different GNU/Linux distribution or Linux kernel version. In the early days, the easiest was to dump the memory from the memory device (/dev/mem) but over time the access was more and more restricted in order to avoid malicious process to directly access the kernel memory directly. The kernel option CONFIG_STRICT_DEVMEM was introduced in kernel version 2.6 and upper (2.6.36–2.6.39, 3.0–3.8, 3.8+HEAD). So you'll need to use a Linux kernel module in order to acquire memory.

fmem