Tuesday, July 08, 2008

Canon iP1600 on Kubuntu

Note: This manual also works for the following printers: Canon IP1600 using the IP2200 drivers.

This does not work for AMD64.

Installation

Note: You will have to accept Canon's license agreement to download the software.

1. Connect your printer, and start Ubuntu.

2. Install the needed packages: alien, libxml1, libpng12-0, libpng12-dev, libgtk1.2 and libgtk1.2-common with Synaptic or type: {{{sudo apt-get update sudo apt-get install alien libxml1 libpng12-0 libpng12-dev libgtk1.2 libgtk1.2-common}}}


3. Download the drivers for your printer from Canon. For the purposes of this howto, we will assume that the files are saved to the directory /home/yourname/canon.

The iP2200 drivers are here: http://software.canon-europe.com/software/0024301.asp or type in a terminal {{{mkdir canon cd canon wget http://software.canon-europe.com/files/soft24301/software/iP2200_Linux_260.tar.gz }}}

4. Extract the files with archive manager or type {{{tar -xvzf iP2200_Linux_260.tar.gz }}}

5. Convert the RPM packages to Debian packages: {{{sudo alien cnijfilter-common-2.60-1.i386.rpm cnijfilter-ip2200-2.60-1.i386.rpm }}}

6. Install the packages:

>>> revision : sudo aptitude remove libcnbj-2.6 (only if you have an experience with ip2200 driver)

sudo dpkg -i *.deb

7. Make sure the library links are correct. /usr/lib/libtiff.so.3 should point to /usr/lib/libtiff.so.4 (or to the same thing as /usr/lib/libtiff.so.4 points to) If not, type: {{{sudo ln -s /usr/lib/libtiff.so.4 /usr/lib/libtiff.so.3 }}} This is the important part! The iP2200 driver wants to use libtiff.so.3, but that is an old version. We fix this by making libtiff.so.3 a link to libtiff.so.4.

Also, /usr/lib/libpng.so.3 should point to /usr/lib/libpng.so If not, type: {{{sudo ln -s /usr/lib/libpng.so /usr/lib/libpng.so.3 }}}

and /usr/lib/libxml2.so.2 should point to /usr/lib/libxml.so.1 If not, type: {{{sudo ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml.so.1 }}}

And finally make the loader aware of the changes: {{{sudo ldconfig }}}

8. Restart cups: {{{sudo /etc/init.d/cupsys restart }}}

9. Add a new printer. Under GNOME, this is accessed in System|Preferences|Printing. Select Canon as the manufacturer, click on "Install Driver..." and select /usr/share/cups/model/canonip2200.ppd. Now select "iP2200 Ver.2.60" under "Model". Select "Standard" for the driver (this should be the only option). Make sure the connection is correct. Hopefully, printing a test page will work!

Advanced Features

Unfortunately, the installed PPD file doesn't allow you to select the printing quality. To fix this, back up your ppd file, then open it as root: gksudo gedit /etc/cups/ppd/iP2200-Ver.2.60.ppd

Insert these lines in the file after the "Resolution" section:

*OpenUI *CNQuality/Quality: PickOne
*DefaultCNQuality: 3
*CNQuality 2/High: "2"
*CNQuality 3/Normal: "3"
*CNQuality 4/Standard: "4"
*CNQuality 5/Economy: "5"
*CloseUI: *CNQuality

The following gives a greater choice of print resolution if added to the "Resolution" section, but I am not clear whether the Quality setting impinges upon this. Note that the ip2200 only offers 600dpi in black and white.

*Resolution 1200/1200 dpi: "<>setpagedevice"
*Resolution 2400/2400 dpi: "<>setpagedevice"
*Resolution 4800/4800 dpi: "<>setpagedevice"

