Skip to content

Instantly share code, notes, and snippets.

View kartben's full-sized avatar

Benjamin Cabé kartben

View GitHub Profile
@neolinux
neolinux / README.md
Created November 8, 2019 08:17 — forked from htdvisser/README.md
The Things Stack Bootstrap

The Things Stack Bootstrap

A script to bootstrap The Things Stack, based on the getting started guide.

Preparation

  • Clone this gist.
  • Spin up a fresh Ubuntu 18.04 server.
    • Var SSHUser: the username that will be used to SSH into the server. This user must be able to sudo.
  • Point a public DNS record to your server's IP address. It may take some time before this resolves.
@brimston3
brimston3 / MQTTTransport_mbedTLS.cpp
Created September 12, 2017 15:08
paho.mqtt.embedded-c (C++) with mbedTLS example
/*******************************************************************************
* Copyright 2017 Andrew Domaszek
*
* All rights reserved.
* This program made available under BSD-new.
*******************************************************************************/
/**
* This example is designed for Linux, using such calls as setsockopt and gettimeofday.
* On embedded, it's likely that all of the mbedtls_net_* functions would need to be
@sebz
sebz / grunt-hugo-lunrjs.md
Last active April 29, 2024 16:44
hugo + gruntjs + lunrjs = <3 search
@cobusc
cobusc / s3_log_analysis.sh
Created August 5, 2013 06:54
S3 log analysis using webalizer
#!/bin/bash
S3_LOG_LOCATION="s3://thelogbucket/logdir"
LOCAL_LOG_LOCATION="/tmp/log/"
REPORT_TITLE="My report title"
HTML_OUTPUT_DIR="/tmp/reporthtml"
REPORT="/tmp/report.ps"
# Sync log files to a local directory
s3cmd -v sync ${S3_LOG_LOCATION} ${LOCAL_LOG_LOCATION}
@andypiper
andypiper / main.lua
Created March 26, 2013 19:38
Sample using Eclipse Mihini and Paho to read modbus values from an Arduino attached to a Raspberry Pi and publish them over MQTT
require 'sched'
require 'shell.telnet'
-- Start a telnet server on port 1234
-- Once this program is started , you can start a Lua VM through telnet
-- using the following command: telnet localhost 1234
local function run_server()
shell.telnet.init {
address = '0.0.0.0',
port = 1234,
@nf
nf / hello-node.js
Created July 6, 2012 21:14
Hello world web server that scales across multiple processors
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}
cluster.on('exit', function(worker, code, signal) {
@kartben
kartben / gist:2871147
Created June 4, 2012 22:17
Convert BMP to 12-bit RGB values
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
public class Main {
/**
* @param args
#!/usr/bin/perl
use strict;
open(TSV, "freebase-sameas-dbpedialite-20120424.tsv") or die "Failed to open file: $!";
my %map;
while(<TSV>) {
my ($freebase, $dbpedialite) = split(/\s+/);
@kartben
kartben / git.eclipse.org.bugzillaIntegration.user.js
Created June 10, 2011 20:15
git.eclipse.org GreaseMonkey extension
// ==UserScript==
// @name git.eclipse.org bug reference detector
// @version 0.1.0
// @licence EPL v1.0 - http://www.eclipse.org/legal/epl-v10.html
// @namespace http://www.github.com/kartben
// @description Make references to Eclipse bugs clickable in git.eclipse.org Web UI
// @include http://git.eclipse.org/*
// ==/UserScript==
var nodes = document.evaluate(