Skip to content

Instantly share code, notes, and snippets.

View halkeye's full-sized avatar

Gavin Mogan halkeye

View GitHub Profile
@halkeye
halkeye / perl.groovy
Created September 28, 2011 23:13
Perl backend grabber for jenkins
#!/usr/bin/env groovy
// Generates server-side metadata for Perl auto-installation
@GrabResolver(name="m.g.o-public",root='http://maven.glassfish.org/content/group/public/')
@Grab(group='net.sourceforge.htmlunit', module='htmlunit', version='[2.4,)')
import com.gargoylesoftware.htmlunit.html.*;
@Grab(group="org.kohsuke.stapler",module="json-lib",version="2.1",classifier="jdk15")
import net.sf.json.*
import com.gargoylesoftware.htmlunit.WebClient
@halkeye
halkeye / gist:1396870
Created November 27, 2011 03:02
Script to generate project.list per user
#!/bin/sh
# https://gist.github.com/1396870
for i in $( grep gl-auth-command ~/.ssh/authorized_keys | awk '{print $2}' | awk -F'"' '{print $1}' | sort | uniq); do
/home/git/bin/gl-auth-command $i get-perms | sed 's/\r//' | awk '{if ($1 ~ /R/) { print $3 ".git"; }}' > /home/git/projects.list.$i;
done
@halkeye
halkeye / sorted_json.rb
Created April 2, 2012 23:13
Puppet module for outputting json in a sorted consistent way
#
# sorted_json.rb
# Puppet module for outputting json in a sorted consistent way. I use it for creating config files with puppet
require 'json'
def sorted_json(json)
if (json.kind_of? String)
return json.to_json
elsif (json.kind_of? Array)
@halkeye
halkeye / xbmcStats.rb
Created November 29, 2012 03:33 — forked from anonymous/file1.txt
XBMC collectd stats collection
#!/usr/bin/env ruby
#
# Written by Gavin Mogan (gavin@kodekoan.com)
require 'rubygems'
require 'mysql2'
# Enable auto flush
STDOUT.sync = true
@halkeye
halkeye / transmissionStats.rb
Created November 29, 2012 05:10
transmission stats collectd
#!/usr/bin/env ruby
#
# Written by Gavin Mogan (gavin@kodekoan.com)
require 'rubygems'
require 'transmission-rpc'
# Enable auto flush
STDOUT.sync = true
<?php
require 'facebook-php-sdk/src/facebook.php';
ini_set('display_errors', true);
require '/home/halkeye/git/rob_facebook_poster/config.php';
/* FIXME - put your stuff here */
$facebook = new Facebook(array(
'appId' => $config['FACEBOOK_APP_ID'],
'secret' => $config['FACEBOOK_APP_SECRET'],
));
#!/bin/bash
DRY_RUN=
DATABASE=
cd /tmp/
mysqldump --skip-dump-date --opt --flush-logs --single-transaction ${DATABASE} bzcat -zc > ${DATABASE}.sql.bz2
for i in `seq 5 -1 2`; do
PREV_I=$(expr $i - 1)
#!/bin/sh
rm /etc/udev/rules.d/70-persistent-net.rules
cd /etc/sysconfig/network-scripts/
TMP=`mktemp`
TEST=`ifconfig | grep eth | awk '{ print $5}'`; sed "s/HWADDR.*/HWADDR\=$TEST/g" ifcfg-eth0 > $TMP; mv $TMP ifcfg-eth0
@halkeye
halkeye / updateWPPlugin.py
Last active December 21, 2015 09:49
Simple little script I use to update wordpress plugins
#!/usr/bin/env python
# Simple little script I use to update wordpress plugins
# Author: Gavin Mogan <gavin@kodekoan.com>
#
# Usage:
# for i in ~/wp-plugins/*; do svn sw $(updateWPPlugin $i) $i; done
# Changelog:
# Ignore any tag that has characters other than 0-9 and .
# This usually means that its a beta tag
@halkeye
halkeye / beep.sh
Created October 2, 2013 19:08
Very simple little script I use inside of screen/tmux window to notify me of output
#!/usr/bin/env perl
print "$_\007" while (<>);