Skip to content

Instantly share code, notes, and snippets.

View JackDesBwa's full-sized avatar

JackDesBwa JackDesBwa

  • France
  • 20:47 (UTC +01:00)
View GitHub Profile
@JackDesBwa
JackDesBwa / masquerade.sh
Last active May 31, 2016 18:40
Script to configure simple masquerade
#!/bin/sh
if [ _$1 == _ ]
then
echo "Usage: $0 <output_if>"
exit 1
fi
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o $1 -j MASQUERADE
@JackDesBwa
JackDesBwa / midi2c.py
Created March 13, 2016 14:10
Script to convert midi files into C structure exploitable by (e.g.) microcontrollers
#!/usr/bin/env python2
# This script uses mido <https://pypi.python.org/pypi/mido/1.1.3> to
# transform a midi file into a C structure to be played by a
# microcontroller firmware for example
from mido import MidiFile
import sys
if len(sys.argv) != 2: