Skip to content

Instantly share code, notes, and snippets.

View whiskers75's full-sized avatar

whiskers75 whiskers75

View GitHub Profile
var IotaServ = {};
IotaServ.onLoad = function(){};
IotaServ.eob = function() {
IotaServ.o.join('#services');
}
IotaServ.privmsg = function(from, target, message) {
message = message.split(' ');
message[0] = message[0].toLowerCase();
if (message[0] == 'hug') {
if (!message[1] || !message[2]) {
var ts6 = require('./ts6.js');
var fs = require('fs');
var server = new ts6.Server({host: 'whsk.uk', port: 194, sid: '42D', pass: '***', sname: 'serv.js', sdesc: 'whiskers75\'s Node.js services'});
var ServServ = server.mkserv('ServServ', 'ServServ', 'serv.js', 'Service Services');
var services = {};
var servobjs = {};
var eob_done = false;
server.reload = function() {
ServServ.privmsg('#services', 'Loading services...');
delete services;
@whiskers75
whiskers75 / ghash.js
Created June 8, 2014 11:19
Node.js script to get GHash.io hash %
var request = require('request');
var htmlparser = require('htmlparser');
var $ = require('soupselect').select;
request('https://ghash.io/', function(err, res, body) {
if (err || res.statusCode != 200) {
return console.log('Error.');
}
var handler = new htmlparser.DefaultHandler(function(err, dom) {
if (err) {
var SocketClient = require('websocket').client;
var client = new SocketClient();
var satoshi = 100000000;
var piGlow = require('piglow');
var animation = require('piglow-animations').animation;
console.log('whiskers75\'s PiGlow Bitcoin Script');
console.log('http://whiskers75.co.uk');
piGlow(function(e, pie) {
if (e) throw e;
function fade(target, interval) {
@whiskers75
whiskers75 / pcap.js
Created May 25, 2014 10:12
Load averages and PPS with a PiGlow
var pcap = require('pcap');
var piglow = require('piglow');
var eth0 = pcap.createSession('eth0', 'ip proto \\tcp');
var wlan0 = pcap.createSession('wlan0', 'ip proto \\tcp');
var packets_per_sec = {eth0: 0, wlan0: 0};
piglow(function(err, pi) {
if (err) throw err;
setInterval(function() {
pi.startTransaction();
pi.all = 0;
### Keybase proof
I hereby claim:
* I am whiskers75 on github.
* I am whiskers75 (https://keybase.io/whiskers75) on keybase.
* I have a public key whose fingerprint is 4358 6AC4 8CB5 D5FC 4458 8E18 B30F 70AD AF9D 0779
To claim this, I am signing this object:
var later = {};
var Command = require('../command.js');
later.desc = 'Do stuff later'
later.modify = function(g) {
g.later = {};
g.later.pending = false;
g.later.user = ''
g.bot.on('+mode', function(channel, by, mode, argument, raw) {
if (mode == 'b' || mode == 'q') {
global.hasPermission(raw.user + '@' + raw.host, 'op', channel, function (perm) {
@whiskers75
whiskers75 / bf.js
Created February 20, 2014 12:15
Brainf**k plugin for Fluxbot. Dependencies: "brainfuck"
var Command = require('../command.js');
var brainfuck = require('brainfuck');
var rest = require('request');
var validator = require('validator');
var glob = {};
var bf = {};
bf.modify = function (g) {
glob = g;
};
bf.commands = {};
var Command = require('../command.js');
var brainfuck = require('brainfuck');
var rest = require('request');
var validator = require('validator');
var glob = {};
var bf = {};
bf.modify = function (g) {
glob = g;
};
bf.commands = {};
@whiskers75
whiskers75 / protect.coffee
Created February 10, 2014 18:38
protect plugin for fluxbot
coffee = require 'coffee-script/register'
Command = require '../command.coffee'
Protect = {}
Protect.name = 'protect'
Protect.modify = (g) =>
g.bot.on 'part', (chan, nick) =>
bot.join '#botwar'
g.bot.on 'join', (chan, nick, raw) =>
g.db.smembers 'protected', (err, res) =>
if res.indexOf(nick) != -1