Skip to content

Instantly share code, notes, and snippets.

# First, install all of the things
sudo su
apt-get update
apt-get install nginx
/etc/init.d/nginx start
apt-get install python-dev
apt-get install python-pip
apt-get install libjpeg-dev libpng-dev libtiff-dev libjasper-dev libgtk2.0-dev python-numpy python-pycurl libwebp-dev python-opencv libjpeg-progs
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
@openrijal
openrijal / ip2geo.sh
Created April 3, 2013 18:33
Bash Script to find Geolocation from IP Addresses in apache's access log. You need to have "geoiplookup" package from GeoLite package. The excerpts are taken from http://danielmiessler.com/blog/a-simple-script-for-harvesting-dns-country-state-and-city-information-from-a-list-of-ip-addresses
#!/usr/bin/env bash
cat /var/log/apache2/access_log | awk '{print $1}' > ips.txt
uniq ips.txt > uniqips.txt
IPS=`cat uniqips.txt`
for i in $IPS
do
echo "$i,`geoiplookup $i | cut -d "," -f2 | sed -e 's/^[\t]//'`" >> ipinfo.csv
done