Skip to content

Instantly share code, notes, and snippets.

View eblot's full-sized avatar

Emmanuel Blot eblot

  • France, Provence
View GitHub Profile
@eblot
eblot / printer.py
Created December 19, 2012 13:27
Simple driver for printer device based on pyusb
# MIT license
# Emmanuel Blot <emmanuel.blot@free.fr>
from base64 import b64decode
from util import BitField
import errno
import os
import usb.core
import usb.util

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
diff --git a/cfg-mplayer.h b/cfg-mplayer.h
index 4830d02..29a4365 100644
--- a/cfg-mplayer.h
+++ b/cfg-mplayer.h
@@ -270,6 +270,7 @@ const m_option_t mplayer_opts[]={
{"udp-master", &udp_master, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"udp-ip", &udp_ip, CONF_TYPE_STRING, 0, 0, 1, NULL},
{"udp-port", &udp_port, CONF_TYPE_INT, 0, 1, 65535, NULL},
+ {"udp-timeout", &udp_timeout, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL},
{"udp-seek-threshold", &udp_seek_threshold, CONF_TYPE_FLOAT, CONF_RANGE, 0.1, 100, NULL},
@eblot
eblot / 98_osx-4.1.15.patch
Created January 6, 2016 13:05
Patch files for ellcc-Mac_OS_X_10.11.2-0.1.24.tgz
--- a/scripts/Makefile.modpost 2015-12-15 06:24:51.000000000 +0100
+++ b/scripts/Makefile.modpost 2016-01-06 11:26:24.000000000 +0100
@@ -60,7 +60,7 @@
modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers
# Step 1), find all modules listed in $(MODVERDIR)/
-MODLISTCMD := find $(MODVERDIR) -name '*.mod' | xargs -r grep -h '\.ko$$' | sort -u
+MODLISTCMD := find $(MODVERDIR) -name '*.mod' | xargs grep -h '\.ko$$' | sort -u
__modules := $(shell $(MODLISTCMD))
modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o)))
@eblot
eblot / install_OSX.sh
Created March 2, 2016 13:30
ellcc install script for OSX
#!/bin/sh
export LC_ALL=C
TOP=`pwd`
ELLCC=`realpath $TOP/../..`
if [ `id -u` -ne 0 ] ; then
echo "You must be root to run this command. Be careful!" >&2
exit 1
@eblot
eblot / exclude.lst
Created March 2, 2016 13:34
Tar exclude list to generate a small SD card image for RPi
lib/modules/4.1.15-v7/kernel/drivers/staging
usr/ellcc
usr/share/doc
usr/share/man
*ntfs*
@eblot
eblot / binutils2.26-gprof32.diff
Created June 6, 2016 15:56
Special gprof version for ARM-EABI targets with 32-bit hit counters
diff -ur a/gprof/gmon_out.h b/gprof/gmon_out.h
--- a/gprof/gmon_out.h 2015-11-13 09:27:42.000000000 +0100
+++ b/gprof/gmon_out.h 2016-06-06 17:52:49.000000000 +0200
@@ -26,7 +26,7 @@
#define gmon_out_h
#define GMON_MAGIC "gmon" /* magic cookie */
-#define GMON_VERSION 1 /* version number */
+#define GMON_VERSION 1024 /* version number */
@eblot
eblot / gcc5.2.0-musl-eabi.diff
Created June 7, 2016 15:29
GCC 5.2.0 patch for ARM-EABI / MuslC
# HG changeset patch
# Parent 9b5795e98965ab4820a65ceeae0de644d0c5a9bb
Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one.
diff -r 9b5795e98965 libstdc++-v3/configure.host
--- a/libstdc++-v3/configure.host Sun Jul 26 15:42:47 2015 -0400
+++ b/libstdc++-v3/configure.host Sun Jul 26 15:46:09 2015 -0400
@@ -274,6 +274,13 @@
os_include_dir="os/bsd/freebsd"
;;
@eblot
eblot / gcc-5.2.0-musl-eabi.diff.diff
Created June 8, 2016 09:01
Patch for ARM-EABI for musl-cross patch for GCC 5.2.0
--- a/gcc-5.2.0-musl.diff 2016-06-07 11:45:27.000000000 +0200
+++ b/gcc-5.2.0-musl.diff 2016-06-07 17:20:01.000000000 +0200
@@ -49,7 +49,7 @@
*-*-*uclibc*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
;;
-+ *-*-*musl*)
++ *-*-*eabi*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
+ ;;
@eblot
eblot / redbutton-author.diff
Created June 8, 2016 09:35
Red button tweaks
--- a/Makefile 2009-07-27 15:52:12.000000000 +0200
+++ b/Makefile 2011-02-11 12:17:05.000000000 +0100
@@ -11,7 +11,7 @@
#LEX=lex
#YACC=yacc
-DESTDIR=/usr/local
+DESTDIR=$(INSTALLDIR)
MHEGC_OBJS= mhegc.o \