Skip to content

Instantly share code, notes, and snippets.

@alyx
alyx / balefire.py
Created November 8, 2020 22:41
bitbot, now with balefiring
#--depends-on commands
from src import ModuleManager, utils
class Module(ModuleManager.BaseModule):
@utils.hook("received.message.channel")
def channel_message(self, event):
message_lower = event["message"].lower()
if message_lower.startswith('balefires') == False:
return
1. What is your target market?
2. Why choose this market?
3. What products are currently being used?
4. What makes those products popular within your target market?
5. What do those products/platforms do poorly?
6. How will your product resolve these issues / what will your product do better?
7. What is the **end goal** for your product?
@alyx
alyx / atheme-pam.c
Created June 16, 2019 10:24
Atheme/PAM Authentication Module for Linux-based Systems
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <security/pam_appl.h>
#include <security/pam_modules.h>
#include <xmlrpc-c/base.h>
#include <xmlrpc-c/client.h>
#define NAME "Atheme/PAM Identify Validator"
#define VERSION "1.0"
@alyx
alyx / atheme.diff
Created June 15, 2019 09:32
Update dist/ and etc/ to match user expectations.
diff --git a/dist/atheme.conf.example b/dist/atheme.example.conf
similarity index 100%
rename from dist/atheme.conf.example
rename to dist/atheme.example.conf
@alyx
alyx / partyfile.py
Created May 26, 2019 05:57
shitty vcsparty concept ruleset
# Just .py for syntax highlighting tbh
# %p = project
# %r = repo
# %u = url
# %c = commit id
# %a = author
# %b = branch
# %f = files
# %m = commit message
# --
#include "detect.hpp"
#include <gtest/gtest.h>
char useragents[][128] = {
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36", //0 Linux, Chrome, Desktop
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36", //1 OS X, Chrome, Desktop
"Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25", //2 OS X, Safari, Mobile
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A", //3 OS X, Safari, Desktop
"Mozilla/5.0 (X11; Mageia; Linux x86_64; rv:10.0.9) Gecko/20100101 Firefox/10.0.9", //4 Linux, Firefox, Desktop
"Mozilla/5.0 (Android; U; Android; pl; rv:1.9.2.8) Gecko/20100202 Firefox/3.5.8", //5 Linux, Firefox, Mobile
@alyx
alyx / gist:4a73491df0f8a1abffbf
Last active October 22, 2017 16:24
atheme-services account degradation

Account Degradation

  1. Current System

  1. Account reaches an age (e.g. 30d)
  2. Services considers the account expired
  3. Services removes this account. This frees all nicknames associated with the account for re-registration and removes this account, including all metadata, group and channel access from the database.
  4. There is no D. That's all that happens.
/*
* Copyright 2014 Alyx Wolcott
* Rights to this code are as documented in doc/LICENSE.
*
* Gives services the ability to backdate nicknames
*
*/
#include "atheme.h"
@alyx
alyx / ns_backdate.c
Last active October 22, 2017 16:25
Put this in modules/contrib/ns_backdate.c.
/*
* Copyright 2014 Alyx Wolcott
* Rights to this code are as documented in doc/LICENSE.
*
* Gives services the ability to backdate nicknames
*
*/
#include "atheme.h"
#!/usr/bin/python2
import csv, psycopg2, sys
conn = psycopg2.connect(database="pokedex", user="pokedex", password="pokedex17984", host="meth.guru")
def berries():
print(" Importing Berries")
cur = conn.cursor()
cur.execute("CREATE TABLE berries (id int, item_id int, firmness_id int, natural_gift_power int, natural_gift_type_id int, size int, max_harvest int, growth_time int, soil_dryness int, smoothness int, PRIMARY KEY(id));")
f = open("../berries.csv", "rb")
d = csv.DictReader(f)
to_db = [(i["id"], i["item_id"], i["firmness_id"], i["natural_gift_power"], i["natural_gift_type_id"], i["size"], i["max_harvest"], i["growth_time"], i["soil_dryness"], i["smoothness"]) for i in d]