Skip to content

Instantly share code, notes, and snippets.

@kylef
kylef / Procfile
Created April 14, 2013 15:58
Static server for Heroku using river
web: gunicorn -w 4 serve:wsgi
@kylef
kylef / inspircd_channels
Created September 24, 2011 12:18
InspIRCd plugins for munin
#!/bin/bash
case $1 in
config)
echo "graph_title Channel count"
echo "graph_vlabel channels"
echo "channels.label channels"
echo "channels.draw AREA"
;;
*)
@kylef
kylef / craftirc.cpp
Created September 19, 2011 15:35
CraftIRC ZNC Module
#include "Modules.h"
#include "Chan.h"
class CCraftIRC : public CModule {
public:
MODCONSTRUCTOR(CCraftIRC) {
AddHelpCommand();
AddCommand("Alias", static_cast<CModCommand::ModCmdFunc>(&CCraftIRC::AliasCommand), "username [nick]");
AddCommand("Nick", static_cast<CModCommand::ModCmdFunc>(&CCraftIRC::NickCommand), "nick", "Set the nickname the CraftIRC bot uses.");
}
@kylef
kylef / yubikey.cpp
Created September 14, 2011 16:54
ZNC module for YubiKey
extern "C" {
#include <ykclient.h>
}
#include <znc/Modules.h>
#include <znc/znc.h>
#include <znc/User.h>
#define CLIENT_ID 1
#define DEFAULT_TOKEN_ID_LEN 12
@kylef
kylef / PKGBUILD
Created July 5, 2011 17:41
lxc package for arch linux
pkgname=lxc
pkgver=0.7.4.2
pkgrel=1
pkgdesc="Linux Containers"
arch=('i686' 'x86_64')
url="http://lxc.sourceforge.net/"
depends=('bash' 'perl')
license=('LGPL')
source=("http://lxc.sourceforge.net/download/lxc/$pkgname-$pkgver.tar.gz" lxc.rcd lxc.confd)
md5sums=('36fcb0f6a39d2f55130421f342f24ef3' '520594461912e084c220ca37eb97afd2' 'efb0c46839136842e9d3617924a9b5b5')
@kylef
kylef / inspircd-stats.sh
Created June 23, 2011 14:10
InspIRCd stats from m_http_stats
#!/bin/sh
address="https://localhost:8081/stats"
count_type=$1
if [[ "$count_type" != "user" && "$count_type" != "channel" ]]; then
echo "Usage: $0 <user|channel>"
exit 1
elif
@kylef
kylef / userserv.cpp
Created May 4, 2011 16:47
ZNC module to auth you with UserServ
/*
* Copyright (C) 2004-2011 See the AUTHORS file for details.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
#include "User.h"
@kylef
kylef / znc-modgen.sh
Created March 30, 2011 19:11
Template generator for a znc module
#!/bin/sh
# Usage: ./modgen.sh CFooMod > foo.cpp
# Usage: ./modgen.sh CFooMod global > foo.cpp
if [ ! "$1" ]; then
echo "No module class name supplied"
exit 1
fi
@kylef
kylef / pyeval.py
Last active September 25, 2015 01:27
Python Evaluate for ZNC modpython
import sys
import re
from code import InteractiveInterpreter
import znc
class pyeval(znc.Module, InteractiveInterpreter):
module_types = [znc.CModInfo.UserModule, znc.CModInfo.NetworkModule]
description = 'Evaluates python code'
@kylef
kylef / preventpart.cpp
Created February 21, 2011 00:59
ZNC Module to prevent a client from parting a IRC channel
/*
ZNC Module to prevent a client from parting a IRC channel
This is useful for use with github's IRC service hook.
*/
#include "Modules.h"
class CPreventPart : public CModule {
public:
MODCONSTRUCTOR(CPreventPart) {}