Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/libmowgli/core/mowgli_string.c b/src/libmowgli/core/mowgli_string.c
index 0aa065a..c37a851 100644
--- a/src/libmowgli/core/mowgli_string.c
+++ b/src/libmowgli/core/mowgli_string.c
@@ -24,11 +24,11 @@
#include "mowgli.h"
-mowgli_string_t *mowgli_string_create(void)
+mowgli_string_t *mowgli_string_create_size(size_t n)
@aji
aji / gist:2396321
Created April 16, 2012 04:17
userdel implementation using deluser and chroot
#!/bin/sh
# I haven't tested this.
# I don't even know if it works.
# Also, -f is different.
# In this implementation, -f will automatically confirm -r
if [ "$UID" != "0" ]; then
echo "You are not logged in as root. Cannot continue."
import socket
import select
listener = socket.socket()
listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
listener.bind(('', 9001))
listener.listen(5)
running = True
conns = []
diff --git a/dist/atheme.conf.example b/dist/atheme.conf.example
index 30b7db9..7bcf611 100644
--- a/dist/atheme.conf.example
+++ b/dist/atheme.conf.example
@@ -1508,6 +1508,13 @@ botserv {
* to be assigned to that channel.
*/
min_users = 0;
+
+ /* (*)nicklen
@aji
aji / bot.c
Created April 24, 2012 02:02
libunicorn test bot (no sockets)
#include <stdio.h>
#include <string.h>
#include <mowgli.h>
#include <unicorn.h>
// no sockets are done in this file
// connecting to a server can be done with socat
// $ socat EXEC:bot TCP:general.asu.edu:9965
struct botdata {
#include <stdio.h>
#include <string.h>
#include <mowgli.h>
#include <unicorn.h>
struct botdata {
irc_hook_table_t *commands;
int hugs;
@aji
aji / MLL
Created April 24, 2012 22:07
MLL -- My Little License v1
MY LITTLE LICENSE
Version 1, April 2012
Copyright (C) 2012 Twilight Sparkle <tsparkle@pcsgu.edu>
Everypony is permitted to copy and distribute verbatim or modified copies
of this license agreement, but changing it is not allowed.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
/*
* libmowgli: A collection of useful routines for programming.
* linetest.c: Testing of the linebuffer
*
* Copyright (c) 2011 William Pitcock <nenolod@dereferenced.org>
* Copyright (c) 2012 Elizabeth J. Myers <elizabeth@sporksmoo.net>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
#!/usr/bin/python
import sys
def fmtip(ip):
s = [ (ip & 0xff000000) >> 24, (ip & 0xff0000) >> 16, (ip & 0xff00) >> 8, (ip & 0xff) ]
return '.'.join([str(x) for x in s])
s = [int(x) for x in sys.argv[1].split('.')]
ip = s[3] + (s[2] << 8) + (s[1] << 16) + (s[0] << 24)
@aji
aji / gist:2802605
Created May 27, 2012 07:31
progress...
[50] alex@theta alicorn $ src/alicorn -v
[05/27/12 07:30:35] config.c:22 [a_config_hash] Loading config file etc/alicorn.conf...
[05/27/12 07:30:35] module.c:155 [a_module_conf_start] Marking all loaded modules for deletion
[05/27/12 07:30:35] config.c:39 [a_config_hash] Calling configuration hook conf.item.account
[05/27/12 07:30:35] account.c:61 [a_account_conf_account] Calling configuration hook conf.item.account.password
[05/27/12 07:30:35] account.c:61 [a_account_conf_account] Calling configuration hook conf.item.account.network
[05/27/12 07:30:35] network.c:54 [a_network_conf_network] 'Adding' network default
[05/27/12 07:30:35] account.c:61 [a_account_conf_account] Calling configuration hook conf.item.account.network
[05/27/12 07:30:35] network.c:54 [a_network_conf_network] 'Adding' network ponychat
[05/27/12 07:30:35] module.c:187 [a_module_conf_end] Deleting all marked modules