Skip to content

Instantly share code, notes, and snippets.

View toke's full-sized avatar

Thomas Kerpe toke

View GitHub Profile
FROM debian:wheezy
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r postgres && useradd -r -g postgres postgres
RUN apt-get update && apt-get install -y curl
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' > /etc/apt/sources.list.d/pgdg.list
RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -

docker-sybase

How to run Sybase ASE on Docker.

This will allow you to create a Docker Image with Sybase on it (in this case Syabse ASE 15.7) This demo uses Redhat but most of the steps are generic.

1) Install docker

See : http://docs.docker.io/installation/rhel/

@toke
toke / derive_mac.c
Last active August 29, 2015 14:05
Derive MAC adress from 1wire sensor address.
uint8_t mac[] = { 0x02, 0xAD, 0x3A, 0x6E, 0xFE, 0xE1 }; // DEFAULT MAC
//...
if (sensors.count > 0) {
// Derive MAC address from OneWire Address
derive_mac(sensors.sensor[0].address, mac);
}
Ethernet.begin((uint8_t*)mac, ip);
/*
* Copyright (c) 2014 Thomas Kerpe <toke@toke.de>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@toke
toke / mebus-433sensor.md
Last active August 29, 2015 14:06
Being sick at home on a saturday afternoon and some time to spare? Lets make sense out of bleeps....

Analyzing the Mebus Wireless Sensor

I have a Mebus Weather station from a discounter in my kitchen and an wireless sensor outside the kitchen window. It operates at 433.92MHz and it's blips and bits are not yet analyzed (at least by me). So lets try to read it.

I will use my crappy rtl2832 DVB Dongle (Rafael Micro R820T) for that. I'd buyed it some time ago for 1€. I'ts a little bit whiny about everything. Touch it – määää. Use it without an Powered HUB wäääää. But even that crappy thing is useful ;-)

I have some clue what to expect, so I don't start at zero. I assume the data is modulated as OOK. (On Off Keying) and I have an progam rtl_443 which can help me decode it.

@toke
toke / route.txt
Last active August 29, 2015 14:07
Routing via se?
Tracing route to toke.de [2a01:4f8:100:14a5::3]
over a maximum of 30 hops:
1 1 ms <1 ms <1 ms 2002:5b59:128c:fc:xxxx:xxxx:xxxx:xxxx
2 1 ms <1 ms <1 ms 2002:5b59:128c:0:xxxx:xxxx:xxxx:xxxx
3 * * * Request timed out.
4 58 ms * 67 ms gi8-47.se.sto.dch.dr1.port80.se [2001:16d8:1:6240::1]
5 45 ms 51 ms 43 ms ae1-u1301.se.sto.dch.cr1.port80.se [2001:16d8:1:1354::95]
6 * 56 ms 53 ms Tengi4-2.se.mlm.wtc.cr0.port80.se [2001:16d8:1:1371::1]
7 64 ms 47 ms * decix-gw.hetzner.de [2001:7f8::616c:0:1]
@toke
toke / short-git-rev.md
Last active August 29, 2015 14:16
Print short git rev

Short Git-REV:

REV=$(git rev-parse HEAD)
echo ${REV::7}

or the correct way ;-) :

CVS2GIT

export REPOPATH="abc/production_ng"
export REPONAME="cvsmigration"
mkdir cvs-migration
cd cvs-migration
mkdir cvs2svn-tmp

cvs2git \
@toke
toke / nginx_auth.conf
Last active August 29, 2015 14:16
Ngninx Proxy Auth
Server {
location / {
auth_basic "closed site";
auth_basic_user_file conf/htpasswd;
}
location /b {
allow 192.168.1.1/24;
@toke
toke / bindzone.js
Created May 5, 2010 19:52
CouchDB Bind zone file generation as an example (CouchDB show function)
function(doc, req) {
// bind zone file generation as an example (CouchDB show function)
// see http://blog.fupps.com/2010/05/03/dns-backed-by-couchdb-redux/
// reused some code by the original author Jan-Piet Mens
// Warning very raw code below. It may eat your pants.
var soa_rr = function (mname, rname, serial, refresh, retry, expire, minimum){
return ("@ IN SOA " + mname + ". " + rname + ". ("+ serial+" "+ refresh + " "+ retry + " "+ expire +" "+ minimum +")\n\n");
};