(from http://gentoo-wiki.com/Canon_Pixma_Series)

N.b. neither of these modifications is done in the unofficial packages provided by: http://mambo.kuhp.kyoto-u.ac.jp/~takushi/

After this, restarting cups should enable the changes sudo /etc/init.d/cupsys restart

To perform maintenance on the printer, such as head cleaning, type in a terminal: cngpij -P iP2200-Ver.2.60

You may want to add this to your menu, since it is a real pain to remember. In the window that pops up, select "Maintenance".

Thursday, May 08, 2008

OBSD Router part 1

Seminggu yg lalu aq dapet assignment buat bikin router berbasis OpenBSD. Alasannya? Karena menurut situs resminya (www.openbsd.org), nih OS bener-bener mengutamakan keamanan diatas segalanya. Konsekuensinya ada banyak pekerjaan yang harus dilakukan untuk membuat OS ini berjalan sesuai dengan keinginan kita.

Selain itu nie OS lumayan ringan, karena memang tidak banyak fitur yang disertakan dalam source instalasi standarnya.

Setelah muter-muter di sekitar materi tentang pembuatan router berbasis OpenBSD, ada beberapa pilihan yang tersedia. Dua aplikasi terpopuler diantaranya adalah menggunakan PF (packet filtering) dan Quagga. Aq memilih menggunakan PF karena memang merupakan sudah teruji menurut situs resminya, bahkan hasil benchmarking yg pernah dilakukan oleh pembuatnya dapat mengalahkan kemampuan PF yang ada di kernel sodaranya, si Linux.

Persiapan awal adalah mendownload source .iso OpenBSD 4.2, burning .iso tersebut, lalu instalasi deh (tahap-tahap instalasi yang lumayan bagus bisa dilihat di situs resminya si OBSD.

Langkah berikutnya setelah instalasi adalah meng-konfigurasi OpenBSD menjadi sebuah Router melalui menggunakan kemampuan "packet filtering"-nya (PF).

Setelah login, edit file : /etc/rc.conf.local kemudian, tambahkan baris berikut pada file tersebut :

pf=YES

Setelah itu, restart server.

Setelah itu, login, edit file /etc/pf.conf . Routing akan terjadi berdasarkan isi file ini. Jadi keberhasilan dari routing akan ditentukan pada bagaimana konfigurasi tersebut terbentuk. berikut ini adalah contoh sederhana sebuah routing pada pf.conf

Secara garis besar, PF memiliki 7 (tujuh) bagian utama, yaitu:
  1. Macros
  2. Tables
  3. Options
  4. Scrub
  5. Queueing
  6. Translation
  7. Filter Rules
Berikut ini penjelasan dari masing masing bagian :
  1. Macros
    Merupakan variabel yang diberikan oleh user, misalnya variabel nama interface yang akan digunakan, nomor port, nomor IP, dll. penggunaan macros sebenarnya adalah untuk mengurangi kompleksitas konfigurasi, sehingga perubahan hanya perlu dilakukan satu kali saat sebuah variabel digunakan berkali-kali dalam konfigurasi.
  2. Tables
    Digunakan untuk mengelompokkan alamat-alamat berdasarkan konvensi tertentu, sesuai dengan kebutuhan, desain, dan struktur yang diinginkan.
  3. Options
    Digunakan untuk kebutuhan mengontrol operasional PF. Misalnya, dimana tempat meletakkan log, atau sedalam apa PF akan di- debug (debugging level), dll.
  4. Scrub
    Digunakan untuk menormalisasikan semua paket yang melintasi router sehingga tidak jadi ambiguitas dalam interpretasi.
  5. Queueing
    Digunakan untuk menciptakan "ruang tunggu" untuk paket yang sedang antri untuk diproses.
  6. Translation
    Digunakan untuk mentranslasikan alamat IP dari dalam keluar dan dari luar ke dalam sehingga host yang ada di-luar, tidak perlu mengetahui alamat yang ada didalam. Hal ini biasa disebut NAT.
  7. Filter Rules
    Nah.. bagian inilah yang berfungsi me-routing paket paket data sesuai dengan aturan yang di-inginkan, apakah sebuah paket akan di-passing atau di-blocking.
Berikut ini merupakan sebuah contoh pf.conf yang sederhana, berikut penjelasannya

##--------------------> di-sadur dari www.thedeepsky.com
## Macros
SYN_ONLY="S/FSRA"
EXT_NIC="fxp0"
INT_NIC="fxp1"

# Your Internet IP goes in the EXT_IP variable
EXT_IP="11.22.33.44"

# Your private network IP goes in the INT_IP variable
# if you have two NICs on the machine
INT_IP="192.168.1.1"

## TABLES


## GLOBAL OPTIONS


## TRAFFIC NORMALIZATION


## QUEUEING RULES


## TRANSLATION RULES (NAT)


## FILTER RULES

# Block everything (inbound AND outbound on ALL interfaces) by default (catch-all)
block all

# Default TCP policy
block return-rst in log on $EXT_NIC proto TCP all
  pass in log quick on $EXT_NIC proto TCP from any to $EXT_IP port 22 flags $SYN_ONLY keep state
  pass in log quick on $EXT_NIC proto TCP from any to $EXT_IP port 113 flags $SYN_ONLY keep state

# Default UDP policy
block in log on $EXT_NIC proto udp all
  # It's rare to be hosting a service that requires UDP (unless you are hosting
  # a dns server for example), so there typically won't be any entries here.

# Default ICMP policy
block in log on $EXT_NIC proto icmp all
  pass in log quick on $EXT_NIC proto icmp from any to $EXT_IP echoreq keep state

block out log on $EXT_NIC all
  pass out log quick on $EXT_NIC from $EXT_IP to any keep state

# Allow the local interface to talk unrestricted
pass in quick on lo0 all
pass out quick on lo0 all