Easiest way to share a printer hooked up to a linux host

If you have a printer connected to a linux server (as you should) and have linux clients, here is the easiest way to share this printer without mucking too much with details, without mucking with samba.

Software: Fedora Linux 16

On the server:
1) First add its printer as usual, making sure it prints, and make sure “sharing” is selected.
2) Now use sudo system-config-firewall and open a special port, TCP 631 to outside traffic (just go to its second tab, click ADD and use user-specified port option)

On the client:
Adding the printer:
1) find the PPD of the printer, do a “locate ” such as “locate 4300″, where “somestring” is either the full model number of your printer, or something a bit more vague, for example, I found HP 4355′s ppd by trying 3 things: “locate 4355″ then “locate 43xx” then “locate 4300″ note its location.

2) copy from that location to your home directory with a
sudo cp /usr/share/ppd/HP/hp-laserjet_4300-ps.ppd.gz .
(that’s what I did).. Then gunzip this:
gunzip hp-laserjet_4300-ps.ppd.gz

3) now add the printer, changing the local name to something of your liking, IP address (put the IP of the server) and the name of that printer at server, as well as specifying that PPD file you just copied and gunzipped :
lpadmin -p IzmirHP -E -v http://192.168.2.34:631/printers/Officejet-4300-series -P hp-laserjet_4300-ps.ppd
(To find the printer’s name at the server, you can do a sudo cat /etc/cups/printers.conf at the server)
Now restart cups at client, service cups restart

That should do the trick..

Posted in Linux | Leave a comment

Mysql ve UTF-8 Problemleri

Bu konu bir kitap olabilir, ancak son zamanlarda yaşadığım bir problemi anlatayım. Elimde mysql 5 database in alınmış bir yedeği var, ve bunun UTF-8 de alındığını teyit ettim:
# file tum.sql
tum.sql: UTF-8 Unicode English text, with very long lines, with LF, NEL line terminators

PLESK de veri tabanını yarattım, Utf-8 formatında oldugunu teyit ettim, ve database i restore ettim..
#mysql -uadmin -p --one-database Px_commerce < tum.sql

Sonuç hezimet: Harfler patlak ve sorunlu.. Epey araştırmadan sonra çözümü şöyleymiş:

#mysql -uadmin -p --one-database Px_commerce --default-character-set=utf8 < tum.sql

Buradaki --default-character-set komutu, mysql programının mysqld ile görüşme protokolünü belirliyormuş. Latin1 görüşüyorlar demek default - veya swedish?

Posted in Off Off - Turkish | Leave a comment

Mounting your Iphone as a disk

Assuming you are using Fedora (11 in my case) , here is how to mount your iphone as a disk to your computer..

Make sure that SSH is installed and running on your phone, then, as root, do these:

# yum install fuse-sshfs
# mkdir iphone
# sshfs root@10.1.1.150:/ iphone

(where 10.1.1.150 is the wifi address of your iphone). It will ask you for the root password. If you haven’t changed it (If you keep the same default password, you are making yourself vulnerable to viruses), it should be “alpine”.

if your intention was to virus-scan your phone, read on:

How to virus scan your iphone:

Make sure that you have installed clamAV’s clamscan first to your desktop/laptop.. then:

# cd iphone
# clamscan -i --detect-broken=yes --block-encrypted=yes --scan-archive=yes --detect-pua=yes --recursive=yes *

If any of these commands are not found, go into add/remove programs and add them.

PS: It’s a good idea to scan your phone once in a while against rootkits/viruses as I have found many FTP attempts to my phone from China.

Posted in Iphone | Leave a comment