Skip to content

Instantly share code, notes, and snippets.

local function create_env()
return {
s = s,
co = commands,
_VERSION = _VERSION,
assert = assert,
collectgarbage = collectgarbage,
error = error,
getfenv = getfenv,
getmetatable = getmetatable,
static void luafmt(void *data, const char *fmt, ...) {
char *buf;
lua_State *L = (lua_State *) data;
va_list vl;
va_start(vl,fmt);
int size = vsprintf(NULL, fmt, vl);
buf = malloc(size * sizeof(char));
Breakpoint 3, lmm_alloc (lmm=0x14a020, size=56, flags=0) at src/lmm/lmm_alloc.c:44 [27/911]
44 assert((node->next == 0) || (node->next > node));
(gdb) bt#0 lmm_alloc (lmm=0x14a020, size=56, flags=0) at src/lmm/lmm_alloc.c:44
#1 0x00102529 in mem_alloc (m=0x1381cc, size=49, flags=1) at src/clientos/mem.c:103
#2 0x001009fa in malloc (size=45) at src/libc/malloc/malloc.c:24
#3 0x0012fdb9 in realloc (buf=0x0, new_size=45) at src/libc/malloc/realloc.c:25
#4 0x00113d31 in l_alloc (ud=0x0, ptr=0x0, osize=4, nsize=45) at lua/src/lauxlib.c:924
#5 0x0011950b in luaM_realloc_ (L=0x1000074, block=0x0, osize=4, nsize=45) at lua/src/lmem.c:84#6 0x0011737a in luaC_newobj (L=0x1000074, tt=4, sz=45, list=0x1001224, offset=0) at lua/src/lgc.c:220
#7 0x0011e31a in newlstr (L=0x1000074, str=0x1001a5c "Processor Serial Number: no\n", l=28, h=4130708166) at lua/src/lstring.c:65#8 0x0011e470 in luaS_newlstr (L=0x1000074, str=0x1001a5c
@mischief
mischief / switchstatement.cpp
Created June 27, 2012 02:33 — forked from anonymous/AirAndVolume.cpp
Calculater switch statement
#include <iostream>
#include "AirAndVolume.h"
int cubestuff(void) {
AirAndVolume Cube;
}
int case2stuff(void) {
// test a;
}
>>> from potr.compatcrypto import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/potr/__init__.py", line 21, in <module>
from potr import context
File "/usr/local/lib/python2.7/site-packages/potr/context.py", line 43, in <module>
from potr import crypt
File "/usr/local/lib/python2.7/site-packages/potr/crypt.py", line 25, in <module>
from potr.compatcrypto import SHA256, SHA1, HMAC, SHA1HMAC, SHA256HMAC, \
File "/usr/local/lib/python2.7/site-packages/potr/compatcrypto/__init__.py", line 24, in <module>
@mischief
mischief / tempcode
Created October 16, 2012 22:11 — forked from anonymous/tempcode
C++tempcode
#include <iostream>
using namespace std;
int value;
void test(unsigned i) {
// test i, print, etc
}
@mischief
mischief / openbsd-cheatsheet.md
Last active May 21, 2024 18:27
openbsd cheatsheet

openbsd cheatsheet

manuals

manuals: man(1), apropos(1)

  • man man - read the manual for the pkg_info command.
  • man 5 ethers - read a manual in a specific section, such as ethers(5)
  • apropos <manname> - search for manuals by name
┌─[✗]─[04:29:22]─[mischief@omicron]─[/tmp]
└─> export GOPATH=/tmp
┌─[04:29:24]─[mischief@omicron]─[/tmp]
└─> go get github.com/coreos/etcd
┌─[04:29:25]─[mischief@omicron]─[/tmp]
└─> etcd &
[1] 5618
┌─[04:29:27]─[mischief@omicron]─[/tmp]
└─> [etcd] 04:29:27.962703 INFO Found node configuration in 'info'. Ignoring flags
[etcd] 04:29:27.962996 WARN the entire cluster is down! this machine will restart the cluster.
@mischief
mischief / gist:3d6bbb2f56ff21061fea
Created August 19, 2014 21:23
openbsd rc.d example
daemon="/opt/bin/btcd"
daemon_flags=""
daemon_user="bitcoind"
. /etc/rc.d/rc.subr
rc_bg=YES
rc_reload=NO
rc_cmd $1
@mischief
mischief / systemd-debug.conf
Created April 27, 2015 23:13
systemd service debugging dropin
[Service]
Environment=SYSTEMD_LOG_LEVEL=debug