Skip to content

Instantly share code, notes, and snippets.

Running migrations for account:
- Migrating forwards to 0018_add_hast_user_and_group.
> account:0001_initial
> account:0002_auto__add_bsdusers__add_bsdgroups
> account:0003_auto__add_bsdgroupmembership__del_field_bsdusers_bsdusr_password__add_
> account:0004_builtin_user_and_groups
- Migration 'account:0004_builtin_user_and_groups' is marked for no-dry-run.
Installed 29 object(s) from 1 fixture(s)
> account:0005_auto__add_unique_bsdgroups_bsdgrp_group
> account:0006_add_dbus_users
@splbio
splbio / gist:5095049
Created March 5, 2013 22:45
lame arena allocator for libz during kernel crashes. allows memory allocation from a hunk of DATA and does minimal "best fit" management of a freelist. This is quick and dirty because the system is about to go down anyhow so any complexity is likely to be wasted time here.
#include <stdio.h>
#include <stddef.h>
#include <sys/types.h>
#include <sys/queue.h>
#ifndef roundup
#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)
#endif
/*
@splbio
splbio / gist:4759234
Created February 12, 2013 01:19
watchdog patch
Index: dev/watchdog/watchdog.c
===================================================================
--- dev/watchdog/watchdog.c (revision 246559)
+++ dev/watchdog/watchdog.c (working copy)
@@ -1,5 +1,8 @@
/*-
* Copyright (c) 2004 Poul-Henning Kamp
+ * Copyright (c) 2013 iXsystems.com,
+ * author: Alfred Perlstein <[email protected]>
+ *
@splbio
splbio / svn-keywords.diff
Created February 1, 2013 16:13
Patch for keyword expansion against subversion pre-1.8
Index: subversion/include/private/svn_subst_private.h
===================================================================
--- subversion/include/private/svn_subst_private.h (revision 0)
+++ subversion/include/private/svn_subst_private.h (working copy)
@@ -0,0 +1,68 @@
+/**
+ * @copyright
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
@splbio
splbio / gist:4570063
Last active December 11, 2015 07:58
Add code to watchdog to time the watchdog command program, carp when the program takes too long.
The purpose of this is to allow system integrators to tune their watchdogs and
get advanced notice if they are behaving poorly.
The following facilities are added:
- Warn if the watchdog program takes too long.
- Disable activation of the system watchdog so that one can test the watchdogd script
without potentially rebooting the system.
Example:
/*-
* Copyright (c) 2012 Alfred Perlstein <[email protected]>
* 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