Skip to content

Instantly share code, notes, and snippets.

@theothertom
theothertom / nginx.conf
Created October 17, 2017 14:26
Nginx Lua generic redirect caching
#user nobody;
worker_processes auto;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@theothertom
theothertom / keybase.md
Created April 15, 2015 10:21
keybase.md

Keybase proof

I hereby claim:

  • I am theothertom on github.
  • I am theothertom (https://keybase.io/theothertom) on keybase.
  • I have a public key whose fingerprint is 806C BB78 2C52 0D4B A160 DF75 9725 F1EC 45A9 51EA

To claim this, I am signing this object:

@theothertom
theothertom / main.cf
Created January 22, 2015 13:54
Postfix - limiting destination domains by sending user
The various runes for limiting senders to specific domains in Postfix. This was done to prevent accidental information disclosure from an MTA shared between monitoring (send to Internet) and application (send to internal addresses only).
The result of the config is that users in the pingu_domains class can only send mail to penguinanddaemon.com, and users in the internet class can send mail everywhere apart from penguinanddaemon.com. Don't forget about running postmap on the mapping files
15:35 < goodwill> ok, this is a stupid question. but what is the prescribed way to handle development/production configuration in Java? Maven
profiles?
15:35 < justintime> IE, they don't call a trunk a trunk, they call it an etherchannel or something.
15:35 < tomonocle> Those are two different things though
15:35 -!- vvuksan [~vuksan@c-98-217-253-0.hsd1.ma.comcast.net] has quit [Ping timeout: 240 seconds]
15:36 < jtopper> ISTR other vendors' idea of a trunk being what Cisco call an etherchannel
15:36 < jtopper> but the other vendor I'm thinking about might have been Netgear so basically fuck them
15:37 < tomonocle> 802.1q claimed the term 'trunk'
15:37 < tomonocle> So it's a little silly to conflate the two
15:37 * surfichris explores LAX wifi
@theothertom
theothertom / ssl_time_left.sh
Created January 28, 2013 12:08
Time in days remaining for SSL certs, for use by monitoring systems.
#!/bin/bash
host=$1
port=$2
#This is a little bit nasty with all the piping and all
cert_expire=`echo | openssl s_client -showcerts -connect $host:$port 2>/dev/null |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -noout -subject -dates | grep notAfter | awk -F= '{print $2}'`
cert_expire_unix=`date --date="$cert_expire" +%s`
current_time_unix=`date +%s`
timediff_days=$((($cert_expire_unix - $current_time_unix) / 86400))
@theothertom
theothertom / gist:3918371
Created October 19, 2012 14:00
Night Time Watcher Required, $30 p/h neg.
Hello,
I would like to preface this by saying that this is not a joke and all joke replies will be deleted. If however, you want to make some extra cash and perhaps have a background in theatre then this is for you.
What is required?
I'm looking for somebody to sit in my room at night and watch over me as I sleep. Recently I have had a lot of trouble sleeping and I think it would be comforting if I knew somebody was there.
I'd also like it if you were to wear a small owl costume as you do so. I have always found great comfort in the idea that owls are the natural lookouts of our world and so it would really help. I'd be prepared to pay you up to $40 if you were to wear the costume and maybe $35 if you don't want the costume but will stick a feather or two to your forehead.
@theothertom
theothertom / Template_MySQL_Server.xml
Created December 6, 2011 16:04
Template_MySQL_Server.xml
<?xml version="1.0"?>
<zabbix_export version="1.0" date="06.09.08" time="04.11">
<hosts>
<host name="Template_MySQL_Server">
<useip>0</useip>
<dns></dns>
<ip></ip>
<port>10050</port>
<status>3</status>
<groups>