Skip to content

Instantly share code, notes, and snippets.

View foxlet's full-sized avatar

Foxlet foxlet

View GitHub Profile
usrcache = dict()
glob_chan = chan
@hook.irc_raw("352")
def who_summon(chan, conn, irc_raw=None):
irc_parsed = irc_raw.split(" ")
channel = str(irc_parsed[3])
if channel == glob_chan:
user = str(irc_parsed[7])
flags = irc_parsed[8]
@foxlet
foxlet / trace.py
Created December 23, 2014 18:24
I mean, sure, have it.
# RoboCop 2's trace.py - Runs a traceroute on the local system, based upon ping.py
import subprocess
import os
from pastebin_python import PastebinPython
from cloudbot import hook
@hook.command()
def traceroute(text, reply):
import PIL
from PIL import ImageFont, Image, ImageDraw, ImageFilter, ImageChops
from cloudbot import hook
import random
import base64
import requests
import json
import datetime
import imghdr
import urllib
@foxlet
foxlet / gist:177f9e07989e14edddb7
Created January 3, 2015 13:48
modules/commands/cs_entrymsg.cpp
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
if (Anope::ReadOnly && !params[1].equals_ci("LIST"))
from cloudbot import hook
@hook.irc_raw('004')
def autoexec(bot, conn):
conn.cmd("irc_command", "param1", "param2")
from cloudbot import hook
@hook.command
def nprandom(text):
a = list(map(int, text.split(";")))
n = a[0]
o = []
for x in range(0, a[1]):
n = ((2345675*n)+6678909)%976
o.append(str(n))
@foxlet
foxlet / shrt.py
Created January 21, 2015 02:31
Misc RoboCop Modules - Modules that didn't end up in the final repo.
# RoboCop 2's shrt.py - Automatically shorten links that are not already short enough.
import re
from cloudbot import hook
from cloudbot.util import web
linkre = re.compile(r'(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|Ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|
import random
import pprint
import requests
from lxml import html
from cloudbot import hook
from cloudbot.util import formatting, filesize, colors
@foxlet
foxlet / snoovatar.py
Last active July 26, 2022 07:08
Snoovatars
from lxml import html
import requests
from cloudbot import hook
from cloudbot.util import timeformat, formatting
# A nice user agent for use with Reddit
headers = {'User-Agent': 'CloudBot/dev 1.0 - CloudBot Refresh by lukeroge'}
@hook.command
@foxlet
foxlet / README.md
Last active May 13, 2017 01:36
AilurusPKI Public Roots

About AilurusPKI

AilurusPKI is a PKI operated by FurCode for use within internal services. All entries are verified and kept offline. This GIST contains the root CA and many of its intermediates.