Thursday, February 21, 2008

Using Canon LBP-810 (LBP-1120) in Ubuntu

Printing wint LBP-810/1120 in Linux is not very easy but you can do it.

1. Go to http://software.canon-europe.com/ and download driver for LBP-1120. After unpacking you will see two files: cndrvcups-capt-1.30-1.i386.rpm та cndrvcups-common-1.30-1.i386.rpm.
2. For converting rpm packages to deb you will need alien utility:
sudo apt-get install alien

3. Convert they to deb:
sudo alien *.rpm

4. Now you can install they by double click.
5. Restart CUPS:

sudo /etc/init.d/cupsys stop
sudo /etc/init.d/cupsys start


6. Create necessary directories for ccpd and captmon:

sudo mkdir /var/ccpd
sudo mkdir /var/captmon
sudo mkfifo /var/ccpd/fifo0
sudo chmod 777 /var/ccpd/fifo0


7. Select System -> Administration -> Printing and add the new printer, then select /usr/share/cups/model/CNCUPSLBP1120CAPTJ.ppd and write a model name LBP-1120 CAPT ver.1.3



8. Configure ccpd for work with printer:
sudo /usr/sbin/ccpdadmin -p LBP1120-CAPT-ver.1.3 -o /dev/usb/lp0

As result will be something like that:

CUPS_ConfigPath = /etc/cups/
LOG Path = None
UI Port = 39787

Entry Num : Spooler : Backend : FIFO path : Device Path : Status
----------------------------------------------------------------------------
[0] : LBP1120-CAPT-ver.1.3 : usb : //Canon/LBP-810 : /dev/usb/lp0 : New!!


9. Then you must edit /etc/init.d/ccpd script for Ubuntu/Debian compatibility.
sudo gedit /etc/init.d/ccpd
Replace that file by this text:

#!/bin/sh
#
# ccpdstartup script for Canon Printer Daemon for CUPS
#
#Modified for Debian GNU/Linux
#by Raphael Doursenaud .

DAEMON=/usr/sbin/ccpd
LOCKFILE=/var/lock/subsys/ccpd
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=ccpd
DESC="Canon Printer Daemon for CUPS"

test -f $DAEMON || exit 0

case $1 in
start)
echo -n "Starting $DESC: $NAME"
start-stop-daemon --start --quiet --exec $DAEMON
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
echo "."
;;
status)
echo "$DESC: $NAME:" `pidof $NAME`
;;
restart)
echo -n "Restarting $DESC: $NAME"
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --exec $DAEMON
echo "."
;;
*)
echo "Usage: ccpd {start|stop|status}"
exit 1
;;
esac

exit 0


Test new script:
sudo /etc/init.d/ccpd start

Use this command for launch CAPT monitor
sudo captstatusui -P LBP1120-CAPT-ver.1.3
where LBP1120-CAPT-ver.1.3 is the printer name (you may use other name).



ccpd deamon must start averytime when Ubuntu start. Fot configuring this you csn use Boot-Up Manager (BUM).
sudo apt-get install bum

Then go to System -> Administration -> Boot-Up Manager, launch it and select Canon CAPT Printer Driver for Linux v1.30.



Then you must configure AppArmor (for Gutsy):
sudo aa-complain cupsd

That's all. Now you can use your LBP-810/1120 in Ubuntu.

Tuesday, February 19, 2008

Configuring GRUB in Ubuntu

You can configure GRUB (like menu editing, pause length etc.) with the help of file /boot/grub/menu.lst. But there are a little better method with the help of GUI.

Startup Manager is a graphical tool for configuring GRUB, Ubuntu splashscreen etc.

You can download .deb file from here (62.8Kb):
http://www.getdeb.net/download.php?release=1456&fpos=0
(double click for install)

And now you have a new item StartUp-Manager in the System -> Administration menu.

Monday, February 18, 2008

Running SNES games in Ubuntu

Super Nintendo Entertainment System (SNES) is the legendary game console of 1990s. There are many popular games for it, such as Donkey Kong Country, Killer Instinct, Legend Of Zelda and such hit as Super Mario 2. If you like old games you can play in these games in Ubuntu and ZSNES will help you.
sudo apt-get install zsnes

For launch it use command zsnes, and roms in .smc format you can find in Internet everywhere. Emulator supports all functions of SNES, joisticks, keyboards and multiplayer via network. You can see Super Mario on screenshots.





You can find many games for SNES here:
http://www.emu-land.net/consoles/snes/roms/top

Web-resources about Ubuntu

http://www.ubuntu.com - Official site



http://www.canonical.com/ - Official site of Canonical Inc.



https://launchpad.net/ - the heart of Ubuntu project. Here you can help develop Ubuntu, translate GUI etc.



https://help.ubuntu.com/ - the main resource with documentation. There are official and community documentation.



http://ubuntuforums.org/ - official forum of Ubuntu community. There are answers on huge numbers of any questions.



http://www.getdeb.net/ - software portal for Ubuntu. There many software which are not in official repositories.



http://www.ubuntugames.org/ - resource about games for Ubuntu.



http://planet.ubuntulinux.org/ - official Ubuntu-blog.



http://doc.ubuntu-fr.org/ - French documentation for Ubuntu.



http://art.gnome.org/ - There are many visual themes for Gnome.



http://gnomefiles.org/ - Software archive for Gnome (GTK+ based).



http://www.gnome-look.org/ - Another resource with visual themes for Gnome (also for Beryl and Compiz).

ImageMagick: the great tool for batch image procession

Do you know that you can edit images not only in graphical editors like Gimp (or Photoshop on Windows or Mac) but in command line also. You can say that it is difficult. Maybe. But not for all problems. And batch image procession is that problem.

ImageMagick
The official site: http://www.imagemagick.org/

Installing:
sudo apt-get install imagemagick

ImageMagick is the great tool for editing raster images. For example, you have about 100 images for processing. You must correct colors, correct gamma, increase sharpness, change resolution or format. And maybe you wanna add your logo to other image. Using tradional image editors in that case is very difficult. Because you can press many buttons again and again, it's very very difficult. But ImageMagick will help you.

Well, for example, we create a web-site about great singer Sarah Brightman and wanna upload a photo collection. I have ten images in 1024x768 resolution, I think they be good for it. Change the resolution of these images to 640x480 and add the logo in bottom right corner of each image. Logo is 100x50 image created by GIMP. After this we create black'n'white copy of each image.

There are our original images:



Now create the logo in GIMP and save it in logo.gif with alpha channel:



Create a script im.sh:

#!/bin/sh
for fname in *.jpg; do
mogrify -resize 640 $fname
composite -compose atop -gravity SouthEast logo.gif $fname $fname
convert $fname -colorspace GRAY bw-$fname
done


Make it executable:
chmod +x im.sh
and now we can launch it
./im.sh

Result will be like this:



As you can see each image have the logo in bottom right corner:



You also can use ImageMagick for batch image converting from one format to another. For example you have a folder with about two hundred images in .jpg format, but you wanna convert it to .png. You can use this command:
for fname in *.jpg; do convert $fname ${fname%.jpg}.png; done

That's all.