Skip to content

Instantly share code, notes, and snippets.

#define GNUNET_MQ_hd_fixed_size(name,code,str,ctx) \
({ \
void (*_cb)(void *cls, const str *msg) = &handle_##name; \
((struct GNUNET_MQ_MessageHandler) { \
NULL, (GNUNET_MQ_MessageCallback) _cb, \
(ctx), (code), sizeof (str) }); \
})
#define GNUNET_MQ_hd_var_size(name,code,str,ctx) \
({ \
@amatus
amatus / gist:da76f8c8f20180ff6b0e7f2046705360
Created February 19, 2017 23:01
pt-duplicate-key-checker run on gnunet mysql datastore
# ########################################################################
# gnunet.gn090
# ########################################################################
# idx_hash is a left-prefix of idx_hash_vhash
# Key definitions:
# KEY `idx_hash` (`hash`),
# KEY `idx_hash_vhash` (`hash`,`vhash`),
# Column types:
# `hash` binary(64) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
@amatus
amatus / rom24b6-lope-colour.diff
Created March 29, 2017 20:12
Lope's color patch to ROM 2.4b6 (approximately)
diff --git a/src/act_comm.c b/src/act_comm.c
index 19eba7f..fb1f792 100644
--- a/src/act_comm.c
+++ b/src/act_comm.c
@@ -301,7 +301,7 @@ void do_auction( CHAR_DATA *ch, char *argument )
REMOVE_BIT(ch->comm,COMM_NOAUCTION);
}
- sprintf( buf, "You auction '%s'\n\r", argument );
+ sprintf( buf, "{yYou auction '%s'{x\n\r", argument );
static inline void
cbi(volatile uint8_t *sfr, char bit)
{
_SFR_BYTE(*sfr) &= ~_BV(bit);
}
#define LED_POWER &PORTD,2
cbi(LED_POWER);
16:18 <@richinseattle> amatus: run this
16:18 <@richinseattle> cd /home
16:18 <@richinseattle> sudo git clone https://github.com/caktux/slackbridge.git
16:18 <@richinseattle> cd slackbridge
16:18 <@richinseattle> sudo mv /tmp/config_from_rich docker/config.json
16:18 <@richinseattle> sudo docker build -t slackbridge docker/.
16:18 <@richinseattle> sudo docker run -d -t slackbridge
#include <avr/io.h>
#include <avr/sleep.h>
void main()
{
static char state __attribute__ ((section (".noinit")));
DDRB |= (1 << PB2);
if (state)
{
#include <stdio.h>
#include <math.h>
#include <glib/gtypes.h> // srsly guys?
#include <gts.h>
void mandelbulb(gdouble **a, GtsCartesianGrid g, guint i, gpointer data)
{
guint j, k, n;
gdouble x, y, z = g.z;
gdouble xi, yi, zi;
#include <stdio.h>
#include <math.h>
#include <glib/gtypes.h> // srsly guys?
#include <gts.h>
int main(int argc, char **argv)
{
GtsVolumeOptimizedParams params;
guint min_number = 500000;
gdouble min_angle = 3.14159 / 180 / 60;
0x606060405236156100b75763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100bc578063095ea7b31461014757806318160ddd1461017d57806323b872dd146101a2578063313ce567146101de57806342966c681461020757806370a082311461023157806379cc67901461026257806395d89b4114610298578063a9059cbb14610323578063cae9ca5114610347578063dd62ed3e146103c0575b600080fd5b34156100c757600080fd5b6100cf6103f7565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010c5780820151818401525b6020016100f3565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015257600080fd5b610169600160a060020a0360043516602435610495565b604051901515815260200160405180910390f35b341561018857600080fd5b6101906104c6565b60405190815260200160405180910390f35b34156101ad57600080fd5b610169600160a060020a03600435811690602435166044356104cc565b604051901515815260200160405180910390f35b34156101e957600080fd5b6101f1610544565b60405160ff9091168152602001
@amatus
amatus / http.sh
Last active February 24, 2018 03:33
Running SimpleHTTPServer on 80 as nobody
# You need the latest libcap2 code from git for --addamb
capsh --caps="cap_net_bind_service+eip cap_setpcap,cap_setuid,cap_setgid+ep" --keep=1 --user=nobody --addamb=cap_net_bind_service -- -c "/usr/bin/python -m SimpleHTTPServer 80"