This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
readonly VBETOOL=/usr/sbin/vbetool | |
turn_off_screen() { | |
if [[ -x "$VBETOOL" ]]; then | |
"$VBETOOL" dpms off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def to_csv(file) | |
lines = [] | |
file_content = File.open(file, 'r', :encoding => 'iso-8859-1') {|f| f.read}.gsub(/\n/, '') | |
file_content.scan(/<tr.*?>(.+?)<\/tr>/) do |match| | |
next unless match[0][/\d{2}\/\d{2}\/\d{4}/] and not match[0][/XXXX/] | |
fields = [] | |
match[0].scan(/>([^<>]+?)</) do |field| | |
fields.push(field[0].strip.encode('utf-8').gsub(/[£, ]/, '')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rexml/document' | |
require 'rexml/element' | |
doc = REXML::Document.new(File.open('London_Classic_2015.gpx', 'r')) | |
second = 0 | |
min = 0 | |
hour = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These are very quick & dirty notes on getting Icinga installed on Centos 6.5 via RPMs, | |
# as most documentation seems to be based around source installation. It's mostly recovered from | |
# my history as I worked it out, so no guarantees are offered. | |
# Make EPEL available | |
sudo rpm -Uvh http://mirror.bytemark.co.uk/fedora/epel/6/i386/epel-release-6-8.noarch.rpm | |
# Install HTTPd | |
sudo yum install httpd | |
sudo service https start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 54ce482842cf src/rabbit_ws_sockjs.erl | |
--- a/src/rabbit_ws_sockjs.erl Tue Nov 20 13:40:31 2012 +0000 | |
+++ b/src/rabbit_ws_sockjs.erl Thu Jan 17 12:48:54 2013 +0000 | |
@@ -26,7 +26,13 @@ | |
-spec init() -> ok. | |
init() -> | |
Port = get_env(port, 55674), | |
+ HttpsPort = get_env(http_port, 55675), | |
SockjsOpts = get_env(sockjs_opts, []) ++ [{logger, fun logger/3}], | |
+ HttpsEnabled = get_env(ssl_enabled, false), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.rabbitmq.client.Channel; | |
import com.rabbitmq.client.Connection; | |
import com.rabbitmq.client.ConnectionFactory; | |
import java.io.IOException; | |
public class Unbinder { | |
public static void main(final String[] args) { | |
final ConnectionFactory factory = new ConnectionFactory(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean equals(final Object obj) { | |
if (obj == null) { | |
return false; | |
} | |
if (obj == this) { | |
return true; | |
} | |
if (obj.getClass() != getClass()) { | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
def get_nagios_status(server_host, username = 'monitor', password = 'monitor') | |
doc = Nokogiri::HTML(open("http://#{server_host}/nagios/cgi-bin/status.cgi?servicestatustypes=28&hoststatustypes=15", :http_basic_authentication => [username, password])) | |
hosts = [] | |
last_title = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
def get_teamcity_status(server_host) | |
doc = Nokogiri::HTML(open("http://#{server_host}/externalStatus.html")) | |
build_count = doc.css('table.tcTable').size | |
failure_count = 0 | |
fatal_count = doc.css('span.teamCityErrorMessage').size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
if ARGV.length == 0 | |
puts "Usage: #{__FILE__} <name of FXG to de-fubar>" | |
exit 1 | |
end | |
filename = ARGV[0] | |
out = File.open("#{filename}.fixed", 'w') |