Skip to content

Instantly share code, notes, and snippets.

@sot001
sot001 / bumpme
Last active September 8, 2020 13:55
Tue Sep 8 13:55:37 UTC 2020
@sot001
sot001 / config
Created February 7, 2017 09:49
terminator config
[global_config]
enabled_plugins = LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
window_state = maximise
borderless = True
[keybindings]
[profiles]
[[default]]
use_system_font = False
background_darkness = 0.37
background_image = /usr/share/backgrounds/default_1920x1200.png
@sot001
sot001 / highload_bounce.sh
Created December 21, 2016 14:37
shell script to monitor load and bounce service if it exceeds a set limit
#!/bin/bash
# highload_bounce.sh
#
# When you have a MySQL service that can't take the load any more,
# and have wonky code that is stuck in a loop, sometimes you just
# have to bounce the service. Nasty, but effective if you can't access
# the code
@sot001
sot001 / make-bundle
Created October 19, 2016 08:16 — forked from starkers/make-bundle
Generate a new client for OpenVPN, create a .ovpn file and bundle it into a zip
#!/usr/bin/env bash
# NB: I use this on centos 6 but should work on other stuff
#
# Ensure that reverse DNS works so it can lookup its IP/hostname
# Also relies on "zip" and dig
#
# ....I should probably do some more checks on:
# Destination folders existence
# client cert is correctly inserted into the index
# host lookup worked
@sot001
sot001 / dumpmysql.sh
Last active February 29, 2016 10:24
MySQL backup and archive script
#!/bin/bash
# mysql user needs certain privileges to run this file;
#
# grant SELECT, LOCK TABLES, reload ON *.* TO 'mysql'@'localhost' IDENTIFIED BY 'dump';
#
TODAY=`date '+%Y%m%d%H%M'`
DUMPDIR=/mysql_backups
ARCH_DUMPDIR=/nfs_dumps/`hostname`
LOGFILE=$DUMPDIR/dump.$TODAY.log
@sot001
sot001 / gitprompt.sh
Last active September 3, 2018 21:38
Git prompt (add to /etc/profile.d/gitprompt.sh)
# I wanted a dead simple reminder if I'm in a git managed directory
# This takes the standard ubuntu $PS1 and adds (branch-name) in "default" terminal colour just before your $ / #
#
# the correct way on centos is to add it to something like /etc/sysconfig/bash-prompt-{xterm,default,screen}
# I can't be arsenaled... -davidATstarkers.org
#
# centos6: add to /etc/bashrc
# ubuntu14/mint: add to /etc/bash.bashrc
# vim:ts=2:sw=2
#!/bin/bash
#
# wrapper script for use as a all in one stream recorder and tagger
# letting me get some morning triplej on my squeezebox
# Usage: /home/triplej/record_triplej.sh -u stream -t duration -d location
# eg: ./record_triplej.sh -u http://shoutmedia.abc.net.au:10426/ -t 180 -d /tmp/
#
# sot001 Sep 2015
set -x
### Keybase proof
I hereby claim:
* I am sot001 on github.
* I am spanky (https://keybase.io/spanky) on keybase.
* I have a public key whose fingerprint is CB5C 7F35 3C8A 8144 C4A6 799B 387F ABDF 0FAB 1001
To claim this, I am signing this object: