Skip to content

Instantly share code, notes, and snippets.

#include <vector>
#include <boost/range/algorithm_ext/iota.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/lambda/lambda.hpp>
using namespace boost::adaptors;
using namespace boost::lambda;
@Risca
Risca / unix_ipv6_support.patch
Created June 11, 2013 09:26
IPv6 support for Linux Synergy (tested on Sabayon Linux)
diff -uNr synergy-1.4.10-Source.orig/src/lib/arch/CArchNetworkBSD.cpp synergy-1.4.10-Source/src/lib/arch/CArchNetworkBSD.cpp
--- synergy-1.4.10-Source.orig/src/lib/arch/CArchNetworkBSD.cpp 2012-04-06 19:52:29.000000000 +0200
+++ synergy-1.4.10-Source/src/lib/arch/CArchNetworkBSD.cpp 2012-11-13 17:47:14.224995060 +0100
@@ -49,7 +49,8 @@
static const int s_family[] = {
PF_UNSPEC,
- PF_INET
+ PF_INET,
+ PF_INET6,
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define CHUNK_SIZE (512*1024)
#define START_GB ((off_t)2928) // ~13 % of 22 TB
int main(int argc, char* argv[])
{
#!/usr/bin/env bash
function enable_2v_adc_on_gpio0 {
# docs: http://dl.linux-sunxi.org/AXP/AXP209_Datasheet_v1.0en.pdf
v=$(i2cget -f -y 0 0x34 0x83 b)
/usr/sbin/i2cset -f -y 0 0x34 0x83 $((v&0xF7)) # disable ADC input on GPIO0
/usr/sbin/i2cset -f -y 0 0x34 0x90 0x04 # set GPIO0 to 12 bit ADC input
u=$(i2cget -f -y 0 0x34 0x85 b)
# /usr/sbin/i2cset -f -y 0 0x34 0x85 $((u|0x01)) # set ADC input range to 0.7-2.7475v
/usr/sbin/i2cset -f -y 0 0x34 0x85 $((u&0xFE)) # set ADC input range to 0-2v
@Risca
Risca / notes
Created May 26, 2017 13:54
death gate notes
.PIC: Images and other stuff
Begins with header with info on all contained files. Last header entry is blank (all zeros):
4 bytes - Offset to file
2 bytes - Type:
0x0300 == closed book or runes,
0x0500 == navigation images and items,
0x1300 == note, open book, spell casting interface, or frame around embedded video,
0x1500 == big static image,
0x4501 == some kind of overlay images to big images,
3*2 bytes - Type specific data/arguments
@Risca
Risca / add_rdc3210_machine.patch
Last active December 15, 2021 04:15
This adds support to qemu for bifferboard
Index: host-qemu-5.2.0/default-configs/devices/i386-softmmu.mak
===================================================================
--- host-qemu-5.2.0.orig/default-configs/devices/i386-softmmu.mak
+++ host-qemu-5.2.0/default-configs/devices/i386-softmmu.mak
@@ -27,5 +27,6 @@
#
CONFIG_ISAPC=y
CONFIG_I440FX=y
+CONFIG_RDC3210=y
CONFIG_Q35=y