Skip to content

Instantly share code, notes, and snippets.

View grauwoelfchen's full-sized avatar
🐺
Typing with carved wooden keyboard ᕕ( ᐛ )ᕗ

Yasha grauwoelfchen

🐺
Typing with carved wooden keyboard ᕕ( ᐛ )ᕗ
View GitHub Profile
@grauwoelfchen
grauwoelfchen / glpsol
Created November 2, 2012 17:40
glpk glpsol command output
$ glpsol -m tdl.mod -d tdl.dat -o tdl.sol
GLPSOL: GLPK LP/MIP Solver, v4.47
Parameter(s) specified in the command line:
-m tdl.mod -d tdl.dat -o tdl.sol
Reading model section from tdl.mod...
16 lines were read
Reading data section from tdl.dat...
23 lines were read
Generating pleasure...
Generating afetr_6_pass...
@grauwoelfchen
grauwoelfchen / tdl.sol
Created November 2, 2012 17:33
glpk output
Problem: tdl
Rows: 2
Columns: 10 (10 integer, 10 binary)
Non-zeros: 20
Status: INTEGER OPTIMAL
Objective: wife_s_pleasure = 32 (MAXimum)
No. Row name Activity Lower bound Upper bound
------ ------------ ------------- ------------- -------------
1 wife_s_pleasure
@grauwoelfchen
grauwoelfchen / tdl.dat
Created November 2, 2012 17:32
glpk data file
data;
set attractions :=
attr_0 attr_1 attr_2 attr_3 attr_4
attr_5 attr_6 attr_7 attr_8 attr_9;
param :
fun time :=
attr_0 5 11
attr_1 9 18
@grauwoelfchen
grauwoelfchen / tdl.mod
Created November 2, 2012 17:30
glpk model file
set attractions;
param time{attractions};
param fun{attractions};
param day;
param wait;
var ride{attractions} binary;
maximize wife_s_pleasure:
@grauwoelfchen
grauwoelfchen / gist:3880590
Created October 12, 2012 18:07
touchpad on / off
#!/bin/bash
SYNAPTICS=`which synclient`
if [[ "$SYNAPTICS" == "" ]]; then
echo "synclient does not exist"
exit
fi;
if ! [ "$1" ]; then
@grauwoelfchen
grauwoelfchen / gist:3828451
Created October 3, 2012 17:25
kbdlcd changes keyboard backlight brightness of macbook pro
#!/bin/bash
FILE=/sys/devices/platform/applesmc.768/leds/smc\:\:kbd_backlight/brightness
CURRENT=$(cat $FILE)
NEW=$(($CURRENT$1))
if ! [ $1 ]; then
echo $CURRENT
exit
fi
if [ $NEW -ge 255 ]; then
@grauwoelfchen
grauwoelfchen / gist:3828440
Created October 3, 2012 17:24
lcd changes display brightness of macbook pro
#!/bin/sh
FILE=/sys/class/backlight/apple_backlight/brightness
CURRENT=$(cat $FILE)
if ! [ $1 ]; then
echo $CURRENT
exit
fi
NEW=$(($CURRENT$1))
if [ $NEW -ge 15 ]; then
.SUFFIXES: .erl .beam .yrl
.erl.beam:
erlc -W $<
MODULES = example
all: ${MODULES:%=%.beam} example example_drv.so
example: example.c erl_comm.c example_driver.c
@grauwoelfchen
grauwoelfchen / gist:3777475
Created September 24, 2012 18:26
my lib_chan works ? wrong setting ... ?

Server Gentoo ([email protected])

$ erl -name [email protected] -setcookie test -kernel inet_dist_listen_min 1234 inet_dist_listen_max 1234
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [async-threads:0]

consulting .erlang it "/home/yasuhiro/Documents/workspace/.erlang/code/socket_dist"
Eshell V5.9.1  (abort with ^G)
([email protected])1> kvs:start().
true
@grauwoelfchen
grauwoelfchen / gist:3777013
Created September 24, 2012 16:59
using lib_chan
$ erl
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [async-threads:0]
pwd "/home/yasuhiro/Documents/workspace/.erlang/code/socket_dist"
Eshell V5.9.1 (abort with ^G)
1> kvs:start().
true
2> lib_chan:start_server().
lib_chan starting:"/home/yasuhiro/.erlang_config/lib_chan.conf"
ConfigData=[{port,1234},