Skip to content

Instantly share code, notes, and snippets.

@martincharlesworth
martincharlesworth / snort_mavericks.sh
Last active December 22, 2019 01:10
Install Snort on OS X Mavericks
#!/bin/sh
brew install libdnet
curl -O https://www.snort.org/downloads/snort/daq-2.0.2.tar.gz
tar xvfz daq-2.0.2.tar.gz
cd daq-2.0.2
./configure; make; sudo make install
@martincharlesworth
martincharlesworth / suricata_mavericks.sh
Last active August 29, 2015 14:05
Install Suricata on OS X Mavericks
#!/bin/sh
curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz
tar xvzf pcre-8.35.tar.gz
cd pcre-8.35
./configure --enable-jit
make
sudo make install
curl -O http://www.openinfosecfoundation.org/download/suricata-2.0.3.tar.gz
@martincharlesworth
martincharlesworth / crawluniq.js
Last active September 10, 2018 06:52
PhantomJS crawler written to detect Mixed Content
var uniqUrls = [];
var urlsToBrowse = [];
var browsedUrls = [];
function open(url, callback) {
var page = require('webpage').create();
page.settings.loadImages = true;
page.onResourceReceived = function (response) {
if (response.stage == "start" && response.url.substr(0, 4) === "http" && uniqUrls.indexOf(response.url) === -1) {
@martincharlesworth
martincharlesworth / minitesting_a_gem.md
Last active January 3, 2016 08:29
ruby testing with minitest

Testing a gem with minitest

Add test dir to gem's root

mkdir test

Create test/test_helper.rb

require 'simplecov'
@martincharlesworth
martincharlesworth / .vimrc
Last active January 3, 2016 08:09
.vimrc for ruby
execute pathogen#infect()
syntax on
filetype plugin indent on
colorscheme ron
autocmd Filetype html setlocal ts=2 sw=2 expandtab
autocmd Filetype ruby setlocal ts=2 sw=2 expandtab
autocmd Filetype javascript setlocal ts=4 sw=4 sts=0 noexpandtab