Skip to content

Instantly share code, notes, and snippets.

View beezly's full-sized avatar

Andrew Beresford beezly

View GitHub Profile

Keybase proof

I hereby claim:

  • I am beezly on github.
  • I am beezly (https://keybase.io/beezly) on keybase.
  • I have a public key ASBqxtgg-zWLBnFoVdcBozWvYRuZfD40OmACI9-rUvPjZAo

To claim this, I am signing this object:

@beezly
beezly / gist:3137c7db87c08931f04c58543dcca8c7
Last active February 15, 2017 15:19
Make jenkins use White on Black text in the console. Use with the Chrome Stylish extension to apply to your instance of Jenkins. -- https://chrome.google.com/webstore/detail/stylish-custom-themes-for/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en
pre.console-output {
font: "Lucida Console", Monaco, monospace;
font-size: 11pt;
color: white;
background-color: black;
padding: 0.5em;
}
span.timestamp {
color: #888;
@beezly
beezly / screenaver.pp
Created January 13, 2016 14:18
Puppet augeas to disable screensaver by default in RH6
$enabled = false
augeas{'disable_default_screensaver_lock':
lens => 'Xml.lns',
incl => '/etc/gconf/gconf.xml.defaults/%gconf-tree.xml',
context => '/files/etc/gconf/gconf.xml.defaults/%gconf-tree.xml/gconf/dir[#attribute[name="schemas"]]/dir[#attribute[name="apps"]]/dir[#attribute[name="gnome-screensaver"]]/dir[#attribute[name="lock_enabled"]]/local_schema/default',
changes => "set #attribute/value ${enabled}",
}
@beezly
beezly / gist:84c6300982d9ec0cf53d
Last active August 29, 2015 14:15
Create Calendar Events when I get parking receipt messages. Depends on receiving an email in the right format from the parking payment provider.
function processParkingMessages() {
// get all unread messages labelled as Parking
var parkingThreads = GmailApp.getUserLabelByName('Parking').getThreads();
var parkingThreadMessages = parkingThreads.map(function(thread) { return thread.getMessages(); });
var parkingMessages = [];
var parkingMessages = parkingMessages.concat.apply(parkingMessages, parkingThreadMessages);
var unreadParkingMessages = parkingMessages.filter(function(message) { return message.isUnread(); });
// Map through all the unread parking messages and search for a date/time in the appropriate format.
@beezly
beezly / gist:9b2de3749d687fdbff3f
Last active April 19, 2023 13:14
Log Nest temperatures into a Google Spreadsheet. Update the username and password values and create a resource trigger to call "getData" at regular intervals.
function performLogin(email, password) {
var payload = {
"username" : email,
"password" : password
};
var options = {
"method" : "post",
"payload" : payload
};
@beezly
beezly / gist:267b80557900b865bc92
Last active February 17, 2021 10:37
Find the SSL/TLS version clients are negotiate with your SSL server. Adapt the "src port 443" part as per your requirements. Uses tshark from https://www.wireshark.org
tshark -f 'src port 443 and ether[0x42]=0x16 and ether[0x47]=0x02' -T fields -e ip.dst_host -e ssl.handshake.version
@beezly
beezly / gist:5c61d0968cdd3234395f
Last active October 18, 2015 15:52
Synchronise SONOS alarms to a LIFX bulb
require 'rubygems'
require 'logger'
require 'sonos'
require 'lifx'
require 'matrix'
SPEAKER = "Master Bedroom"
LIFX_TAG = "Master Bedroom"
LIFX_RETRIES = 3
@beezly
beezly / gist:10022653
Last active August 29, 2015 13:58
Submit jobs via a web interface to a DRMAA compatible scheduler
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'sinatra'
require 'drmaa'
require 'cod'
require 'logger'
require 'rpam'
require 'json'
require 'pp'
@beezly
beezly / zxtm-perf-graphite.rb
Created April 2, 2014 22:55
Collecting ZXTM performance data and passing it to graphite
#!/usr/bin/env ruby
require "rubygems"
require "active_support/inflector"
require "snmp"
require 'graphite-api'
require 'graphite-api/core_ext/numeric'
require 'logger'
require "pp"
NODE_STATE = [ :undefined, :alive, :dead, :unknown, :draining ]
@beezly
beezly / ping-email.rb
Created March 20, 2014 15:25
Send me an email when a machine becomes pingable
#!/usr/bin/env ruby
require 'rubygems'
require 'net/ping'
require 'net/smtp'
server=ARGV.first
smtp_server='mailhost.shef.ac.uk'
from_name="Pingy Test Thingy"
from_address="pingy@yourdomain.com"