Skip to content

Instantly share code, notes, and snippets.

View arekinath's full-sized avatar

Alex Wilson arekinath

View GitHub Profile
1. Put these files in /etc/persistent on the ubnt
2. on the ubnt device, do:
cd /etc/persistent
chmod +x rc.postsysinit ssh-tunnel
dropbearkey -t rsa -f ubnt-rsa
3. dropbear will print out the public-key part (line that looks like: ssh-rsa XXXXXX... )
4. put this ssh-rsa line into ~/.ssh/authorized_keys on the server
5. on the ubnt device, do:
cfgmtd -r
cfgmtd -w -p /etc
#include "singleton.h"
#include <QCoreApplication>
int main(int argc, char *argv[])
{
QCoreApplication ca(argc, argv);
Singleton::instance()->init();
return 0;
}
grammar MessageQuery
rule expr
first:cond exprpart* <Expression>
end
rule exprpart
space* op:('&&' / '||') space* second:cond <ExpressionPart>
end
rule cond
@arekinath
arekinath / runscript.xml
Created August 17, 2012 02:47
Run script at bootup
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="runscript">
<service name="runscript" type="service" version="1.0.0">
<create_default_instance enabled="true"/>
<single_instance/>
<dependency name="network" grouping="require_all" restart_on="error" type="service">
<service_fmri value="svc:/milestone/network:default"/>
</dependency>
<dependency name="filesystem" grouping="require_all" restart_on="error" type="service">
@arekinath
arekinath / _readme.md
Created August 18, 2012 06:31
Observium minecraft monitor

Minecraft server monitoring plugin for Observium (http://www.observium.org/)

It uses the client "lobby ping" protocol to ping the server and get the number of connected players / max players and graphs these two numbers in Observium.

Some of us take our monitoring seriously for non-serious services, too! ;)

@arekinath
arekinath / _readme.md
Created August 18, 2012 06:32
Patch for observium nginx app monitor

This patch adds the ability for the Observium (http://www.observium.org/) nginx app monitor to get its data directly from PHP, rather than the standard path via SNMP or via the unix-agent (which doesn't work properly on some operating systems)

For the corresponding nginx config, see http://www.observium.org/wiki/Application/nginx (but make it also accessible to the IP address of your Observium host)

@arekinath
arekinath / Makefile
Created October 6, 2012 08:49
Ascot AA2-WS-15 weather station
weather: weather.c
gcc -O2 -msse2 -ftree-vectorize -I/opt/local/include -L/opt/local/lib -lrtlsdr -lm -std=c99 weather.c -o weather
@arekinath
arekinath / mod_roster_ldapname.erl
Last active October 13, 2015 14:57
ejabberd hook module that forces new roster entries with a blank alias to be given a default name from LDAP.
%%%----------------------------------------------------------------------
%%% mod_roster_ldapname
%%%
%%% Hook module that forces new roster entries with a blank alias to
%%% be given a default name from LDAP.
%%%
%%% This fixes the common problem where a newly added contact has only
%%% its jid as a name until you right-click and go to 'get info' (in
%%% Pidgin, similarly in other clients). Some clients never load the
%%% vcard info into aliases (eg, bitlbee), and this also fixes things up
@arekinath
arekinath / d2rq-self-joins2.patch
Created March 1, 2013 06:05
Let's have another go at this
diff --git a/src/de/fuberlin/wiwiss/d2rq/engine/TripleRelationJoiner.java b/src/de/fuberlin/wiwiss/d2rq/engine/TripleRelationJoiner.java
index e9efd77..3211078 100644
--- a/src/de/fuberlin/wiwiss/d2rq/engine/TripleRelationJoiner.java
+++ b/src/de/fuberlin/wiwiss/d2rq/engine/TripleRelationJoiner.java
@@ -67,9 +67,20 @@ class TripleRelationJoiner {
Set<String> attributeNames)
{
Map<String,List<String>> uniqueKeys = database.getUniqueKeyColumns(originalName);
- if (uniqueKeys == null) return false;
+ if (uniqueKeys != null) {
@arekinath
arekinath / fifoadm.patch
Last active December 15, 2015 20:09
make fifoadm datasets import work
diff --git a/apps/sniffle/src/sniffle_console_datasets.erl b/apps/sniffle/src/sn
index e8a904b..e7880ca 100644
--- a/apps/sniffle/src/sniffle_console_datasets.erl
+++ b/apps/sniffle/src/sniffle_console_datasets.erl
@@ -27,9 +27,9 @@ read_image(UUID, File, TotalSize, LastDone, Idx) ->
case trunc((Done - LastDone) / 0.02) of
X when X >= 1 ->
io:format(string:copies("=", X)),
- read_image(UUID, File, TotalSize, Done, Idx);
+ read_image(UUID, File, TotalSize, Done, Idx1);