Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (c) 2014, Iain R. Learmonth.
* All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
config defaults
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option drop_invalid '1'
option synflood_protect '1'
option synflood_rate '200/s'
option synflood_burst '500'
option tcp_ecn '1'
@irl
irl / helper.py
Created January 16, 2015 23:46
BeamerBot
# Import some necessary libraries.
import socket, collections
lines = collections.deque(maxlen=10)
for x in range(0, 10):
lines.append("")
# Some basic variables used to configure the bot
server = "irc.freenode.net" # Server
@irl
irl / sdf-bind9.md
Created August 16, 2012 21:31
irl's writing in progress

Running a chrooted BIND9 server on a NetBSD VPS [SDF]

Note: This tutorial assumes you've already followed the NetBSD on SDF VPS tutorial to set up networking, the time zone and pkgsrc using the SDF VPS pkgsrc. It also assumes that you have followed the OpenLDAP on NetBSD tutorial and have a working OpenLDAP server. It also assumes that you have a domain name and have set your VPS as your nameserver. If you do not have a domain name, you should register one. AFAIK, you can register a domain for free from dot.tk which will allow you to configure your own nameserver.

A DNS server can, like LDAP, be used for an almost endless number of things. It is also a hierachical database. Primarily though, it is for storing information about hosts such as their addresses, where the mail should be sent and who is responsible for them. A common analogy for DNS is

@irl
irl / gif.php
Created August 20, 2012 18:05
Fetching a TCP stream for output over Gopher and HTTP
<?php
header('Content-Type: image/gif');
$fp = fsockopen("marang.room205.org", 8091, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
while (!feof($fp)) {
@irl
irl / README.md
Created August 26, 2012 05:08
La Cucina For JS/Linux

This is a base64 encoded archive containing a pre-compiled binary and supporting files; everything you need to run my game under JS/Linux.

Quick Start

@irl
irl / PlayWindows.bat
Created August 28, 2012 08:17
Startfile for @adventureloop's LD24 entry
@ECHO OFF
echo Starting game
java -Djava.library.path=lib/windows -jar LD24Game.jar
==12653== Memcheck, a memory error detector
==12653== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==12653== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==12653== Command: ../tasknc
==12653== Parent PID: 12652
==12653==
--12653--
--12653-- Valgrind options:
--12653-- --tool=memcheck
--12653-- --leak-check=full
[2012-11-09 14:20:21] DEBUG: running gui
[2012-11-09 14:20:21] DEBUG: assigned color pair 1 to (4, 0)
[2012-11-09 14:20:21] DEBUG: assigned color pair 2 to (-1, -1)
[2012-11-09 14:20:21] DEBUG: assigned color pair 3 to (6, 0)
[2012-11-09 14:20:21] DEBUG: assigned color pair 4 to (1, -1)
[2012-11-09 14:20:21] DEBUG: configuring...
[2012-11-09 14:20:21] DEBUG: task version: 2.1.2
[2012-11-09 14:20:21] DEBUG: bind #0: key <ERR> (-1) bound to @(nil) tasklist - (null)(args: 0/(null))
[2012-11-09 14:20:21] DEBUG: bind #1: key <ERR> (-1) bound to @(nil) pager - (null)(args: 0/(null))
[2012-11-09 14:20:21] DEBUG: bind #2: key <resize> (410) bound to @0x407e50 (null)(args: 0/(null))
@irl
irl / gist:4186207
Created December 2, 2012 00:52
SpaceBarOS/DCPU
;
; SpaceBarOS/DCPU
; (C) Iain R. Learmonth 2012. All rights reserved.
;
; Requires:
; DCPU-16
; LEM1802
;
; Tasks:
; Memory management