Skip to content

Instantly share code, notes, and snippets.

View craigw's full-sized avatar
🦄

Craig R Webster craigw

🦄
View GitHub Profile
#! /usr/bin/env ruby
STDOUT.sync = true
require 'rubygems'
require 'smqueue'
require 'yaml'
require 'socket'
puts "Starting..."
#! /usr/bin/env ruby
require 'socket'
socket = TCPSocket.open('localhost', '11211')
socket.send("stats\r\n", 0)
statistics = []
loop do
data = socket.recv(4096)
CraigW: ?snmp xeriom-vm-host-06 .1.3.6.1.2.1.1.1
bot: SNMPv2-MIB::sysDescr.0 = STRING: Linux xeriom-vm-host-06.core.xeriom.net 2.6.24-17-xen #1 SMP Thu May 1 15:55:31 UTC 2008 x86_64
class Command
class << self
def execute(name, channel, username, arguments)
hostname, oid, remainder = arguments.split(/ /, 3)
`snmpwalk -c public -v 1 #{hostname}.core.xeriom.net #{oid}`
end
end
end
#! /usr/bin/env ruby
COMMANDS = File.expand_path(File.dirname(__FILE__))
name, channel, username, command, arguments = *ARGV[0].split(/ /, 5)
command_script = File.join(COMMANDS, File.basename(command))
if File.exists?(command_script) && !%W(run router).include?(command)
load command_script
puts Command.execute(name, channel, username, arguments).strip
#!/bin/bash
# This script handles ?commands to irccat
exec ruby ./scripts/router "$@" 2>&1
CraigW: !channels
bot: I am in 2 channels: #foo #bar
ant -Dconfgfile=./config/irccat.xml
git clone git://github.com/RJ/irccat.git
#!/bin/sh
exec 2>&1
echo "Starting..."
ENVIRONMENT=production
PORT=8000
IP=0.0.0.0
CHDIR=/var/www/www.application.com