Skip to content

Instantly share code, notes, and snippets.

Matthias Kadenbach mattes

Block or report user

Report or block mattes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mattes /
Created Oct 22, 2012
format sd card for arch linux and others
# Quelle:, 06.06.2012
if [ ! "$1" = "/dev/sda" ] ; then
unset LANG
if [ -b "$DRIVE" ] ; then
dd if=/dev/zero of=$DRIVE bs=1024 count=1024
SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
echo DISK SIZE - $SIZE bytes
CYLINDERS=`echo $SIZE/255/63/512 | bc`
mattes / bootcmd
Created Oct 23, 2012
bootcmd for u-boot
View bootcmd
fatload mmc 0 0x80300000 uImage
setenv bootargs console=ttyO2,115200n8 noinitrd init=/sbin/init root=/dev/mmcblk0p2 rootwait rw loglevel=8
bootm 80300000
mattes / watch.c
Created Oct 31, 2012
watch directory for changes and print "update" on change
View watch.c
#include <sys/event.h>
#include <sys/time.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>
int main (int argc, const char *argv[])
mattes / gist:3990176
Created Oct 31, 2012
update rsync on mac os to rsync 3.0.8
View gist:3990176

Do in Terminal (requires XCode with Command line tools installed):

curl -O
tar -xzvf rsync-3.0.8.tar.gz
rm rsync-3.0.8.tar.gz
curl -O
tar -xzvf rsync-patches-3.0.8.tar.gz
rm rsync-patches-3.0.8.tar.gz
cd rsync-3.0.8
patch -p1 <patches/fileflags.diff
View example.prf
root = /Users/matthias/somedir
root = ssh://matthias@host:9000/somedir
auto = true
log = true
logfile = /Users/matthias/.unison/unison.log
maxbackups = 5
backup = Name *
mattes / gist:3994595
Created Nov 1, 2012
Regular Expression for command line parameters
View gist:3994595
--command value
--command "another value"
mattes / js.js
Created Feb 15, 2013
View js.js
if(~hash.indexOf(key)) {
return true;
} else {
return false;
mattes / skype-status.html
Last active Apr 20, 2017
print skype status
View skype-status.html
<!DOCTYPE html>
<title>Skype Status</title>
<h1>Return Skype Status</h1>
<p>return skype status (requires the skype privacy setting set to true)<br>
using Open Data tables with YQL (<a href=""></a>)</p>
<p>Offline (1), Online (2), Away (3), Do not disturb (3)</p>
mattes / kippt.user.clips.js
Created May 11, 2013
read kippt user clips
View kippt.user.clips.js
var getKipptReads = function(userId, callback) {
if(!userId) throw new Error('missing user id');
var query = 'use "store://OdRiZuDnzAn82XXFXFeQBg" as kippt.user.clips; select * FROM kippt.user.clips WHERE user_id="' + userId + '";';
$.getJSON('' + encodeURI(query + '&format=json&env=store://'),
if(data.query.count > 0) {
if(callback) return, data.query.results.json);
} else {
if(callback) return, false);
You can’t perform that action at this time.