Skip to content

Instantly share code, notes, and snippets.

View keymon's full-sized avatar

Hector Rivas Gandara keymon

  • London, UK
  • 00:44 (UTC)
View GitHub Profile
@keymon
keymon / hide-github-merge.user.js
Last active August 12, 2016 09:00
Userscript to disable the Merge button inside pull requests on certain github projects
// ==UserScript==
// @name Hide GitHub Merge Button
// @version 0.4
// @description Removes the merge button on a GitHub project, so you will remember to
// rebase/write a useful merge message.
// @match https://github.com/alphagov/paas-cf/pull/*
// @grant GM_addStyle
// ==/UserScript==
var main = function () {
@keymon
keymon / echo.rb
Last active May 17, 2016 16:28 — forked from kyanny/echo.rb
Ruby socket TCPServer echo server
require 'socket'
gs = TCPServer.open(0)
socks = [gs]
addr = gs.addr
addr.shift
puts "server is on #{addr.join(':')}"
while true
nsock = select(socks)
@keymon
keymon / README.md
Last active June 6, 2020 06:05 — forked from leehambley/README.md
Simple bash script to wire up Grafana 2.x with InfluxDB 0.8

Simple bash script to wire up Grafana 2.x with graphite and add dashboards

This Bash script exposes a few functions to create a Grafana data source, like graphite.

Also allows to upload some dashboards.

Usage

@keymon
keymon / val_from_yaml.rb
Created October 1, 2015 15:50 — forked from saliceti/val_from_yaml.rb
Extract a value from a YAML file
#!/usr/bin/env ruby
require 'yaml'
filename = ARGV[0]
path = ARGV[1]
def get(hash, path_array)
unless path_array.empty?
get(hash[path_array[0]], path_array[1..-1])
#!/usr/bin/env bash
[ $(id -u) = 0 ] || { echo "You must be root (or use 'sudo')" ; exit 1; }
fwrule=`ipfw -a list | grep "deny ip from any to any"`
fwrule_id=`echo $fwrule | awk '{ print $1 }'`
if [ "$fwrule" != "" ]; then
echo "Found blocking firewall rule: $(tput setaf 1)${fwrule}$(tput sgr0)"
printf "Deleting rule ${fwrule_id} ... "
ipfw delete ${fwrule_id}
# using VirtualBox version $VBOX_VERSION
FROM boot2docker/boot2docker
RUN apt-get install p7zip-full
RUN mkdir -p /vboxguest && \
cd /vboxguest && \
curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso && \
7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \
sh VBoxLinuxAdditions.run --noexec --target . && \