Skip to content
IRC Bot / Cinch Plugin for managing shared machines through a team http://caioromao.com/blog/an-irc-bot-for-managing-shared-machines/
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
LICENSE
README.md
machines.rb
mm.rb

README.md

MachineBot

The name sucks, I know.

This is a simple IRC Bot to manage shared machines through a team. It's built using the Cinch IRC Bot Building Framework and hadn't had a chace to be activelly used yet.

Why?

Saturday afternoon, nothing better to do, I was bored and had to study. Great excuse to check how rusted I was with ruby. Plus, we lost the source code for our previous bot (R.I.P.) at work.

Usage

Currently you can only do basic stuff with it: add, remove, list, reserve, edit and free a machine. This might evolve to something more robust. Or not. This set of operations suffices, but who knows.

Adding a machine

machine add <name> [<ip> <owner>]

Example:

machine add rubedo 192.168.1.123 "Yen Sid"

Listing

machine list [all|reserved|free]

Note: machine list is aliased to list

Reserving

machine reserve <name> [<name>, ...]

Note: machine reserve is aliased to malloc :)

Un-Reserving

machine free <name> [<name>, ...]

Note: machine free is aliased to free

Editting

machine set <name> ip|owner <value>
machine set <name> meta <key> <value>

Example:

machine set albedo meta index 0.04

Getting Detailed Information

machine info <name>

Storage and Data Persistence

Yeah, through stdlib's pstore. It's really ultra slow as it loads the whole database in memory prior to any transaction - A better bet would've been gdbm, but I prefer pstore's API. It should be fairly easy to change backends.

Requirements

  • Ruby 1.9.2 (Only because of require_relative, so backporting is just a matter or replacing it with require. Maybe)
  • cinch

That's it. Nothing more.

Something went wrong with that request. Please try again.