Skip to content

Instantly share code, notes, and snippets.

View fuzzy's full-sized avatar

Mike 'Fuzzy' Partin fuzzy

View GitHub Profile
@fuzzy
fuzzy / java-ps.rb
Created May 5, 2015 19:58
java commandline colorizer (ps output)
#!/usr/bin/env ruby
procs = Hash.new
scrpt = `basename #{__FILE__}`.strip
$color = {
:black => 30, :red => 31, :green => 32,
:yellow => 33, :blue => 34, :purple => 35,
:cyan => 36, :white => 37
}
@fuzzy
fuzzy / dd.py
Created May 3, 2015 22:52
dd.py
#!/usr/bin/env python
###########
# Imports #
###########
# Stdlib
import re
import os
import sys
@fuzzy
fuzzy / abused.py
Last active August 29, 2015 14:16
A Basic USe EDitor for gentoo. drop abused.py into your path, and use it in place of emerge when doing installs. It will allow you to edit your use flags on the fly.
#!/usr/bin/env python
import os
import re
import sys
import string
import subprocess
class Abused:
@fuzzy
fuzzy / mpos.py
Created February 13, 2015 08:36
MPOS api in python, no error handling, but full api coverage, it is hereby placed in the public domain
import json
import types
import urllib
import urllib2
class Mpos:
def __init__(self, apiUri=None, apiKey=None, UserId=None):
self.apiUri = apiUri
self.apiKey = apiKey
self.UserId = UserId
{
///////////////////////////
// Global config section //
///////////////////////////
// The command character (ie: first character of the message, eg: !seen)
"cmdchar": "!",
// The directory that our event based, executable commands live in
"command_dir": "",
#!/usr/bin/env python
import sys, json, urllib2, random
if sys.argv[1] == '--usage':
print 'Usage: !search <search terms>'
sys.exit(0)
nick, host, args = sys.argv[1], sys.argv[2], sys.argv[3]
data = json.loads(urllib2.urlopen(
@fuzzy
fuzzy / irc.go
Last active August 29, 2015 14:10
package main
import (
// Stdlib
"log"
// 3rd party
"github.com/husio/go-irc"
)
@fuzzy
fuzzy / gehenbot.go
Created November 23, 2014 09:28
a basic irc bot, that is pretty crappy, but it's the first thing I've done in go, yay
package main
import (
"bufio"
"flag"
"fmt"
"log"
"os"
"strings"
"time"
--- weather.py 2014-11-18 13:29:26.346413808 -0800
+++ weathernew.py 2014-11-18 14:00:28.478386947 -0800
@@ -6,7 +6,7 @@
@hook.api_key('wunderground')
@hook.command(autohelp=False)
def weather(inp, chan='', nick='', reply=None, db=None, api_key=None):
- ".weather <location> [dontsave] | @<nick> -- gets weather data from Wunderground "\
+ ".weather <location> [dontsave] | @<nick> | [forget] -- gets weather data from Wunderground "\
"http://wunderground.com/weather/api"
@fuzzy
fuzzy / oui.py
Created October 17, 2014 03:45
OUI lookup (requires inet access)
#!/usr/bin/env python
import re
import sys
import urllib2
import HTMLParser
uri = 'http://aruljohn.com/mac'
headers = {'User-Agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'}
ouiTag = None