Wednesday, 26 August 2009

I got an email from TechRepublic and it said that many Web pages are compromised. The compromised webpage includes this code :“script src=http://a0v.org/x.js”.

I use Firefox borwser. If you use Firefox to visit the compromised site (e.g. www.bmcbb3ap.com ), the firefox will display warning.

Monday, 27 July 2009

DeVeDe : from video file to iso

My friend get an avi file and want to watch it using DVD player. He ask me for help. I use DeVeDe to convert the avi file to iso, then burn the iso into DVD disc.

Monday, 13 July 2009

Linux magazine

There are only few Linux magazines : Linux Magazine, Linux Format, Linux Pilot (in Chinese). Here is a newcomer published in India : Linux For You.

Tuesday, 7 July 2009

rsync and Debian Lenny 5.0

This is only a brief introduction to rsync. The backup machine is Debian Lenny and backup my data file in Windows XP client.

There are many rsync backup program for Windows. They usually use tcp connection to talk to backup machine. That means in Linux you have to run rsync as daemon (rsync can copy file in remote shell mode or daemon mode).

In Debian side (as backup machine) :
edit file /etc/default/rsync,
RSYNC_ENABLE=true
so that it run in daemon mode
start rsync daemon
#/etc/init.d/rsync start
This is most simple configure file. Edit file /etc/rsyncd.conf :
[nas]
path=/home/nas
read only = no
The default uid and gid of the directory is nobody and nogroup.

make backup directory
#mkdir /home/nas
change directory owner
#chown nobody.nogroup /home/nas

In Windows XP, I use DeltaCopy as backup software:

- click "add new profile"
Profile Name : dailyBackup
Server IP/Host Name : 192.168.0.1
Virtual Directory Name : nas

click "Add Profile" to finish

- click "Add folder" and select the data folder
- right click dailyBackup, click "Run Now" for test.

Friday, 26 June 2009

Debian upgrade from Etch(4.0) to Lenny (5.0) problem

Debian upgrade is easy, just follow this tutorial.

However something don't work after upgrade :

Apache
Problem : virtual host does not work. After apache start, console will show this message
"Apache Warn NameVirtualHost *:80 Has No VirtualHosts Error When Start".

Reason : the parameter "NameVirtualHost" format is changed. See this.

Solution : edit the file /etc/apache2/ports.conf
default
NameVirtualHost *:80
change to
NameVirtualHost *

restart apache : #/etc/init.d/apache2 restart

Samba
Problem : Windows NT/XP(or above) can connect to samba, but win98 fail.

Reason : some default value is changed from "yes" to "no" (They said that it is for security reason). Read the file /usr/share/doc/samba/NEWS.Debian.gz for detail.

Solution : edit the file /etc/samba/smb.conf and add these two lines under [global] section :
client lanman auth = yes
lanman auth = yes
restart samba : #/etc/init.d/samba restart

Important : If the samba user already exist, you have to create it again :
#smbpasswd -a username

Thursday, 25 June 2009

Linux compress filesystem

Our designer who use Photoshop and Illustrator very often. Her data file usually over 500Mbyte each and we don't backup data. She wants to backup data files regularly and ask me some solution.

Nowadays a hard-drive size is very large(1TB/1.5TB/2TB). It is suitable for her. Since we have some out-dated PC so I want to build a linux backup server for all users in office. I use Debian in office over 5 years and I will use Debin Lenny 5.0 to build the backup server.

My initial plan is use a on-the-fly compress filesystem so that we can keep a few day copies of user data files. After search google, I only found two compress file system : compFUSEd and FuseCompress.

There are many information on internet talk about compFUSEd. This article at linux.com is a good one. Howerver the compFUSEd has not beed updated over a year, I don't know whether it is still alive.

I found FuseCompress in Debian sid and I want to try it. However there is no Lenny package so I have to compile it.

Pre-request
Before compile, the following packages must installed:
- libboost*
- pkg-config
- libmagic-dev
- libfuse2
- liblzo2
- libbz2

Download source code and compile
1. goto the website (http://github.com/tex/fusecompress/tree/master), click the 'download' to get source code.
2. #tar -zxvf tex-fusecompress-55c971535363d7bd7656871b8524a13524818cb3.zip
#cd tex-fusecompress-55c971535363d7bd7656871b8524a13524818cb3
#./configure
#make
#make install

Usage
It is easy to use the cmopress filesystem.

fusecompress device mountpoint
e.g.
#fusecompress /tmp/fc /mnt/fc
That means we read/write files at /mnt/fc directory. The directory /mnt/fc will show actual file size and directory /tmp/fc will show compress size.

If you want to write in same location, add -o nonempty option
e.g.
#fusecompress -o nonempty /tmp/fc /tmp/fc
That mans we read/write files at /tmp/fc directory. The directory will only show actual file size.

For more information, you can type :
#man fusecompress
or just run fusecompress command :
#fusecompress (it will show more options)
Note :
- The default compression method is zlib
- It don't compress photo/video/audio file. If you copy file to compress volume, it just copy and no compression.

Benchmark
Before run the backup server in production, I made a little test. The server is AMD Duron 1G CPU, 256M ram, 40G IDE hard-drive and Debian Lenny 5.0 i386.

I copy 2 files from USB thumb drive to hard-drive and compressd volume (default compression method zlib), run cp command in console(text mode, not in X window). Here is the result :

11M text file :
- to Hard-drive : duration 1 second , file size 11M
- to compress volume : duration 3 second, file size 1.2M

2G photoshop file :
- to Hard-drive : duration 1 mintue, file size 2G
- to compress volume : duration 17 mintues, file size 1.3G

The result is good, it really save hard-drive space. I will run the backup server in office.

Tuesday, 23 June 2009

Linux Distribution

在newsgroup經常有人問:作為 desktop(或server) 應該選擇那個 Linux Distribution ?

其實只要選一些有名氣的Distribution 便可, 例如:Fedora, Ubuntu, openSUSE, Mandriva。至於它們有什麼分別, 現在可不必理會, 反正它們是免費的, 第一個不好用, 轉用第二個, 第二個不好用, 轉用第三個...

初學Linux一定會遇到困難, 我建議買一本書要含Linux CD的,跟著書一步一步做便不會有錯。遇到問題很多人會在網上發問, 但發問也要問得smart, 例如時常有人問:"help, 我的linux不能play mp3 !" 你應該說明你是用那個 distribution 和版本, 例如說 "我是用 fedora 10"。

如果你在問題前加"請問"或問題後加"謝謝", 我相信會有更多人樂意解答。