Donnerstag, 14. Januar 2010

how to read the database of sleep cycle and how to generate the same plots

1) copy the file /var/mobile/Applications/sleep cycle/Documents/eventlog.sqlite
to your pc.
2) use sqlitebrowser to open the file and to extract the data:
ZINTENSITY contains the data
ZTIME contains the time
ZSLEEPSESSION contains the session number (number of night)
-> the time is given in seconds since 1.1.1970
-> example: array=dblarr(2,200)
array(0,*)=ZTIME
array(1,*)=ZINTENSITY
3) for plotting:
->subtract the time of the first element from all times (remove the time offset)
array(0,*)=array(0,0)
->generate an empty array with the same number of elements as you have seconds
arind=fltarr(max(array(0,*)))
->put your data to that positions where the time was recorded.
arind(array(0,*))=array(1,*)
-> plot the data with plot,smooth(smooth(smooth(at,1001),1001),1001)

Mittwoch, 2. Dezember 2009

use mouse gestures in fvwm2/suse

easystroke is a wonderful program that lets you record mouse gestures and executes
commands based on them.
In conjunction with a special definition in .fvwm2rc you can specify any action
to be executed. For example to switch to a special window on the desktop:
in .fvwm2rc:
Key Pause A N FocusWindowNumber 8
-> switches to the window remembered on position 8
PipeRead 'for i in `seq 0 9`; do echo Key $i A MC AssignNumberToCurrentWindow $i; done'
->remembers the window and stores it on position 8

in easystroke define key "Pause" to a gesture of your choice.

If executing that gesture the window 8 is switched to.

Mittwoch, 18. November 2009

tell mplayer which sound device to use

mplayer -ao oss:/dev/dsp *.mp3
mplayer -ao alsa:device=hw=0.0 *.mp3


or

mplayer -ao oss:/dev/dsp1 *.mp3
mplayer -ao alsa:device=hw=1.0 *.mp3

Dienstag, 10. November 2009

wacom bamboo stops working after unplugging

to solve this (to get it working as a graphic tablet again without restarting X) just switch from X11 to Console (press Ctrl + Alt + F1 together then release them) and then switch back to X11 (press Ctrl + Alt + F7 together then release them).
Then the graphic tablet works as before unplugging!

Dienstag, 27. Oktober 2009

Tethering of iPhone 3GS with 3.1.2 and use it as bluetooth modem in linux

1) go to Cydia and install "Enable tethering on 3GS..."
2) go to "Setttings->General->Network->Internet Tethering"
and switch tethering on. Press "Turn on Bluetooth"
3) on your linux machine establish a pairing of the iphone with the pc
in SuSe 11.2 you can do this with bluetooth-applet or bluetooth-wizard
4) on your iphone (with Settings->General->About->Bluetooth) or on your pc
(with "sdptool search DUN") find out the MAC address of your iphone's bluetooth
5) on the pc call "pand -c MACADDRESS -n" where MACADDRESS is the MAC address
discovered in step 4) (something like 00:01:02:03:04:05)
6) Set up your network on YaST2: "Network Devices->Network Settings->Add->Device Type=Bluetooth->
Next->Next->Ok
7) adjust your /etc/resolve.conf to contain
nameserver 81.3.216.100
nameserver 194.24.128.100
search 194.24.128.118

that's it.

Freitag, 11. September 2009

set up firewall to allow only one ip address

iptables -F
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -L -v
iptables -A INPUT -s 111.111.111.111 -j ACCEPT # change the IP address as appropriate
iptables-save
rcSuSEfirewall2 restart

do not forget to start firewall automatically

Samstag, 27. Juni 2009

iphone tunnel suite 2.7 does not work any more with iPhoen firmware 3.0

take i-funbox which is very good: http://www.i-funbox.com/