Skip to content

Instantly share code, notes, and snippets.

View obfusk's full-sized avatar
🏳️‍🌈
hacking ⇒ ¬sleeping 😸

FC (Fay) Stegerman obfusk

🏳️‍🌈
hacking ⇒ ¬sleeping 😸
View GitHub Profile
@obfusk
obfusk / README.md
Last active December 17, 2015 17:38
test VM: vagrant, etckeeper, postgresql, mongodb, ...

[]: {{{1

File        : README.md
Maintainer  : Felix C. Stegerman <[email protected]>
Date        : 2013-05-25

[]: }}}1

Host

[]: {{{1

@obfusk
obfusk / canonpath.bash
Last active December 17, 2015 17:39
bash functions (hereby public domain)
# Usage: canonpath <path>
# No physical check on the filesystem, but a logical cleanup of a
# path.
# Uses perl.
function canonpath ()
{ perl -MFile::Spec -e 'print File::Spec->canonpath($ARGV[0])' "$1"; }
@obfusk
obfusk / FREEDOM.md
Last active December 23, 2015 11:39
fsfe Freiheit! flyer translated to Dutch and English

Freedom!

What Free Software and tools have in common

A comparison

Free Software gives us essential freedom that other software denies

@obfusk
obfusk / reduce_mbind.coffee
Created October 20, 2013 19:06
obfusk.coffee - reduce + mbind
O = require 'obfusk'; U = require 'underscore'
f = (x) -> O.Just x + 1
g = (x) -> O.Just x * 42
h = (x) -> O.Nothing()
x = U.reduce([f,g], O.mbind, O.Just(2))
y = U.reduce([f,h,g], O.mbind, O.Just(2))
console.log O.match(x, Nothing: (-> 'too bad'), Just: ((x) -> "#{x.value}!!!"))
@obfusk
obfusk / sig.bash
Created October 20, 2013 19:10
sigusr1 + wait
ME=$$; echo "I'm $ME"
( echo $BASHPID; sleep 5; echo 1; kill -SIGUSR1 $ME ) &
( echo $BASHPID; sleep 10; echo 2; kill -SIGUSR1 $ME ) &
( echo $BASHPID; sleep 15; echo 3; kill -SIGUSR1 $ME ) &
foo () { echo "USR1 received"; }
bar () { echo "USR2 received"; }
trap foo SIGUSR1
@obfusk
obfusk / grep.sh
Created October 20, 2013 19:11
DO NOT USE "foo $@ bar" !!! only use "$@" !!!
grep -R '[^"]\$@\|\$@[^"]' --exclude-dir=.git . 2>/dev/null | grep -v Binary
@obfusk
obfusk / relpath.bash
Created October 20, 2013 19:14
relative path
# 1
# usage: relpath <to> <from>
relpath () { python -c \
'import os.path, sys; print os.path.relpath(*sys.argv[1:])' "$@"; }
# 2
rel_bin="${bin#"$PREFIX"}"
@obfusk
obfusk / README.md
Created October 20, 2013 19:15
build ffmpeg

Prepare

$ aptitude install yasm libvorbis-dev libvpx-dev libsdl1.2-dev

Build

$ mkdir -p ~/tmp/build && cd ~/tmp/build
$ git clone git://source.ffmpeg.org/ffmpeg.git

$ cd ffmpeg

@obfusk
obfusk / 7z.bash
Created October 20, 2013 19:18
7z w/ encryption
7z a -mhe=on -p foo.7z foo/
@obfusk
obfusk / cfg-ex.rb
Created October 20, 2013 19:29 — forked from noxqsgit/cfg-ex.rb
actionmailer + smtp + CFG
CFG = {
test: {},
prod: {},
dev: {
...
# smtp: { ... }
}
}