Skip to content

Instantly share code, notes, and snippets.

View bretth's full-sized avatar

Brett Haydon bretth

  • Sydney, Australia
View GitHub Profile
description "Gunicorn"
#basic gunicorn config
start on runlevel [2345]
stop on runlevel [!2345]
#Send KILL after 5 seconds
kill timeout 5
respawn
env VENV="/home/some_user/env/"
@bretth
bretth / Library~Preferences~VMWare Fusion~vmnet8~dhcpd.conf
Last active December 7, 2015 05:22
Adding a vmware machine with static IP address
####### VMNET DHCP Configuration. End of "DO NOT MODIFY SECTION" #######
# Add machine with fixed ip address
host guestos {
hardware ethernet 00:0C:29:7F:86:09;
fixed-address 172.16.149.10;
}
# To make effective restart the network services on the host
# Usage: sudo /Applications/VMware Fusion.app/Contents/Library/services/services.sh {--start|--stop}
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org
mQINBFZvpT0BEADUuBaT8RHCYIcek7Qg7MzCP8QUEpA8e1H0yfRxqTW/REGlEWMY
WRii5k6XWWeEW62P+sc/Z8qllCAT6qudWWWDpvmRQ5ymzBO8zI8rqSVRR2KvM4dF
JBTGOVml0EGATBYecCvF0WThJI8I7h4ZYXcCisqa3rV3rbDOCzaq64clBZrb4JTu
uGEXV20lT4eeoBzA5BggPDrLyD3ufKYwaHCoYDSHIWX3gG8KYSPk7EaRT/MWxHbe
kbjuuu+bYN0vRhSu7KkWU0yZDr1Kd6oCZ+l0uAdeugTer9FwoCmKqL8GsevmNzyE
MBA2XkVV80ejS9heFrNEzDsNjNXDYoGGB+kzcGMyshQuoI1PghNsCB71e/jkcAE4
0NQcqZUtOxVDsZCzEHQaK61QBarmsAH4pi4mB6oBx21Fw3cynmCGPpEeGYDEHNVC
@bretth
bretth / gist:133051beca6cf7b49d2c56bfbbb9e0bb
Created April 6, 2016 06:04
Python parameterized tests
import unittest
class TestsContainer(unittest.TestCase):
longMessage = True
def make_test_function(description, a, b):
def test(self):
self.assertEqual(a, b, description)
return test
@bretth
bretth / sshd_config
Created June 26, 2016 09:05
Ubuntu 16.04 server sshd_config with root passwordless login
# Default Ubuntu 16.04 sshd_config 26/6/16
# with all commented out keywords removed
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key

Keybase proof

I hereby claim:

  • I am bretth on github.
  • I am bretth (https://keybase.io/bretth) on keybase.
  • I have a public key ASBbqd5sGb2oRQQanD4vA2A1DuCbn_VVdtOaS_3aD1tkcAo

To claim this, I am signing this object:

@bretth
bretth / bootstrap-utils.sh
Last active December 9, 2016 05:18
Bootstrap host bash script functions
#!/bin/bash
# to get alerts via papertrail app setup an alert
# severity:(error, warning) "@admin"
when_ready ()
{
tag=${WHEN_READY_TAG:-"bootstrap"}
max_tries=${WHEN_READY_TRIES:-"10"}
@bretth
bretth / barcode-preflight.jsx
Last active March 31, 2020 05:21
Barcode creation script
/* InDesign 6 script for converting text frames to Teacup Barcodes. */
/* v1.1
* Changelog
* v1 Initial version
* v1.1 Fix alt text to space correctly around barcode
* v1.2 Accept ISBN numbers 12 > characters long
* v1.3 Fit to frame not content
* v1.4 Remove suffix
*/
@bretth
bretth / gist:16178c469eb47f5370647bc3a2eb5a32
Last active June 25, 2019 08:17
SQL update with a left outer join
update books_product
set modified = current_timestamp
from books_product pr left outer join vista_isbns vi on
pr.sku = vi.sku
where
books_product.id = pr.id
and vi.sku IS NULL
and books_product.is_digital = false