Skip to content

Instantly share code, notes, and snippets.

View floodedcodeboy's full-sized avatar

Jacob Gabriel floodedcodeboy

  • London, United Kingdom
  • 13:42 (UTC +01:00)
View GitHub Profile
@floodedcodeboy
floodedcodeboy / packer-bootstrap.sh
Last active March 23, 2024 05:54 — forked from bkw/preseed.cfg
packer.io config files to go from pristine vanilla ubuntu 12.04 LTS to a docker.io and chef-enabled vagrant box The resulting image is still a bit large and doesn't yet follow all the vagrant conventions, but it's a start.
#!/bin/sh
## install software for the base box to come packaged with - these will always be updated with chef/pupput
apt-get -y update && apt-get -y upgrade
apt-get install -y linux-image-generic-lts-raring linux-headers-generic-lts-raring build-essential dkms rubygems lxc-docker zlib1g-dev libssl-dev libreadline6-dev libyaml-dev ruby1.8 curl wget git-core gcc g++ make autoconf python-software-properties screen puppet puppetmaster openssl-server
sudo /usr/bin/gem install chef ruby-shadow --no-ri --no-rdoc
## create the vagrant user
sudo useradd -d /home/vagrant -m vagrant -p vagrant

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:

@floodedcodeboy
floodedcodeboy / varnishlog-examples.sh
Created May 4, 2018 09:53 — forked from cupracer/varnishlog-examples.sh
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header