Skip to content

Instantly share code, notes, and snippets.

View carlosm3011's full-sized avatar
💭
Mining Internet and RPKI routing data

Carlos Martinez-Cagnazzo carlosm3011

💭
Mining Internet and RPKI routing data
View GitHub Profile
@carlosm3011
carlosm3011 / run.sh
Created November 19, 2015 21:07
run.sh for setting env variables for python apps
#!/bin/bash
####################################################################
# Python wrapper - sets env variables appropiately
# v2 - 20151109
####################################################################
# change this PYTHON variable if using an alternative python
# interpreter
PYTHON="/usr/bin/python"
export SRCHOME=$(pwd)
@carlosm3011
carlosm3011 / mongodb_date_to_timestamp.py
Created July 1, 2015 18:10
Convert MongoDB Date() to Unix TS in Python
import datetime
import time
a="Date(2015,6,0,23,58,0)"
b=a[5:-1]
c=[int(x) for x in b.split(",")]
d=datetime.datetime(c[0],c[1]+1,c[2]+1,c[3],c[4],c[5])
timestamp = time.mktime(d.timetuple())
print d
print timestamp
@carlosm3011
carlosm3011 / db.training.lacnic.net
Created April 19, 2012 09:31
IPv6 HandsOn LACNIC - Zone File para DNS
$ORIGIN training.lacnic.net.
$TTL 15 ; 1 minute
@ IN SOA training.lacnic.net. root.localhost. (
2011092606 ; serial
604800 ; refresh (1 week)
86400 ; retry (1 day)
2419200 ; expire (4 weeks)
604800 ; minimum (1 week)
)