Skip to content

Instantly share code, notes, and snippets.

@mhoffmann
mhoffmann / nginxnaxsi.sh
Created October 7, 2016 06:51
compile latest nginx with naxsi on ubuntu
#!/usr/bin/env bash
apt-get install -y libpcre3 libpcre3-dev libssl-dev unzip make \
libgoogle-perftools-dev google-perftools jq
mkdir /tmp/ngxbuild
cd /tmp/ngxbuild
latestNginx=$(curl -s http://hg.nginx.org/nginx/tags |
grep "^ *release-" | head -1 | cut -c 9-)
latestNaxsi=$(curl -s https://api.github.com/repos/nbs-system/naxsi/releases |
jq -r .[].tag_name | grep -v rc | head -1)
@mhoffmann
mhoffmann / loadGeoIp.sh
Created June 28, 2016 02:46
script to load GeoLite2 Database into MySQL
#!/usr/bin/env bash
#apt-get install -y unzip
wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip
unzip GeoLite2-City-CSV.zip
cd GeoLite2-City-CSV_*
mv GeoLite2-City-Blocks-IPv4.csv /tmp/GeoLite2-City-Blocks-IPv4.csv
mv GeoLite2-City-Locations-en.csv /tmp/GeoLite2-City-Locations-en.csv
mysqladmin create geoip