11/12/08

monitor your filesystem events with inotify-tools

I looking for the way to mirror files on my server to others when something're updated and found that inotify is a good idea in this case.
Thanks for inotify-tools project, c library and set of command line programs for linux provide interface to inotify, that let me avoid from c code.

On ibex, i get it by..

pnix@pnix-a7n:~$ sudo aptitude install inotify-tools
[sudo] password for pnix:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following NEW packages will be installed:
inotify-tools libinotifytools0{a}
0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 39.0kB of archives. After unpacking 201kB will be used.
Do you want to continue? [Y/n/?] y
...
Writing extended state information... Done

pnix@pnix-a7n:~$

Below is example shell script i use to moniter and update file to remote host.
#!/bin/bash
while inotifywait -rq -e close_write /folder_to_moniter; do
rsync -av /folder_to_moniter -e "ssh -l pnix" pnix@remotehost:/home/pnix/tmp
done

for Java api look here

11/1/08

Many sound problems on Intrepid ibex

I upgrade two ibex last night and found few sound problems below

First, on video file(mpg,avi ..), when right click and choose >open with >mplayer. will bring up error " [AO_ALSA] Unable to find simple control 'PCM',0 ".
I'm not sure what it is, maybe the config just is not right but I fix this by right click on movie window-> preference then on audio tab, select 'Enable Software Mixer'. [or you can do this by change 'softvol = "no"' to 'softvol = "yes"' in $HOME/.mplayer/gui.conf]

Another sound issue is flash player on web[like youtube] not play sound. /var/log/message said

pnix@pnix-a7n:_NHDT392$ tail -f /var/log/messages
...
Nov 2 00:33:14 pnix-a7n -- MARK --
Nov 2 00:40:51 pnix-a7n pulseaudio[23941]: sink-input.c: Failed to create sink input: too many inputs per sink.
Nov 2 00:40:51 pnix-a7n last message repeated 31 times
Nov 2 00:40:51 pnix-a7n pulseaudio[23941]: protocol-native.c: Warning! Too many connections (64), dropping incoming connection.
and after run flash, no sound from other application too. I saw bug report for this issue on lunchpad here but no solution for me. I have to kill and restart pulseaudio like this to get sound back.
pnix@pnix-a7n:~$ pulseaudio -k
W: ltdl-bind-now.c: Failed to find original dlopen loader.
pnix@pnix-a7n:~$ ps aux|grep pulseaudio
pnix 2510 0.0 0.0 3236 796 pts/0 S+ 04:14 0:00 grep pulseaudio
pnix@pnix-a7n:~$ pulseaudio -D
W: ltdl-bind-now.c: Failed to find original dlopen loader.
pnix@pnix-a7n:~$ ps aux|grep pulseaudio
pnix 2513 3.0 0.3 28952 3952 ? Ssl 04:14 0:00 pulseaudio -D
pnix 2516 0.0 0.2 7528 2516 ? S 04:14 0:00 /usr/lib/pulseaudio/pulse/gconf-helper
pnix 2518 0.0 0.0 3236 792 pts/0 S+ 04:14 0:00 grep pulseaudio
pnix@pnix-a7n:~$