Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block o11c

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dice-approx10.txt
0.0000000000% chance of: 104
0.0000000000% chance of: 105
0.0000000000% chance of: 106
0.0000000000% chance of: 107
0.0000000000% chance of: 108
0.0000000000% chance of: 109
0.0000000000% chance of: 110
0.0000000000% chance of: 111
0.0000000000% chance of: 112
# Significant care is taken to be sh-compatible; if bash or zsh could be
# required, it could be made simpler or more generic.
# Known source'rs:
# ~/.profile
# ~/.zshrc
# ~/.xprofile
# ~/.xsessionrc
# ~/.bashrc
# ~/.config/plasma-workspace/env/*.sh

List of intended memory-management policies:


  • nomove
  • singlethread (avoid atomic operations - is this actually ever worth it?)
  • unless_singleton - allow dereferencing the special object at the head of a linked list
  • mostlyonethread (has an owner, others have to pay a toll to access)
  • variant<policy1, policy2> e.g. "maybe shared, maybe borrowed"
View NS-HOWTO.txt
How to create privilegeless (only util-linux and shadow-utils) chroots.
On some machine with real root (or in a VM):
1. preferably, install an apt proxy, such as apt-cacher-ng
2. run debootstrap (or equivalent) as real root (or see if fakeroot works?)
3. delete the device files under /dev
4. create a tarball using --numeric-owner (VERY IMPORTANT)
View dispatch.c
#define REALLY_JOIN(a, b) a##b
#define JOIN(a, b) REALLY_JOIN(a, b)
#define ARG_16(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, ...) a15
#define COUNT(...) ARG_16(__VA_ARGS__, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
#define FOO(...) JOIN(FOO_, COUNT(__VA_ARGS__))(__VA_ARGS__)
#include <stdio.h>
View opts.cpp
struct Options
bool debug_events;
bool dump;
bool hello;
bool info;
const char *output;
# Copyright © 2017 Ben Longbons
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
View gist:4816f4942a0f382d965960aafc6b010b
o11c / gdb-init-order.diff
Created May 15, 2017
Draft at fixing the `tty` bug
View gdb-init-order.diff
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 2a5b128d56..618640cffe 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1710,6 +1710,11 @@ void
_initialize_cli_cmds (void)
struct cmd_list_element *c;
+ /* Called more than once due to ordering dependencies. */
+ static bool initialized = false;
o11c / .gitignore
Last active May 10, 2017
Portable C89 implementation of signed/unsigned integer dispatch.
You can’t perform that action at this time.