Monday, June 30, 2008

use shell variables in sed


input=abc.wav
i=0
while test $i != 10
do
echo "run case $i
tag=`expr output-foo-$i`
output=`echo $input | sed -e "s/^\(.*\)\.wav$/\1-$tag\.wav"`
./foo.bin -v -e -E $i -o $output $input
done


Here instead of

sed -e 's/^\(.*\)\.wav$/\1-$tag\.wav'


Use


sed -e "s/^\(.*\)\.wav$/\1-$tag\.wav"

Friday, June 20, 2008

Set up for recording audio with Windows

Here is some set up for recording audio.

0. Use blue line-in jack and green line-out jack

1. Set playback control, especially Volume Control, Wave and Line In, it is ok to mute CDPlayer, PC Beep or SW Synth.


2. Set recording control, select "WaveOut Mix", then we are ready to go.

Tuesday, June 17, 2008

nfs client

I got an error when mount NFS disks with my OMAP linux box.

rpcbind: server localhost not responding, timed out
RPC: failed to contact local rpcbind server (errno 5).


Here is the result. (The reason is I don't have portmap running in the box)

mount -t nfs -o nolock 192.168.0.9:/tmp /mnt/mmc


And then, I got another panic message, when I run a program.

nfs: server 192.168.0.9 not responding, still trying


Here is the result.

mount -t nfs 192.168.0.9:/tmp /mnt/mmc -o nolock,hard,rsize=1024,wsize=1024

Monday, June 16, 2008

setup dhcp, nfs on FC5

setup dhcp server
I need to setup dhcp server under my router.
Here is the configuration file (/etc/dhcpd.conf)


ddns-updates on;
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.1;
option subnet-mask 255.255.255.0;
option domain-name "local.net";
option domain-name-servers ns.local.net;
host trgt {
hardware ethernet 08:00:28:01:15:F7;
fixed-address 192.168.2.110;
option root-path "/opt/eldk/ppc_8xx";
option host-name "trgt";
next-server 192.168.2.151;
filename "tftpboot/pImage";
}
}
ddns-update-style ad-hoc;

Here "trgt" is a linux device which has fixed ip address, and need boot image through NFS from linux host with ip "192.168.2.151".

Start dhcp-server with: `/etc/rc.d/init.d/dhcpd start`

Setup nfs

Edit /etc/exports

/tftp 192.168.2.110(rw,no_root_squash,sync)


Edit /etc/hosts.allow

portmap: 10.10.10.20
lockd: 10.10.10.20
mountd: 10.10.10.20
rquotad: 10.10.10.20
statd: 10.10.10.20


And edit /etc/hosts.deny

portmap: ALL
lockd: ALL
mountd: ALL
statd: ALL



run: `exportfs -ra`




scripts on start nfs

/etc/init.d/portmap start
/etc/init.d/nfslock start
/etc/init.d/nfs start
/etc/init.d/netnfs start


Check nfs status with: `/sbin/service nfs status`

rpc.mountd (pid 4181) is running...
nfsd (pid 4183 4182 4181 4180) is running
rpc.rquotead (pid 4170) is running


You may need to "/sbin/service iptables stop" sometimes if you can the ip but can not mount while getting "no route and host" message.

Tuesday, June 10, 2008

use cu

1. install uucp "sudo apt-get install uucp"
2. edit /etc/uucp/sys

system S0@115200
port serial0_115200
time any

3. edit /etc/uucp/port to add serial0_115200

port serial0_115200
type direct
device /dev/ttyS0
speed 115200
hardflow false

4. Add serial port to VM, otherwise it will not show up.
5. run `cu S0@115200` and get a response "Connected."
To terminate, type `~.`