Skip to content

Instantly share code, notes, and snippets.

View gmodena's full-sized avatar

Gabriele Modena gmodena

View GitHub Profile
@gmodena
gmodena / pom.xml
Created November 17, 2013 15:00 — forked from jnatkins/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- Replace the group ID with your group ID -->
<groupId>com.mycompany.hadoopproject</groupId>
<!-- Replace the artifact ID with the name of your project -->
<artifactId>my-hadoop-project</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
@gmodena
gmodena / install.rCharts.r
Created June 24, 2013 07:55
Install devtools rcharts
install.packages('httr')
install.packages('RCurl')
install.packages('memoise')
install.packages('whisker')
dt <- "http://cran.r-project.org/src/contrib/Archive/devtools/devtools_1.1.tar.gz"
fname <- "/tmp/devtools_1.1.tar.gz"
download.file(dt , fname)
install.packages(fname , repos = NULL , type = "source")
@gmodena
gmodena / locateip.py
Created March 16, 2011 10:45
Mine failed login attempts from auth.log and display them on a map (static google map or KML file)
import urllib2, json, re
from itertools import imap
import argparse
import simplekml
BASE = "http://freegeoip.net/json/%(ip4)s"
r1 = 'Authentication failure for .* from (?:::f{4,6}:)?(?P<host>\S+)'
r2 = '[iI](?:llegal|nvalid) user .* from (?:::f{4,6}:)?(?P<host>\S+)'