Skip to content

Instantly share code, notes, and snippets.

View mildred's full-sized avatar

Mildred Ki'Lya mildred

View GitHub Profile
@mildred
mildred / break_cpp_encapsulation.cpp
Created March 11, 2014 13:30
Break C++ encapsulation
class A {
template<class T> class B {};
template<class T> friend class C;
int priv;
protected:
int pro;
};
template<typename T, typename U>
@mildred
mildred / bootstrap-geard.sh
Last active August 29, 2015 14:04
Install geard from source
#!/bin/sh
#See: https://aur.archlinux.org/packages/ge/geard-git/PKGBUILD
set -e
: ${PREFIX:=/usr/local}
mkdir -p $PREFIX/src/geard.go
cd $PREFIX/src/geard.go
export GOPATH="$PWD"
@mildred
mildred / mail.gear.json
Last active August 29, 2015 14:04
mail.gear.json
{
"Keys":[{
"Type": "authorized_keys",
"Value": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDByLP6c0nvG8itxtyf9ucG6wQG5r6/mwJcPw7aFQb26930zRTOi+PfMjMFBWrhwkFDktlnTBGOvp+bygU4JuipU3pR5BL5o+Lrawd+Uu00kkhxlmkTzP1WYcdpbgBlXutLTuta5Gt4c3e8xUwdcvGHTizKZZZ+BENaOv7j2yfAaJnBJCKcdoI7WCBhuezRWfC2URfVMad/mPxECei/SzGcjhjh1hQiogXH9jwXsrrsU0nuMy8H2LWgqp2nDGFVvqInKC0ICWwDuhpNT21OB0KGdd7LxYdlve/CaMKYRhRMBLmu+grV8akGkmD0uGmF5fVNUOxcRW8PZnCEPiIFvgcv"
}],
"containers":[
{
"name":"mail",
"count":1,
"image":"mildred/exim-dovecot-mail",
@mildred
mildred / README.md
Last active August 29, 2015 14:06
Finding backlinks in a DHT

Nodes that store the content store the links

  • a backlink is a dictionary (that could be represented as JSON to be human-readable) containing a key target with the hash of the object it is about. Other fields are not necessarily fixed. The object size must be small enough (to fit in a UDP packet).
  • to publish a link, the author must regularly send an advertise message to all nodes that store the target. Nodes are supposed to accept or refuse to store the link. But if they refuse to store a link to a specific object, they must also refuse all other links for this object. If the link is malformed (they don't have the object referenced by target), nodes can reject it safely.
  • to query a link about a target, a node must query the owner of the target for links about it. If no links are returned, the node must query other nodes having the target until one node having a link is found. Then the search can then stop.

Notes:

  • when querying links about an object we
@mildred
mildred / subprocess-0.02-1.rockspec
Last active August 29, 2015 14:06
subprocess.rockspec
package = "subprocess"
version = "0.02-1"
source = {
url = "git://github.com/mildred/lua-subprocess.git"
}
description = {
summary = "Subprocess module for Lua",
detailed = [[
]],
homepage = "https://github.com/xlq/lua-subprocess",
@mildred
mildred / README.md
Last active August 29, 2015 14:09
Ports USB déportés avec un RaspberryPi

Installer ArchLinux

Installez ArchLinux sur le Raspberry en utilisant NOOBS, ça marche relativement bien, et ça vous donne une installation ArchLinux minimale. Parfait pour installer des trucs. Une fois installé, vous avez un serveur SSH qui va écouter sur le réseau local. Connectez-vous (le mot de passe est root):

ssh root@alarmpi.local

Pensez a changer votre mot de passe, et ajoutez peut être une authentification par clef SSH:

passwd

@mildred
mildred / README.md
Created November 13, 2014 18:26
systemd user mode

En suivant ce tuto (excepté que je n'ai pas installé shairport, je n'en vois pas l'intérêt), je n'avais pas pulseaudio d'exécuté. Voici les étapes pour activer pulseaudio dans ce cas:

Activer l'utilisateur pi au démarrage:

loginctl enable-linger pi

Se connecter comme simple utilisateur (la variable d'environnement XDG_RUNTIME_DIR doit être modifie pour se connecter au daemon systemd user, sinon ce ne sera pas possible):

su pi

export XDG_RUNTIME_DIR=/run/user/$(id -u)

@mildred
mildred / HACKING.firefox
Last active August 29, 2015 14:19
Hacking.firefox
Path from a URL typed by a user to the HTTP request:
- browser.xul
- tabbrowser.xml: <method name="addTab">
- tabbrowser.xml: <browser/>.loadURIWithFlags(...)
- toolkit/content/widgets/browser.xml: <method name="loadURIWithFlags">
- toolkit/content/widgets/browser.xml: nsIWebNavigation::loadURIWithOptions(...)
- docshell/base/nsIWebNavigation.idl (we should add a auth callback to this interface)
alternatives:
- toolkit/modules/RemoteWebNavigation.jsm
@mildred
mildred / README.md
Last active August 29, 2015 14:21 — forked from anonymous/README.md
Getting started with a SPARQL server

Getting started with a SPARQL server

OpenRDF Sesame

Sesame is a J2EE application that is contained in a servlet. This is generally deployed using Tomcat, but we are not going to use that or anything bloatware. Instead we will make use of Winstone, a lightweight application server.

Sesame is composed of two servlets. openrdf-sesame that is best served at /openrdf-sesame and that contain the HTTP REST API to the RDF store. Then there is openrdf-workbench (served from /openrdf-workbench) that is the UI to the server. You don't really need the UI but it's nice to get started and explore the server.

@mildred
mildred / SmartWeb.md
Last active August 29, 2015 14:21
SmartWeb, the new Web

SmartWeb, the new Web

SmartWeb is a concept that tries to unify all the work done in the RDF community with HTML and websites. The goal is to create a web server that is smart enough that server side applications will no longer be necessary, and with completely decentralized content. More specifically:

  • Allow updating pages using HTTP PUT. The page editor can be entirely client-side

  • Automatic gathering of backlinks using the Referer header. The server will fetch the remote resource and try to determine the kind of link that was done (by parsing the HTML resource or querying the remote RDF datastore directly if available)

  • RDF datastore that can be queried easily.