Tip: New file from commandline
May 24, 2009
$ cat > filename << "EOF" > First line of file > second line > EOF $ cat filename First line of file second line
I love it!
3COM 3CRWE154G72 wireless PCMCIA on Linux
May 23, 2009
Finally got time to install my 3COM wireless 3CRWE154G72 PCMCIA card. And it worked!
Two easy steps.
- You need the kernel module p54pci
- You need the firmware for the pcmcia card.
The kernel module should be present in the linux kernel >=2.6.24. If not, you need to compile it. It is also important to download the correct firmware based upon the kernel version. Further instructions can be found here: http://wiki.debian.org/prism54#p54pci.
Under Slitaz 2.6.25-5, it was a matter of running:
# wget -O /lib/firmware/isl3886 http://daemonizer.de/prism54/prism54-fw/fw-softmac/lmac_2.7.0.0.arm # tazhw detect-pci
Now run the wireless tool and connect!
Slitaz: setup Canon LBP2900
May 21, 2009
After some struggle, I finally managed to set up my Slitaz 2.0 to print on my Canon LBP2900.
The most important lesson I learned, was to check for kernel modules! Slitaz has a very good hardware detection software, but it did not reckognize my usb printer. So, first step is to load the module. If you don’t do this, the device mount point won’t be created by udev.
# modprobe usblp
Connects printer with usb and issue (lsusb is not available yet in Slitaz):
# cat /proc/bus/usb/devices
Verify that /dev/usblp0 or /dev/usb/lp0
has been created. This is your device, and ensures that udev is working. The number may vary if you have several printers connected.
Unfortunately, the driver Canon offer demands an EULA. Current version (today) is v1.8. Go their website and accept the license and download (external link to canon).
Read their manual – it’s actually correct.
The downloaded package needs to be un-tar’d. It contains both .deb and .rpm packages. They should pretty much be equal, so use the one that fits your system the best. Slitaz has its own packagemanager which does not nativily support neither of the two formats. However, both deb and rpm should be supported for installation by dpkg and rpm respectively. I used the rpm packa
ges.
So – the real kicker! Do this – don’t hesitate! The hints are picked up from several forums and own knowledge.
# tazpkg get-install cups
Verify that it works by browsing: http://localhost:631. I created a little script for the rest.
#!/bin/sh #Install Canon LBP2900 on Slitaz #rpm -i common #rpm -i capt echo -n "add usblp as a module on boot" echo -n "add cupsd and ccpd as a daemon at boot" modprobe usblp /etc/init.d/cupsd stop /etc/init.d/cupsd start PNAME=canon PPDFILE=CNCUPSLBP2900CAPTK.ppd mkdir /usr/share/ppd cd /usr/share/cups/model chmod 555 -R /usr/share/cups/model # modified from chmod a+rX $PPDFILE cp /usr/share/cups/model/$PPDFILE /usr/share/ppd/ # this should not be necessary mkdir /var/ccpd mkdir /var/captmon mkfifo /var/ccpd/fifo0 chmod 777 /var/ccpd/fifo0 lpadmin -p $PNAME -m $PPDFILE -v cpp:/var/ccpd/fifo0 -E -u allow:tux,root ccpdadmin -p $PNAME -o /dev/usb/lp0 /etc/init.d/ccpd start
Note the -u allow:tux,root. This can be modified later in cups.
You can also monitor the printer. It is also a good way of checking that everything is in order. I got several error messages which needed to addressed. Restarting the ccpd daemon is sometimes necessary.
# /usr/local/ccpd/captstatusui -P canon
Find modified files
May 12, 2009
I sometimes want to find the files that have been modified by my last user action. I found a cool way of doing this. I picked it up somewhere – but I have already forgotten where …
Anyway – when I want to monitor what’s being done – I create a reference file:
$ touch /tmp/now
Then do the user action – and check for files being modified with:
$ find . -nwer /tmp/now > dump
Sweet!
Sharing sound with ALSA
May 10, 2009
Whenever I watched something on youtube, or any other Flash that required sound I first had to stop mpd from playing. But to listen to MPD again, I had to close down Firefox because it occupied my sound device. MPD would simply not play. I never got around to fixing this, until now. And the solution is very simple!
There is a built in mixer in ALSA. It should automatically allow different processes to share the same sound device by mixing the sound with the plugin dmix. But – this did not work out of the box for me.
First, I discovered, that I did not have any configuration file! Strange, so I created one:
# touch /etc/asound.conf
# nano /etc/asound.conf
/etc/asound.conf
pcm.!default {
type plug
slave.pcm "lyd"
}
pcm.lyd {
type dmix
ipc_key 1234
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}
It should not matter much what you call the mixer – the important thing is to activate the “type dmix”. [translation lyd=sound (no=en)].
Now, I modified my mpd.conf to use this mixer.
/etc/mpd.conf
audio_output {
type "alsa"
name "lyd"
options "dev=lyd"
}
I now am able to listen to the flash sound while mpd is still playing