Skip to content

Instantly share code, notes, and snippets.

View DanielOaks's full-sized avatar

Daniel Oaks DanielOaks

View GitHub Profile
#!/usr/bin/env python3
# Given an ePub file from FicSave, generates LaTeX files
# Written by Daniel Oaks, released under the ISC license
__doc__ = """Make-LaTeX.
Given an ePub file from FicSave, generates LaTeX files.
Usage:
make-latex <name> [options]
make-latex -h | --help
#!/usr/bin/env python3
# ircd git generation from archive files
# like irc2.1.1.tar.Z
# code
import os
import shutil
import gitapi
import tarfile
from version import LooseVersion
@DanielOaks
DanielOaks / tinybot.go
Last active June 18, 2017 14:24
Tiny IRC bot in Go, just to get started with the language
// written by Daniel Oaks <daniel@danieloaks.net>
// released under the CC0 Public Domain license
package main
import (
"fmt"
"os"
"strings"

IRCv3 Security Council Proposal

I propose that a group known as the "IRCv3 Security Council" is created.

This group is a separate part of the IRCv3 effort, will have their own section on the website just as the IRCv3 Working Group page is being split off from the landing page, and for most intents and purposes act independently of the IRCv3 Working Group.

Rationale: The traditional CA model has, widely, not worked with IRC today. Large portions of IRC networks out there today use self-signed certificates, and disabling certificate verification or otherwise working around the certificates not validating using traditional methods is fairly common.

This proposal would allow the creation of certificate bundles and revocation lists controlled by the IRCv3 Security Council, which when used by clients (instead of the traditional CA roots provided by operating systems) should solve the majority of these issues for IRC users and network operators.

@DanielOaks
DanielOaks / irc.regex
Last active June 25, 2022 07:42
IRC Message Splitting Regex
Page explaining this regex: http://danieloaks.net/irc-regex/
Raw regex:
^(?:@([^\r\n ]*) +|())(?::([^\r\n ]+) +|())([^\r\n ]+)(?: +([^:\r\n ]+[^\r\n ]*(?: +[^:\r\n ]+[^\r\n ]*)*)|())?(?: +:([^\r\n]*)| +())?[\r\n]*$
Sample IRC messages:
foo bar baz asdf
@DanielOaks
DanielOaks / readtags.py
Created July 21, 2016 09:08
Example tag thing
import nfc
nfc.ContactlessFrontend('usb')
print 'Reader opened:', clf
def connected(tag):
print 'TAG ID IS:', tag.identifier
var = clf.connect(rdwr={'on-connect': connected})

IRC Roleplay Commands

Daniel Oaks daniel@danieloaks.net


Introduction

People like to use IRC to roleplay. In other words, to act out characters as part of a channel and between clients. Often, this means it's desirable to send messages with names other than the client's nickname, and to send messages not explicitly attached to a name at all.

class DataStore:
def __init__():
self.store = {}
def set(key, value):
self.store[key] = value
def delete(key):
try:
del self.store[key]
@DanielOaks
DanielOaks / rotated-headers.diff
Created November 20, 2016 05:34
rotated headers patch for the IRCv3 site from @dequis, applies onto 6f92921038d7252be204848a8ab938fb866fd83b
diff --git a/_includes/software_list.html b/_includes/software_list.html
index bc5a4c1..add5006 100644
--- a/_includes/software_list.html
+++ b/_includes/software_list.html
@@ -2,6 +2,4 @@
{% if type.note %}{{ type.note | markdownify }}{% endif %}
-{% for support in site.data.irc_versions %}
{% include support_list.html %}

User changes from 127.0.0.1 to a cloaked hostname

User without CHGHOST sees:

:dan!dan@127.0.0.1 QUIT :Changing host
:dan!dan@cloaked.host JOIN #coolchan

User with CHGHOST sees:

:dan!dan@127.0.0.1 CHGHOST dan cloaked.host