Saturday, February 23, 2008

ImageMagick: make the photocopies with your digital camera

Digital camera is the excellent device for making photocopies of any documents. In library for example. It is better then scanner because you can use it everywhere. I use Fuji s6550fd and Canon A95. But there is one problem - picture is not so contrast as you want. But you can use ImageMagick correct it and make images like from xerox.

For example I made the image with the help of Fuji s6500fd without flash and on ISO400.



Darkly, right? But we can quickly correct this with the command like that:
mogrify -format tif -monochrome -compress group4 -resize 1252x1800 -normalize -threshold 30% *.jpg

You can modify the -threshold option for change the contrast like you want.

The result will be like that:



Of course you can use it method for bath image processing. You can write the script for this very easy.

There you can find a full information about ImageMagick options:
http://www.imagemagick.org/script/command-line-options.php

Sweet Home 3D: move the furniture in your room

Sweet Home 3D is a great tool for planning design of your room.



You can download it here:
http://sourceforge.net/project/platformdownload.php?group_id=152568

After download you have unpack .tgz to /opt directory for install.

Use your phone as remote control for Ubuntu

If your phone supports Bluetooth you can use it as remote control for your Ubuntu system.

You can use program AnyRemote for this. First, download it from here:
http://sourceforge.net/project/showfiles.php?group_id=162923
You also can download files from here:
anyremote_3.6-2_i386.deb
anyremote-data_3.6-2_i386.deb
anyRemote.jar
ganyremote_2.2-2_i386.deb

Install packages by double clicks. Then upload jar-file to your phone.

You must install pyBluez too:
sudo apt-get install python-bluez

Now you can launch ganyremote and see the icon on the panel. If you click it you can see the window with the programs list. Double click on item which programs you want to control.



After that launch the program on your phone and select Connect. Now your can control selected program from your phone. This is screenshot from Nokia E50:



Any additional information about the project you can find here:
http://anyremote.sourceforge.net/docs.html

Ubuntu 7.10 and Nokia E50

Nokia E50 is based on SymbianOS 9.1 (s60 by third generation). It's an awsome compact smartphone.



Now I tell you how to connect it to Ubuntu for synchronizing contacts and working with files via Bluetooth.

You can copy files to smartphone and from it very easy. You need simply click right mouse button on Bluetooth icon on the panel and select Browse Device. After that you can copy your files with the help of Nautilus file manager. Before this you have install obex packages:

sudo apt-get install obexfs gnome-vfs-obexftp



Then we can configure synchronise contacts on E50 and Evolution.

Add repositories:

deb http://opensync.gforge.punktart.de/repo/opensync-0.21/ feisty main
deb-src http://opensync.gforge.punktart.de/repo/opensync-0.21/ feisty main


Install GPG-key:

gpg --keyserver hkp://subkeys.pgp.net/ --recv-keys CB210090B029CB84
gpg --export CB210090B029CB84 | sudo apt-key add -


Update packages database:
sudo apt-get update

Then install:
sudo aptitude install opensyncutils opensync-plugin-evolution opensync-plugin-syncml multisync-tools multisync0.90 multisync-gui

Useing Multisync-gui (Programs -> Standards) for configure multisync.
1. Add new group: nokia
2. Add plugins Evolution and SyncML over OBEX client



Then configure plugins. You have know the MAC-adress of your smartphone
hcitool scan

Now you can something like that
XX:XX:XX:XX:XX:XX Phone name

Use multisync-gui, go to syncml-obex-client plugin and insert this text in the window:

<config>
<bluetooth_address>XX:XX:XX:XX:XX:XX</bluetooth_address>
<bluetooth_channel>10</bluetooth_channel>
<interface>0</interface>
<identifier>PC Suite</identifier>
<version>1</version>
<wbxml>1</wbxml>
<username></username>
<password></password>
<type>2</type>
<usestringtable>1</usestringtable>
<onlyreplace>0</onlyreplace>
<recvLimit>10000</recvLimit>
<maxObjSize>0</maxObjSize>
<contact_db>Contacts</contact_db>
<calendar_db>Calendar</calendar_db>
<note_db>Notes</note_db>
</config>


Where XX:XX:XX:XX:XX:XX is the MAC-adress of your smartphone.

That's all. Now you can press Update for synchronise.

Canon PIXMA iP1800 and Ubuntu

PIXMA iP1800 is a good cheap inkjet printer. And it work in Ubuntu very well.

1. Connect printer to USB, switch it on, open it and insert cartridges.

2. Now you can see a message in top right coner on your screen. It tell that Canon iP1800 was connected but driver was not found. Press the button for add printer to system and use the standart text driver.

3. Download iP1800 driver
cnijfilter-common_2.70-2_i386.deb
cnijfilter-ip1800series_2.70-2_i386.deb

4. Install packages by double click.

5. Go to System -> Administration -> Printing, select iP1800 and press the Change button.

6. Select /usr/share/cups/model/custom/canonip1800.ppd



7. In the preferences window press Apply.

That's all. Your Canon iP1800 is ready for work.

Converting video for PDA

iRiverter is a good frontend for mencoder. It helps you easy optimize video for your mobile device.

