Skip to content

Instantly share code, notes, and snippets.

@fleger
fleger / torssadd.py
Created October 4, 2010 17:58
Command-line utility to create RSS feeds
#! /usr/bin/env python
import sys
import os
import datetime
import feedparser
import PyRSS2Gen
from optparse import OptionParser
@fleger
fleger / lmake.sh
Created November 18, 2010 23:46
Utility to create skeleton files for new NetKit labs
#! /bin/bash
# bash >= 4.0 required
[ $# == 0 ] && cat << EOF
Usage: $0 machine[:interface1=hub1[,ip1][:interface2=hub2[,ip2]] ...] ...
Utility to create skeleton files for new NetKit labs.
Options
@fleger
fleger / fuse-or.sh
Created February 20, 2011 10:39
Mount fuse filesystems in one mountpoint using or logic
#! /bin/bash
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
readonly FUSE_OR_BIN="$0"
@fleger
fleger / treewalker.sh
Created February 20, 2011 16:58
Really basic tree walking library written in bash
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
# Private API
# treewalker.__walk head preCallback postCallback
treewalker.__walk() {
@fleger
fleger / modfs.sh
Created March 1, 2011 12:17
Wrapper around unionfs-fuse that uses a file-based branches configuration.
#! /bin/bash
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
: ${UNIONFS:=unionfs}
readonly MODFS_BIN="$0"
@fleger
fleger / dreamplug.log
Created April 30, 2011 20:15
Dreamplug plugapps boot log
Marvell>> printenv
bootcmd=setenv ethact egiga0; ${x_bootcmd_ethernet}; setenv ethact egiga1; ${x_bootcmd_ethernet}; ${x_bootcmd_usb}; ${x_bootcmd;
bootdelay=3
baudrate=115200
x_bootcmd_ethernet=ping 192.168.2.1
x_bootcmd_usb=usb start
x_bootcmd_kernel=fatload usb 0 0x6400000 uImage
x_bootargs=console=ttyS0,115200
ethact=egiga0
ethaddr=F0:AD:4E:00:81:59
@fleger
fleger / sd_wlan-linux-3.1.diff
Created May 8, 2011 16:29
Fix SD WLAN to compile against new kernels (2.6.35 - 3.1)
diff -Naur a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/Makefile b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/Makefile
--- a/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/Makefile 2010-07-13 22:08:32.000000000 +0200
+++ b/SD_WLAN/SD-WLAN-BT-8688-LINUX2625-SAAR-10.49.3.p70-26609.P64_B1/wlan_src/Makefile 2011-11-10 11:11:37.288408994 +0100
@@ -89,7 +89,7 @@
# ARCH specifies the architecture of the target processor, this kernel
# module will run.
# ARCH can be set on the command line
-# make ARCH=<arm/i386>
+# make ARCH=<arm/x86>
# Alternatively ARCH can be set in the environment
@fleger
fleger / fixX77JHDA.sh
Created May 24, 2011 17:52
Fix the sound card of the Asus X77J to output 5.1 sound with ALSA
rclocal.10-fixX77JHDA() {
# Fix the sound card configuration to output 5.1 with ALSA.
local snddev=/dev/snd/hwC0D0
[[ -e "$snddev" ]] &&
# Source: 0x0 - Front
# 0x1 - LFE / Center
# 0x2 - Rear
# 1st jack (0x19) will be rear channels (green)
@fleger
fleger / cmake.log
Created June 14, 2011 16:48
Path64 compilation failed
Scanning dependencies of target pscrt-static-x86_64
[ 32%] Generating pscrt-static-x86_64/malloc_opt_c.o
[ 32%] Generating pscrt-static-x86_64/memset_em64t_s.o
[ 32%] Generating pscrt-static-x86_64/memset_opteron_s.o
[ 32%] Generating pscrt-static-x86_64/memcpy_em64t_c.o
[ 32%] Generating pscrt-static-x86_64/memcpy_opteron_c.o
In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/include/xmmintrin.h:37,
from /home/fleger/tmp/path64-git/src/path64-build/src/libpscrt/intrin.h:51,
from /home/fleger/tmp/path64-git/src/path64-build/src/libpscrt/memcpy_opteron.c:25:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/include/mmintrin.h: In function '_mm_add_si64':
@fleger
fleger / .asoundrc
Created June 18, 2011 08:09
ALSA: Bauer stereophonic to binaural global filter
pcm.bs2b {
type ladspa
slave.pcm "plug:dmix"
path "/usr/lib/ladspa"
plugins [
{
label bs2b
input {
controls [ 700 4.5 ]
}