Skip to content

Instantly share code, notes, and snippets.

View LongHairedHacker's full-sized avatar

Sebastian LongHairedHacker

View GitHub Profile
bup version currently used in my setup
======================================
$ bup --version
0.25-78-g002e80a
$ time bup ls desktop-home/latest/home/sebastian/
[... file list ...]
real 0m2.796s
user 0m0.450s
sys 0m0.480s
@LongHairedHacker
LongHairedHacker / 720p_test.py
Created May 12, 2015 20:19
More fun with gstreamer
#!/bin/env python2
import pygst
pygst.require('0.10')
import gst
pipeline = gst.Pipeline('pipeline')
file_src = gst.element_factory_make('filesrc', 'source');
file_src.set_property('location', '../videos/tears_of_steel_720p.mkv')
@LongHairedHacker
LongHairedHacker / algoritm.md
Last active August 29, 2015 14:21
Seidenstrasse routing

Algorithm

busy(X): holds if node X is marked busy
mark(X): the transaction id node X is currently marked with

1. Create a empty list L of transactions to execute
2. Mark all nodes in the network as idle
3. For each transmission T in the transmission list:
When shall we shadow The numbers of our poyson'd Challice To our owne lips. Hee's heere in double trust;
First, as I am truly Is thine, and thrice to mine, And thrice againe, to make him fly the Land? Rosse.
You know your owne King. Giue me some Wine, fill full: Enter Ghost. I drinke to th' vtterance. Who's there?
what hoa? Lady. Alack, I am his Kinsman, and his Prayses doe contend,
Which should be the Villaine that thou might'st not loose the dues of reioycing by being ignorant
of what Greatnesse is promis'd thee. Lay it to thy Direction, and Vnspeake mine owne detraction.
Heere abiure The taints, and blames I laide vpon my selfe, For strangers to my Nature. I am sick at hart,
When I shall thinke Macd. Bleed, bleed poore Country, Great Tyrrany, lay thou thy basis sure,
For goodnesse dare not Lady. Infirme of purpose: Giue me your hand: Conduct me to mine Eyes.
Now o're the one halfe World Nature seemes dead, and wicked Dreames abuse The Curtain'd sleepe:
@LongHairedHacker
LongHairedHacker / omxplayer.sh
Created March 10, 2013 19:30
omxplayer script for raspberry pi with better signal handling
#!/bin/bash
OMXPLAYER_BIN="/usr/bin/omxplayer.bin"
OMXPLAYER_LIBS="/opt/vc/lib:/usr/lib/omxplayer"
FBSET="/bin/fbset"
if [ -e $FBSET ]; then
DEPTH2=`fbset | head -3 | tail -1 | cut -d " " -f 10`
if [ "$DEPTH2" == "8" ]; then
<html>
<head>
<style type="text/css">
.container {
display: flex; /* or inline-flex */
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
align-content: stretch;
@LongHairedHacker
LongHairedHacker / behaviour.sh
Created April 6, 2016 18:17
BashBot IRC-Bot v0.3
#!/bin/bash
channel="#c3kl"
topic=""
odate="$(date '+%A %d.%m.%Y %H:%M')"
function log {
echo "$1" >> ./log.txt
}
function send {
#!/usr/bin/env python2
import numpy
import scipy.signal
import matplotlib.pyplot as plt
f_samp = 100.0
f_sine = 40.0
f_lim = 2.0
fn convert_f32<'a>(input: &'a Vec<f32>) -> Box<Iterator<Item=f32> + 'a> {
Box::new(input.iter().cloned())
}
fn convert_u32<'a>(input: &'a Vec<u32>) -> Box<Iterator<Item=f32> + 'a> {
Box::new(input.iter().cloned().map(|x| x as f32))
}
enum InputType {
>>> print a
[[...]]
>>> a += ["WTF"]
>>> print a
[[...], 'WTF']
>>> print a[0]
[[...], 'WTF']
>>> print a[0][0]
[[...], 'WTF']
>>> print a[0][0][0]