Skip to content

Instantly share code, notes, and snippets.

View rosstimson's full-sized avatar

Ross Timson rosstimson

View GitHub Profile
HOSTLAPTOP:Sites % docker run -it -v `pwd`:/host jekyll/jekyll bash
Starting services.
root@eb4d2d2fa755:/srv/jekyll# cd /host/
root@eb4d2d2fa755:/host# jekyll new my-jekyll-site
New jekyll site installed in /host/my-jekyll-site.
root@eb4d2d2fa755:/host# exit
Stopping services.
@rosstimson
rosstimson / libreswan_setup.sh
Created October 2, 2014 21:52
Libreswan VPN setup script.
#!/bin/bash -ex
# Set some local variables
PRIVATE_IP=`curl -s http://169.254.169.254/latest/meta-data/local-ipv4`
PUBLIC_IP=`curl -s http://169.254.169.254/latest/meta-data/public-ipv4`
VPN_DNSHOST=`grep -o "nameserver.*" /etc/resolv.conf | awk '{print $2}'`
yum install -y libreswan ppp xl2tpd
# Setup IPSEC Tunnel
@rosstimson
rosstimson / java.env
Created July 3, 2014 10:04
Init Script (RHEL, CentOS) for ZooKeeper + optional configs (assumes zookeeper tarball extracted to /opt/zookeeper)
# /opt/zookeeper/conf/java.env
ZOO_LOG4J_PROP="INFO,ROLLINGFILE"
ZOO_LOG_DIR="/var/log/zookeeper/"
@rosstimson
rosstimson / aws-access-key-to-iam-name.sh
Created June 30, 2014 07:41
Pass this script an AWS access key ID and it will show you what IAM user has that key.
#!/bin/bash -e
#
# Pass this script an AWS access key ID and it will show you what IAM user
# has that key.
#
# Usage:
# aws-access-key-to-iam-name some_key_id
#
readonly PROGNAME=$(basename $0)
@rosstimson
rosstimson / backtrace
Last active August 29, 2015 13:57
Nginx / OpenResty segfault - ngx_http_lua_socket_tcp_finalize
[root@my-server ~]# gdb /usr/local/nginx/sbin/nginx /tmp/core_dumps/99_27290_nginx
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
@rosstimson
rosstimson / ID3_genres.txt
Created December 28, 2013 20:47
Standard ID3 genre names/ids.
0: Blues
1: Classic Rock
2: Country
3: Dance
4: Disco
5: Funk
6: Grunge
7: Hip-Hop
8: Jazz
9: Metal
@rosstimson
rosstimson / Makefile-ZFS-madness-1.18
Created October 4, 2013 14:43
Makefile that automates installation of FreeBSD on ZFS root (compatible with BEADM boot environments).
# ---- Makefile for Vermaden's FreeBSD 9.1 root on ZFS manual install
# $Id: Makefile,v 1.18 2013/08/07 13:31:29 root Exp root $
#
# Copyright (c) 2013 Adriaan van Roosmalen <j65nko daemonforums.org>>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
@rosstimson
rosstimson / pkg-rosstimson.pem
Created September 13, 2013 17:41
Public key for verifying FreeBSD packages (pkgng) built by my Poudriere server.
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAz5AyqTgEKtSUwirzwpQV
j1p00tQIa2z6Xge72rx5JFQInuREhP8S7j20DiG+YOO8NSGMbamrWSfZX9QcbebZ
ZtKIfMtI7NP+QoJruknRQi6fGUa2x7kLNEzYvExtBJIqaS7A1kg4HAcvmXznW/ub
JDxXESLL79hs8ZBjMIX0QEkLYtA7V5qLXp6m0i7DSgutHfWeBwdsqQtxv7zLpGBM
GJqTDYVcLnQBiirXnQ99Nko2bA2h1JIukJ0Ws/UtS5YnS70kOFLCTLasMPV0mwMl
+NRya9cx0/9CwlZr96CxiHiHqv6vSSWUw2NjyXBC1onAhi3w9lFRrdvUjTbENdOl
KCs18o4Q3ZlgKRjo4pP52BNV09GjhLroGyTr+4M/FjhwBVI5hleOLc6x7AhpBMHq
lX1F6tdQyLMOVmFnLzWgZen30cTIfOWQJ7zp27Yzr3ruy/U2wyIX800MC8H15lUl
gCO6OFPXEnoaD5qBAe+7bYD+4DHZUMhkHOiWcPJyYJabsucMhCuI1Xt7UzO1D51F
@rosstimson
rosstimson / pf.conf
Last active August 14, 2022 12:31
Basic FreeBSD PF firewall for web server - /etc/pf.conf
# vim: set ft=pf
# /etc/pf.conf
ext_if="vtnet0"
webports = "{http, https}"
int_tcp_services = "{domain, ntp, smtp, www, https, ftp}"
int_udp_services = "{domain, ntp}"
set skip on lo
@rosstimson
rosstimson / poudriere-build-list.txt
Last active December 11, 2015 00:49
List of FreeBSD ports for Poudriere to build into packages.
accessibility/redshift
audio/abcde
audio/mpc
audio/musicpd
audio/ncmpcpp
audio/opus-tools
audio/picard
audio/py-musicbrainz2
databases/couchdb
databases/mariadb55-server