Archive for September, 2007

How to set up a DNS server for your home office

Monday, September 24th, 2007

A home office DNS server basically is a full feature DNS server with two specials:

  • It resolve the local domain name which is only used internally, pretty much like: main.home and bedroom.home.
  • For the public domain name, it prefer to be just as a forwarder of your ISP’s DNS.

First, you will install the DNS server software. It is quite easy on Fedora:

yum install bind
yum install bind-chroot
/sbin/chkconfig named on
/sbin/service named start

Then, create a DNS config file under /var/named/chroot/etc :

options {
    directory "/var/named";
    query-source address * port 53;
    allow-query { localnets; };
    forward first;
    forwarders {
        // put your ISP's DNS here.
        // the forward DNS of your router won't work
	64.70.22.12;
    };
};

include "/etc/named.rfc1912.zones";

zone "home" {
    type master;
    file "home.zone";
};

zone "6.168.192.in-addr.arpa" {
    type master;
    file "6.168.192.in-addr.zone";
};

include "/etc/rndc.key";

Then, you will create your local .home domain zone file and its reverse resolve file under /var/named/chroot/var/named.

I give my example here, the main.home (192.168.6.20) is the DNS server of local network, the jeff.home (192.168.6.33) is the work station.

home.zone:

$TTL	3600
$ORIGIN	home.

home.	IN SOA	main root (
	20070924	; Serial
	10800		; Refresh
	3600		; Retry
	604800		; Expire
	86400 )		; Minimum TTL

@	IN NS	main

main	IN A	192.168.6.20
jeff	IN A	192.168.6.33
@	IN A	192.168.6.20

6.168.192.in-addr.zone:

$TTL	3600

6.168.192.in-addr.arpa. IN SOA	main.home root (
	20070924	; Serial
	10800		; Refresh
	3600		; Retry
	604800		; Expire
	86400 )		; Minimum TTL

@	IN NS	main.home.

20	IN PTR	main.home.
33	IN PTR	jeff.home.
  • Share/Bookmark

About video file scale

Monday, September 24th, 2007

It seems like while you want to scale the movie to new resolution, the new resolution has to be multiple of 16, otherwise the scale will be fail.

Also, another problem is most DVD player can not play horizon resolution higher than 800, so it is very important to test and scale down the movies.

I would suggest you convert one minute and try playing back on your DVD player before you do the time consuming convert procedure.

The command might like:

mencoder input.rm -o output.avi
-oac mp3lame
-ovc xvid -xvidencopts bitrate=800
-vf scale=720:480
-endpos 1:00
  • Share/Bookmark

More on video convert

Friday, September 21st, 2007

Convert rm to flv, good for most of video upload website:

mencoder input.rm -o output.flv
-oac mp3lame -lameopts abr:br=56 -srate 22050
-ovc lavc
-lavcopts vcodec=
flv:vbitrate=300:mbd=2:mv0:trell:v4mv:cbp:last_pred=3
-of lavf
-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames
-vf scale=352:288

Convert rm to home threater DVD player playable:

mencoder input.rm -o output.avi
-oac mp3lame -lameopts vbr=2:q=3
-ovc xvid -xvidencopts bitrate=800

Common video resolution:

Profile Resolution
VCD 352×288
Legacy TV 512×384
DVD 720×480
Wide screen TV 624×352
1080P HDTV 1920×1080
  • Share/Bookmark

How to convert rm/rmvb to DVD player friendly format

Monday, September 17th, 2007

Sometimes, we just want to play the real media video on our home theater system. Unfortunately, most of the DVD player won’t recognize rm/rmvb format, so we have to convert it to some other format, like avi file with xvid video encode.

To do this, we can use free tools like mencoder, which is a program comes with mplayer project.

I choose to convert it on Windows platform, since it is easier and likely to be faster for handling rm files.

First, we will download mplayer from: http://www.mplayerhq.hu/design7/dload.html. You should choose the Windows Xming version. Don’t download the GUI version, since it doesn’t come with the mencoder.exe we need.

The installation is quite simple, just unzip it to any place you like. You may want to add it to the PATH environment setting later.

Now, we will download the “windows all” codecs package from: http://www.mplayerhq.hu/MPlayer/releases/codecs/ . Unzip it into your mplayer software’s codecs folder, and copy the drv*.dll files (This is the decoder extracted from real player I believe) into \Windows\system32\.

Now, if you have a rmvb file like: file.rmvb, you can use the following command to convert it to a xvid avi file named file.avi:

mencoder file.rmvb -oac mp3lame -lameopts preset=128 \
    -ovc lavc -lavcopts vcodec=xvid -ofps 25
    -of avi -o file.avi

After that, you can burn it to a cd or dvd and play it on most of the xvid/divx compatible DVD players.

  • Share/Bookmark

Why Chinese words change to ??? after upgraded to WP 2.2

Saturday, September 8th, 2007

I saw a lot of complains about after upgraded to WP 2.2, the display of Chinese display is not correct any more. The reason looks like WP now assume the charset using in database storage is UTF-8, which is usually not true. More over, the scripts of WP creating the database tables will use sweden_ci as default.

So, you have to change the every fields in WP’s database to utf8_unicode_ci to make it handles Chinese characters correctly.

  • Share/Bookmark

What’s Semantic Web

Saturday, September 1st, 2007

Semantic Web is a solution towards better tuning web data into web knowledge. The basic idea behind semantic web is add formal descriptive material to each web page, although it is invisible to human, but would make its content easily understood by computers.

According to W3C’ definition: The Semantic Web is about two things. It is about common formats for integration and combination of data drawn from diverse sources, where on the original Web mainly concentrated on the interchange of documents. It is also about language for recording how the data relates to real world objects.

The approach to semantic web includes two technologies suggested by W3C:

  1.  RDF ( Resource Description Framework ) : It is used to represent information and share knowledge in the Web.  Most famous usages of RDF include RSS Feeds, Apple Podcast, Open Directory Project’s data.
  2. OWL ( Web Ontology Language ) : It is used to publish and share sets of terms called ontologies, supporting advanced Web search, software agents and knowledge management. Again, a example is Open Directory Project’s category information.
  • Share/Bookmark