Skip to content

Instantly share code, notes, and snippets.

View bensinober's full-sized avatar

Benjamin Rokseth bensinober

  • Oslo Public Library
  • Oslo, Norway
View GitHub Profile
@bensinober
bensinober / bluez_gatt_server.c
Created October 15, 2025 10:43
bluez working gatt server with writable characteristic
//
// test server for simple GATT characteristics remote control
// ONE write characteristic only
// some ideas from https://github.com/rstatz/ble_gateway as it was the only decent
// found that uses bluez sources without the entire shebang stack
#define _GNU_SOURCE
#include <stdio.h>
#include <stdbool.h>
---
version: '2.1'
networks:
backend:
driver: bridge
volumes:
koha_index: {}
koha_state: {}
--- ractive.js.1 2015-05-04 20:20:25.000000000 +0200
+++ ractive.js 2015-06-02 12:18:48.471310194 +0200
@@ -10962,14 +10962,23 @@
function getCustomHandler(name) {
if (!customHandlers[name]) {
customHandlers[name] = function (event) {
- var storage = event.node._ractive;
+ var storage,
+ handler,
+ indices,
#!/usr/bin/env python
# script to add minion config
import yaml
import sys
import os
f=open("/etc/salt/minion", 'r')
settings=yaml.load(f)
f.close()
ip=os.environ["MASTER_IP"]
if settings["master"].__class__ == str:
{ "index" : { "_index" : "public", "_type" : "manifestation" } }
{"abstract":"Knowledge Encyclopedia gir en visuell tilnærming til kunnskap om verdens underverker. Leksikonet tar i bruk det siste innen CGI-teknologi for å hjelpe leseren til å utforske alt mellom himmel og jord. I boka kan man fordype seg i temaer som natur, jorda, menneskekroppen, historie, kultur, vitenskap og teknologi. Knowledge Encyclopedia inneholder også 3D bilder av sola, innsiden av en hai, en 3D DNA-spiral og Shakespeares The Globe.","audience":["http://data.deichman.no/audience/ages_10-11","http://data.deichman.no/audience/ages_12-15","http://data.deichman.no/audience/ages_8-9","http://data.deichman.no/audience/juvenile"],"contributor":["http://data.deichman.no/person/x2048409200","http://data.deichman.no/person/x30157900"],"description":["Har innholdsfortegnelse, ordliste, register","kol. ill"],"editor":["http://data.deichman.no/person/x2048409400","http://data.deichman.no/person/x2048409500","http://data.deichman.no/person/x204840
@bensinober
bensinober / postinstall.sh
Last active December 25, 2015 20:09
vagrant cleanup and install guest addition
# postinstall.sh created from Mitchell's official lucid32/64 baseboxes
date > /etc/vagrant_box_build_time
# Apt-install various things necessary for Ruby, guest additions,
# etc., and remove optional things to trim down the machine.
apt-get -y update
apt-get -y upgrade
apt-get -y install openssh-server linux-headers-$(uname -r) build-essential
apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
@bensinober
bensinober / cleanup-vagrant-box.sh
Created October 10, 2013 07:56
cleanup vagrant virtualbox images, make it as small as possible
#!/bin/bash
cat - << EOWARNING
WARNING: This script will fil up your left over disk space.
DO NOT RUN THIS WHEN YOUR VIRTUAL HD IS RAW!!!!!!
You should NOT do this on a running system.
This is purely for making vagrant boxes damn small.
Press Ctrl+C within the next 10 seconds if you want to abort!!