Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
# init.d script with LSB support.
#
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.

Create an empty directory, download the code and run it:

$ mkdir /tmp/lj
$ cd /tmp/lj
$ wget https://gist.github.com/benbjohnson/5622779/raw/e53d227ebdbea8d513b62ad076feb3f6ac1c1594/luajit.go
$ go run luajit.go

And you should see:

### Add those lines after *filter near the beginning of the file
:ufw-http - [0:0]
:ufw-http-logdrop - [0:0]
### Add those lines near the end of the file
### Start HTTP ###
@millken
millken / nginx.conf
Last active September 11, 2015 07:50 — forked from jmervine/nginx.conf
Nginx config to test regex.
# Usage:
#
# Start with:
#
# sudo /use/local/sbin/nginx -c /path/to/this/nginx.conf
#
# Tail logs:
#
# $ sudo tail -f /tmp/access.log /tmp/error.log /tmp/match.log
#
@millken
millken / haproxy.cfg
Created January 25, 2016 14:15 — forked from anonymous/haproxy.cfg
haproxy forward
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
defaults
@millken
millken / file0.txt
Created June 8, 2016 05:25 — forked from giwa/file0.txt
Install g++/gcc 4.8.2 in CentOS 6.6 ref: http://qiita.com/giwa/items/28c754d8fc2936c0f6d2
$ wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
$ yum install devtoolset-2-gcc devtoolset-2-binutils
$ yum install devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran
@millken
millken / source_nic_sink.lua
Created July 7, 2016 08:14 — forked from dpino/source_nic_sink.lua
source_nic_sink
-- Source -> NIC -> Sink
-- Execute in "chur":
-- sudo ./snabb snsh source_nic_sink.lua
--
-- link report:
-- 2 sent on nic1.tx -> sink.in1 (loss rate: 0%)
-- 12,600,876 sent on source.out -> nic1.rx (loss rate: 0%)
local basic_apps = require("apps.basic.basic_apps")
@millken
millken / BotBuster.md
Created February 23, 2017 06:35 — forked from hsiboy/BotBuster.md
Bot-Buster™ - Tracks nefarious activity on website, and manages accordingly.

#Bot-Buster™

Tracks nefarious activity on website, and manages accordingly.

##It's probably a bot.

If the requesting entity:

  • declares its user-agent as being wget, curl, webcopier etc - it's probably a bot.
  • requests details -> details -> details -> details ad nauseum - it's probably a bot.
  • requests the html, but not .css, .js or site furniture - it's probably a bot.
@millken
millken / install.sh
Created March 21, 2017 09:19 — forked from marklit/install.sh
Bot Detection Script. Works with Apache and Nginx Log Files.
sudo apt-get update
sudo apt-get install \
python-dev \
python-pip \
python-virtualenv
virtualenv findbots
source findbots/bin/activate
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
# Got from https://www.digitalocean.com/community/questions/how-to-install-pptp-vpn-on-centos-7 and changed new workable epel rpm url
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
yum -y install ppp pptpd
cp /etc/pptpd.conf /etc/pptpd.conf.bak
cat >/etc/pptpd.conf<<EOF
option /etc/ppp/options.pptpd
logwtmp
localip 10.0.10.1
remoteip 10.0.10.2-254