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
mattes / mkcard.sh
Created Oct 22, 2012
format sd card for arch linux and others
View mkcard.sh
#!/bin/bash
# Quelle: http://omappedia.org/wiki/Minimal-FS_SD_Configuration, 06.06.2012
if [ ! "$1" = "/dev/sda" ] ; then
unset LANG
DRIVE=$1
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
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
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
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 http://rsync.samba.org/ftp/rsync/src/rsync-3.0.8.tar.gz
tar -xzvf rsync-3.0.8.tar.gz
rm rsync-3.0.8.tar.gz
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-patches-3.0.8.tar.gz
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
mattes / gist:3994595
Created Nov 1, 2012
Regular Expression for command line parameters
View gist:3994595
--command value
--command "another value"
/\s*("[^"]+"|[^\s"]+)/
@mattes
mattes / js.js
Created Feb 15, 2013
~hash.indexOf(key)
View js.js
if(~hash.indexOf(key)) {
return true;
} else {
return false;
}
@mattes
mattes / skype-status.html
Last active Apr 20, 2017
print skype status
View skype-status.html
<!DOCTYPE html>
<head>
<title>Skype Status</title>
</head>
<body>
<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="http://www.datatables.org/">www.datatables.org</a>)</p>
<p>Offline (1), Online (2), Away (3), Do not disturb (3)</p>
@mattes
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('http://query.yahooapis.com/v1/public/yql?q=' + encodeURI(query + '&format=json&env=store://datatables.org/alltableswithkeys&callback=?'),
function(data){
if(data.query.count > 0) {
if(callback) return callback.call(null, data.query.results.json);
} else {
if(callback) return callback.call(null, false);
}
You can’t perform that action at this time.