sudo apt-get install iriverter mencoder

Select Jobs -> New -> Single Video and open a file.
Select the device: Device -> iRiver -> PMP Series (for example)
Select the resolution: Device -> Size -> 320x240
You can also change bitrate if you want.
Then press Convert.



After convert you can copy a new file to your memory card and use with mobile device.

Ubuntu and games

Linux is not a really game platform today. It's true. But there are many games too. In this article I will tell about native Linux games (not for emulators).

Sports

Foobillard
Offsite: http://foobillard.sunsite.dk/



The great billard OpenGL game. There are some kinds of game (pool, snooker, etc.). Graphics, phisics and souns are very good. Multiplayer mode is supported to.

Install:
sudo apt-get install foobillard

Tennix
Offsite: http://icculus.org/tennix/



The very easy tennis simulator.

Install:
Download package
http://www.getdeb.net/download.php?release=1529&fpos=0
then install it by double click

Blobby Volley 2
Offsite: http://blobby.redio.de/content/en/index.php



Funny beach volleyball simulator.

Install:
Download package
http://www.ubuntugames.org/BlobbyVolley2?action=AttachFile&do=get&target=blobby_volley-2_i386.deb
then install it by double click.

Slam Soccer 2006
Offsite: http://www.xenoage.com/bp2k6/en/



Football simulator.

Planet Penguin Racer
Offsite: http://tuxracer.sourceforge.net/



Legendary racer arcade for Linux.

Install:
Select Programs -> Add/Remove, go to Games and select Planet Penguin Racer, check and press Apply.

XMoto
Offsite: http://xmoto.tuxfamily.org/



A simple trial simulator.

Install:
sudo apt-get install xmoto

Simulators

Racer
Offsite: http://www.racer.nl/



Car simulator. Excellent graphics and phisics. You can download many cars and tracks from Internet.

TORCS - The Open Racing Car Simulator
Offcite: http://torcs.sourceforge.net/



Racing car simulator. Good phisics and AI. Interesting multiplayer mode.

Install:
sudo apt-get install torcs

vDrift
Offsite: http://vdrift.net/



Another car racing simulator. There are 19 real tracks, such as Spa or Nurburgring for example. There are also 28 cars of different classes. Multiplayer and bots are supported.

Install:
Download from getdeb.net
http://www.getdeb.net/download.php?release=679&fpos=0
http://www.getdeb.net/download.php?release=679&fpos=1
http://www.getdeb.net/download.php?release=679&fpos=2
then install and play.

ManiaDrive
Offsite: http://maniadrive.raydium.org/



Arcade racing game on the acrobatics tracks.

Install:
Download from getdeb.net
http://www.getdeb.net/download.php?release=705&fpos=0
http://www.getdeb.net/download.php?release=705&fpos=1

Targetware
Offsite: http://www.targetware.net/



The open flight sim platform.

FlightGear
Offcite: http://www.flightgear.org/



Awsome flight sim. There are a huge collection of airplanes and real Earth terrains.

Install:
sudo apt-get install flightgear

3D shooters

OpenArena
Offsite: http://openarena.ws/



The open Quake III Arena clone.

Install:
sudo apt-get install openarena

Tremulous
Offsite: http://www.tremulous.net/



Multiplayer shooter. Bots are not supported.

Install:
sudo apt-get install tremulous

Cube 2: Sauerbraten
Offsite: http://sauerbraten.org/



Yet another shooter with good graphics.

Install:
Download from getdeb.net
http://www.getdeb.net/download.php?release=1320&fpos=0
http://www.getdeb.net/download.php?release=1320&fpos=1
http://www.getdeb.net/download.php?release=1320&fpos=2

Strategies

Battle for Wesnoth
Offsite: http://www.wesnoth.org/



Maybe the best strategy for Linux.

Install:
sudo apt-get install wesnoth

FreeCol
Offsite: http://www.freecol.org/



The open Colonization clone.

Install:
Download from getdeb.net
http://www.getdeb.net/download.php?release=1391&fpos=0

Glest
Offsite: http://www.glest.org/en/index.html



Realtime strategy.

Install:
Download from getdeb.net
http://www.getdeb.net/download.php?release=1061&fpos=0
http://www.getdeb.net/download.php?release=1061&fpos=1

OpenTTD
Offsite: http://www.openttd.org/



The open Transport Tycoon Deluxe clone.

Install:
Download from
http://downloads.sourceforge.net/openttd/openttd-0.5.3-1-i386.deb

Adventures

Secret Maryo Chronicles
Offsite: http://www.secretmaryo.org/



Do you remember the great game series from Nintendo? Now you look this on Linux.

Install:
Download from getdeb.net
http://www.getdeb.net/download.php?release=1263&fpos=0
http://www.getdeb.net/download.php?release=1263&fpos=1

Pingus
Offsite: http://pingus.seul.org/



The Lemmings idea based game. 22 levels included.

Install:
sudo apt-get install pingus

Sites about games for Linux%
http://www.ubuntugames.org/
http://www.linuxgames.com/
http://www.happypenguin.org/
http://www.linuxgames.ru/

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.