Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexander Neumann fd0

View GitHub Profile
View gist:257695
Section "InputDevice"
Identifier "Trackpoint"
Driver "mouse"
Option "SendCoreEvents" "true"
Option "Device" "/dev/input/by-path/platform-i8042-serio-1-mouse"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
Option "EmulateWheel" "true"
View gist:264756
#!/usr/bin/env ruby
def cmd(*bytes)
while bytes.length < 15
bytes << 0x00
end
data = bytes.collect{ |b| "0x%02x" % b }.join(',')
p data if $VERBOSE
system("usbtool -P fnordlicht-control -d \"%s\" control out vendor device 1 0 0" % data)
end
View gist:268868
diff --git a/fnordlicht-firmware/remote.c b/fnordlicht-firmware/remote.c
index 2594489..d6f54f7 100644
--- a/fnordlicht-firmware/remote.c
+++ b/fnordlicht-firmware/remote.c
@@ -578,8 +578,8 @@ void parse_powerdown(void)
DDRC = 0;
DDRD = 0;
- /* configure int pin as input with pullup */
- R_DDR = _BV(INTPIN);
View gist:308792
# Task program configuration file.
# For more documentation, see http://taskwarrior.org
# Files
data.location=/home/fd0/.task
locking=on # Use file-level locking
# Terminal
curses=on # Use ncurses library to determine terminal width
#defaultwidth=80 # Without ncurses, assumed width
@fd0
fd0 / gist:334261
Created Mar 16, 2010
simple debounce routine
View gist:334261
#include <avr/io.h>
#include <util/delay.h>
/* call every 10 ms, for buttons at pins PC0-PC3 */
uint8_t button_sample(void) {
static uint8_t state = 0b1111; /* initialize state, buttons are active low! */
static uint8_t last_sample = 0b1111; /* initialize old sample */
uint8_t new_sample = PINC & 0b1111; /* read inputs */
/* mark bits which are sampled with the same value */
View gist:346738
ii nvidia-glx 190.53-2 NVIDIA binary Xorg driver
ii xorg 1:7.5+3 X.Org X Window System
ii xorg-docs-core 1:1.5-1 Core documentation for the X.org X Window System
ii xserver-xorg 1:7.5+3 the X.Org X server
ii xserver-xorg-core 2:1.7.5-1 Xorg X server - core server
ii xserver-xorg-input-all 1:7.5+3 the X.Org X server -- input driver metapackage
ii xserver-xorg-input-evdev 1:2.3.2-3 X.Org X server -- evdev input driver
ii xserver-xorg-input-synaptics 1.2.1-1 Synaptics TouchPad driver for X.Org server
ii xserver-xorg-input-wacom 0.10.3+20100109-1 X.Org X server -- Wacom input driver
ii xserver-xorg-video-all 1:7.5+3 the X.Org X server -- output driver
View gist:536089
" translate words with :dict
com! -nargs=+ dict :tabopen http://dict.leo.org?<args>
" and bind to D
map D :dict<space>
" lookup with imdb with :imdb
com! -nargs=+ imdb :tabopen http://www.imdb.de/find?s=all&q=<args>
" and bind to I
map I :imdb<space>
View gist:560623
# fork + exec(arg, *args)
# the stdfd argument may be used to use an existing IO object (with an
# associated fd) instead of new pipes for stdin/stdout/stderr, no other fds
# will be open in the child
# returns [pid, stdin, stdout, stderr]
# fd 3 through NOFILE are closed before exec
def popen(stdfd, arg, *args)
parent = []
child = []
# create pipes for stdin/stdout/stderr or use objects from stdfd
View gist:610340
test.cgi:
/-------------------------
#!/usr/bin/env ruby
require 'cgi'
puts "Content-Type: text/plain"
puts
cgi = CGI.new
View gist:611310
NAME=main
OTHER+=kapitel/*.tex
OTHER+=bibliography/*.bib
OTHER+=bilder/*.*
CLEAN_FILES+=kapitel/*.aux
USE_PDFLATEX=1
VIEWPDF=evince
include /usr/share/latex-mk/latex.gmk