I got one more PC and am going to install Fedora 6 on it. Some software like Intel VTune doesn't support Fedora 4, neither Debian.
There is a good tutorial about FC6 installation http://www.mjmwired.net/resources/mjm-fedora-fc6.html while Stanley has tutorial for FC5. Don't forget official FC6 release notes http://docs.fedoraproject.org/release-notes/fc6/en_US/. It contains lots of useful stuff. The bug report is also worthy to read http://fedoraproject.org/wiki/Bugs/FC6Common, especially because FC6 installation program can't decide the right processor in some cases.
release notes
There are a few performance enhancement in this release, like DT GNU HASH for dynamic linking applications, ext3 performance boost and cacheFS for NFS as part of cacheFS program.
There is no difference between UP and SMP version. It supports POSIX priority inheriting and protecting mutex.
installation
I use automatic partitioning and select all three package options, Office and Productivity, Development and Web server. Fedora extra and individual package are not selected. After one hour, FC6 is ready. The Helix spiral desktop looks pretty good.
The next step is to customize packages. I follow the suggestion of mjmwired. There is an automatic updater running after installation. It has to be stopped because it locks the database. Use sudo /etc/init.d/yun-updated stop and then reconfigure packages.
I need to be patient during that as it's very slow. If I select a package group and de-select, the computer stops to response. The system monitor shows that it's running at almost 100% load. The other thing is that it's better to login as root instead of maintenance user account if you want to reconfigure packages.
The next step is to check if installation program know the right processor type. There is detailed instructions in FC6 bug report. Basically I use rpm -qa 'kernel*' --queryformat "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n"|sort and see if the kernel type is i686 in my case.
After all, use yum update to update all packages. The kernel is updated from 2.6.18-2798 to 2.6.22-5. However both kernel images are there. You can choose during boot up.
Kernel build
Kernel source has to be installed manually after installation because it's not included. For most of cases, like add-on modules, kernel header is enough. Just use yum install kernel-devel. However in my case, there is also kernel-header package for 2.6.22. I don't know where it comes from.
To install kernel source, first you need download a tool, yumdownloader. Then use rpm to install. Next to prepare source because the Fedora core is different to Vanilla core. The last step is build and install.
1. install the tool, yumdownloader. yum install yum-utils
2. yumdownloader --source kernel --enablerepo updates-source. A rpm file is downloaded to current dir.
3. rpm -Uvh kernel-2.6.18-1.2798.fc6.src.rpm. Ignore errors about non-existent user and group.
4. Prepare the source code to apply Fedora patch.
cd /usr/src/redhat/SPECS
rpmbuild -bp --target i686 kernel-2.6.spec
5. Move source code as Linux convention
cd /usr/src/redhat/BUILD/kernel-2.6.17
mv linux-2.6.17.i686 /usr/src/
cd /usr/src
ln -s ./linux-2.6.17.i686 linux
cd /usr/src/linux
6. Get the right config file. I use i686 one. There is no difference between UP and SMP for FC6.
cp config/kernel.i686.config .config
7. Build kernel.
make oldconfig
make menuconfig
make all
make modules_install
make install
8. reboot, use uname -a to see if new kernel works.
The EXTRAVERSION define in Makefile is used to differentiate the one just build and the one downloaded. It's set to 'prep' by default. The kernel build as prep as a suffix.
Saturday, September 15, 2007
Saturday, March 31, 2007
Automatic backup script in Perl
An automatic backup script is a very handy tool so I can "forget" the backup task everyday. It's also an exercise after I read Perl tutorial. Now, it's scheduled and run everyday via crontab on my Linux server at home.
Basically it's a lightweight backup tool. First it archive files to backup. Then it compares to last backup archive. If it's different, the archive is ftped to a remote server. A brief log and a detailed log are generated meanwhile.
It works pretty well and stable. The source code is shown as following.
#!/usr/bin/perl
use strict;
use warnings;
my ($logdir, $log, $detailedlogdir, $detailedlog, $lastsuccessfilename);
my ($targetdir, $target, $targetprefix, $targetnameonly);
my $cbserver;
my @source;
my ($timeforfilename, $timestring);
sub get_timestring {
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdat);
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdat) = localtime;
$year+=1900;
$mon = sprintf("%02d", $mon+1);
$mday = sprintf("%02d", $mday);
$timeforfilename = $year.$mon.$mday;
return $year."/".$mon."/".$mday."-".$hour.":".$min.":".$sec;
}
sub print_usage {
print "usage: squarrel daily|weekly|monthly\n";
}
sub get_argv {
if ($#ARGV!=0) {
&print_usage;
exit;
}
if ($ARGV[0] eq "daily") {
@source="..."; # file or directories to backup on daily base.
} elsif ($ARGV[0] eq "weekly") {
@source="..."; # file or directories to backup on weekly base.
} elsif ($ARGV[0] eq "monthly") {
@source="..."; # file or directories to backup on monthly base.
} else {
&print_usage;
exit;
}
$targetprefix=$ARGV[0];
}
sub init {
$logdir = "/var/www/html"; # log is written in httpd directory so I can check it via browser
$log = "$logdir"."/emc.log";
$detailedlogdir = "/home/emc";
$detailedlog = "$detailedlogdir"."/emcdetailed.log";
if (-e $log) {
open LOGFILE, ">> $log" or die $!;
} else {
open LOGFILE, "> $log" or die $!;
}
if (-e $detailedlog) {
open DETAILEDLOG, ">> $detailedlog" or die $!;
} else {
open DETAILEDLOG, "> $detailedlog" or die $!;
}
print LOGFILE "----------------------------------------------------\n";
print DETAILEDLOG "----------------------------------------------------\n";
$timestring = &get_timestring;
print LOGFILE "$timestring backup($targetprefix) starts\n";
print DETAILEDLOG "$timestring backup($targetprefix) starts\n";
$targetdir = "/home/bt/crossbackup";
# $targetnameonly = "backup".$timeforfilename.".tar.bz2";
$targetnameonly=$targetprefix.$timeforfilename.".tar.bz2";
$target = "$targetdir/".$targetnameonly;
$lastsuccessfilename = "$detailedlogdir"."/lastsuccess_".$targetprefix;
$cbserver = "..."; # remote server address
}
sub archive {
my ($archivecmd, $result);
$archivecmd = "tar cvfj $target @source";
$timestring = &get_timestring;
print LOGFILE "$timestring $archivecmd\n";
print DETAILEDLOG "$timestring $archivecmd\n";
system("$archivecmd >>$detailedlog 2>> $detailedlog");
$result = $?;
$timestring = &get_timestring;
if ($result == 0) {
print LOGFILE "$timestring archiving finish successfully\n";
print DETAILEDLOG "$timestring archiving finish successfully\n";
} else {
print LOGFILE "$timestring archiving fail $result\n";
print DETAILEDLOG "$timestring archiving fail $result\n";
}
return $result;
}
sub check_identical {
my $lastsuccesstarget;
my $different;
if (-e $lastsuccessfilename) {
open LASTSUCCESS, "$lastsuccessfilename" or die "Write $lastsuccessfilename";
$lastsuccesstarget=;
chop($lastsuccesstarget);
close LASTSUCCESS;
$timestring = &get_timestring;
print LOGFILE "$timestring compare $target $lastsuccesstarget\n";
print DETAILEDLOG "$timestring compare $target $lastsuccesstarget\n";
system("diff -q $lastsuccesstarget $target >> $detailedlog 2>> $detailedlog");
if ($?) {
$timestring = &get_timestring;
print LOGFILE "$timestring $target is different to $lastsuccesstarget\n";
print DETAILEDLOG "$timestring $target is different $lastsuccesstarget\n";
return 1;
} else {
$timestring = &get_timestring;
print LOGFILE "$timestring $target is identical to $lastsuccesstarget\n";
print DETAILEDLOG "$timestring $target is identical to $lastsuccesstarget\n";
system("rm -f $lastsuccesstarget\n");
$timestring = &get_timestring;
print LOGFILE "$timestring remove $lastsuccesstarget\n";
print DETAILEDLOG "$timestring remove $lastsuccesstarget\n";
return 0;
}
} else {
return 1;
}
}
sub ftp_upload {
my $ftpcmd;
my $result;
$ftpcmd = '"user username password\nbinary\nput '.$target.' '.$targetnameonly.'\nquit\n"';
$timestring = &get_timestring;
print LOGFILE "$timestring ftp -v -d $cbserver <<$ftpcmd\n"; print DETAILEDLOG "$timestring ftp -v -d $cbserver <<$ftpcmd\n"; system("echo -e $ftpcmd | ftp -v -d $cbserver>> $log 2>> $log");
$result=$?;
$timestring = &get_timestring;
if ($result == 0) {
print LOGFILE "$timestring uploading finish successfully\n";
print DETAILEDLOG "$timestring uploading finish successfully\n";
} else {
print LOGFILE "$timestring uploading fail $result\n";
print DETAILEDLOG "$timestring uploading fail $result\n";
}
return $result;
}
sub done {
my ($result, $stage) = @_;
$timestring = &get_timestring;
if ($result == 0) {
open LASTSUCCESS, ">$lastsuccessfilename" or die "Write $lastsuccessfilename";
print LOGFILE "$timestring backup($targetnameonly) succeed\n";
print DETAILEDLOG "$timestring backup($targetnameonly) succeed\n";
print LASTSUCCESS "$target\n";
close LASTSUCCESS;
} else {
print LOGFILE "$timestring backup($targetnameonly) failed in stage $stage\n";
print DETAILEDLOG "$timestring backup($targetnameonly) failed in stage $stage\n";
}
close LOGFILE;
close DETAILEDLOG;
}
my $result;
&get_argv;
&init;
$result = &archive;
if ($result) {
&done(1, "archive");
exit (1);
}
$result = &check_identical;
if ($result==0) {
&done(0, "");
exit(0);
}
$result = &ftp_upload;
if ($result) {
&done(2, "upload");
exit (2);
}
&done(0, "");
exit(0);
Basically it's a lightweight backup tool. First it archive files to backup. Then it compares to last backup archive. If it's different, the archive is ftped to a remote server. A brief log and a detailed log are generated meanwhile.
It works pretty well and stable. The source code is shown as following.
#!/usr/bin/perl
use strict;
use warnings;
my ($logdir, $log, $detailedlogdir, $detailedlog, $lastsuccessfilename);
my ($targetdir, $target, $targetprefix, $targetnameonly);
my $cbserver;
my @source;
my ($timeforfilename, $timestring);
sub get_timestring {
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdat);
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdat) = localtime;
$year+=1900;
$mon = sprintf("%02d", $mon+1);
$mday = sprintf("%02d", $mday);
$timeforfilename = $year.$mon.$mday;
return $year."/".$mon."/".$mday."-".$hour.":".$min.":".$sec;
}
sub print_usage {
print "usage: squarrel daily|weekly|monthly\n";
}
sub get_argv {
if ($#ARGV!=0) {
&print_usage;
exit;
}
if ($ARGV[0] eq "daily") {
@source="..."; # file or directories to backup on daily base.
} elsif ($ARGV[0] eq "weekly") {
@source="..."; # file or directories to backup on weekly base.
} elsif ($ARGV[0] eq "monthly") {
@source="..."; # file or directories to backup on monthly base.
} else {
&print_usage;
exit;
}
$targetprefix=$ARGV[0];
}
sub init {
$logdir = "/var/www/html"; # log is written in httpd directory so I can check it via browser
$log = "$logdir"."/emc.log";
$detailedlogdir = "/home/emc";
$detailedlog = "$detailedlogdir"."/emcdetailed.log";
if (-e $log) {
open LOGFILE, ">> $log" or die $!;
} else {
open LOGFILE, "> $log" or die $!;
}
if (-e $detailedlog) {
open DETAILEDLOG, ">> $detailedlog" or die $!;
} else {
open DETAILEDLOG, "> $detailedlog" or die $!;
}
print LOGFILE "----------------------------------------------------\n";
print DETAILEDLOG "----------------------------------------------------\n";
$timestring = &get_timestring;
print LOGFILE "$timestring backup($targetprefix) starts\n";
print DETAILEDLOG "$timestring backup($targetprefix) starts\n";
$targetdir = "/home/bt/crossbackup";
# $targetnameonly = "backup".$timeforfilename.".tar.bz2";
$targetnameonly=$targetprefix.$timeforfilename.".tar.bz2";
$target = "$targetdir/".$targetnameonly;
$lastsuccessfilename = "$detailedlogdir"."/lastsuccess_".$targetprefix;
$cbserver = "..."; # remote server address
}
sub archive {
my ($archivecmd, $result);
$archivecmd = "tar cvfj $target @source";
$timestring = &get_timestring;
print LOGFILE "$timestring $archivecmd\n";
print DETAILEDLOG "$timestring $archivecmd\n";
system("$archivecmd >>$detailedlog 2>> $detailedlog");
$result = $?;
$timestring = &get_timestring;
if ($result == 0) {
print LOGFILE "$timestring archiving finish successfully\n";
print DETAILEDLOG "$timestring archiving finish successfully\n";
} else {
print LOGFILE "$timestring archiving fail $result\n";
print DETAILEDLOG "$timestring archiving fail $result\n";
}
return $result;
}
sub check_identical {
my $lastsuccesstarget;
my $different;
if (-e $lastsuccessfilename) {
open LASTSUCCESS, "$lastsuccessfilename" or die "Write $lastsuccessfilename";
$lastsuccesstarget=
chop($lastsuccesstarget);
close LASTSUCCESS;
$timestring = &get_timestring;
print LOGFILE "$timestring compare $target $lastsuccesstarget\n";
print DETAILEDLOG "$timestring compare $target $lastsuccesstarget\n";
system("diff -q $lastsuccesstarget $target >> $detailedlog 2>> $detailedlog");
if ($?) {
$timestring = &get_timestring;
print LOGFILE "$timestring $target is different to $lastsuccesstarget\n";
print DETAILEDLOG "$timestring $target is different $lastsuccesstarget\n";
return 1;
} else {
$timestring = &get_timestring;
print LOGFILE "$timestring $target is identical to $lastsuccesstarget\n";
print DETAILEDLOG "$timestring $target is identical to $lastsuccesstarget\n";
system("rm -f $lastsuccesstarget\n");
$timestring = &get_timestring;
print LOGFILE "$timestring remove $lastsuccesstarget\n";
print DETAILEDLOG "$timestring remove $lastsuccesstarget\n";
return 0;
}
} else {
return 1;
}
}
sub ftp_upload {
my $ftpcmd;
my $result;
$ftpcmd = '"user username password\nbinary\nput '.$target.' '.$targetnameonly.'\nquit\n"';
$timestring = &get_timestring;
print LOGFILE "$timestring ftp -v -d $cbserver <<$ftpcmd\n"; print DETAILEDLOG "$timestring ftp -v -d $cbserver <<$ftpcmd\n"; system("echo -e $ftpcmd | ftp -v -d $cbserver>> $log 2>> $log");
$result=$?;
$timestring = &get_timestring;
if ($result == 0) {
print LOGFILE "$timestring uploading finish successfully\n";
print DETAILEDLOG "$timestring uploading finish successfully\n";
} else {
print LOGFILE "$timestring uploading fail $result\n";
print DETAILEDLOG "$timestring uploading fail $result\n";
}
return $result;
}
sub done {
my ($result, $stage) = @_;
$timestring = &get_timestring;
if ($result == 0) {
open LASTSUCCESS, ">$lastsuccessfilename" or die "Write $lastsuccessfilename";
print LOGFILE "$timestring backup($targetnameonly) succeed\n";
print DETAILEDLOG "$timestring backup($targetnameonly) succeed\n";
print LASTSUCCESS "$target\n";
close LASTSUCCESS;
} else {
print LOGFILE "$timestring backup($targetnameonly) failed in stage $stage\n";
print DETAILEDLOG "$timestring backup($targetnameonly) failed in stage $stage\n";
}
close LOGFILE;
close DETAILEDLOG;
}
my $result;
&get_argv;
&init;
$result = &archive;
if ($result) {
&done(1, "archive");
exit (1);
}
$result = &check_identical;
if ($result==0) {
&done(0, "");
exit(0);
}
$result = &ftp_upload;
if ($result) {
&done(2, "upload");
exit (2);
}
&done(0, "");
exit(0);
Sunday, March 18, 2007
Try Emacs
Emacs is the favorite editor of my leader, as well as my leader before. It looks handy and extensible. From Google Code, there is an emacs backend to enable navigation between source files. That's a good example that Emacs can be extended and customized for my need. I would like to have a try.
I read emacs build-in tutorial. It's basic but enough to start. There is a comprehensive manual from GNU emacs official website.
For starting, it's just different commands to vi or other editors. Just remember it.
^g reset emacs commands in case of hanging
^a / ^e move to the beginning or end of the line
ESC-< / ESC-> move to the beginning or end of the file
^k kill from cursor position to end of line
^ [SPACEBAR] or ^@ mark block
^w cut
ESC w copy
^y yank it back or paste
^s search or search again
^r reverse search or reverse search again
ESC % replace (type 'y' to confirm replacement)
No [RET] after entering search string
^x ^f open a file
^x ^s save current buffer
^x ^c exit
^x ^b list all buffers
^x u or ^_ undo
^u 8 repeat command for 8 times
^x 1 / 2 / o get rid of all other windows / split current window into two /switch to another window
All these commands work for both windows and Linux.
I read emacs build-in tutorial. It's basic but enough to start. There is a comprehensive manual from GNU emacs official website.
For starting, it's just different commands to vi or other editors. Just remember it.
^g reset emacs commands in case of hanging
^a / ^e move to the beginning or end of the line
ESC-< / ESC-> move to the beginning or end of the file
^k kill from cursor position to end of line
^
^w cut
ESC w copy
^y yank it back or paste
^s search or search again
^r reverse search or reverse search again
ESC % replace (type 'y' to confirm replacement)
No [RET]
^x ^f open a file
^x ^s save current buffer
^x ^c exit
^x ^b list all buffers
^x u or ^_ undo
^u 8
^x 1 / 2 / o get rid of all other windows / split current window into two /switch to another window
All these commands work for both windows and Linux.
Saturday, March 10, 2007
PickupPerl & Screen
I read through PickupPerl in a few days. It's a simple but good starting point. As I am familiar with C programming, I only list what is important to me. As an exercise to study, I started to write a script for my data backup. Meanwhile I found some other good tutorials with more details @www.perl.com, an official perl website.
I also found a pretty handy tool, screen, a terminal manager. Just remember a few often used commands. There is a good introduction @ http://jmcpherson.org/screen.html
Perl
1. The first example. Just remember it.
#!/usr/bin/perl
use strict;
use warnings;
print "What is your username? ";
my $username;
$username =;
chomp($username);
print "Hello, $username.\n";
2. Scalar variable can be either a string or a number. And a scalar variable is not defined as a string or a number. Perl does automatic conversion between string and number.
3. Single-quoted string. no special character except ' and \. Note \' and \\ is replaced but backslash followed by something else keeps both. For instance \o means \o, two characters.
4. New line can be embedded into a single-quoted string.
5. Double-quoted string is similar to that in C except that $ and @ are special characters and need backslash.
6. For number, you can use underscore for readability. It's just for readability.
7. Scalar variable support interpolation.
8. Undefined variable is allowed and assigned a special value 'undef'.
9. 0, undef, "" means false and others means true.
10. <=> cmp, . string concatenation, x string duplication.
11. Names are case sensitive.
12. Array(@) can grow and shrink dynamically as needed by setting $#array. When an array is growing very large very quickly, it can be a bit inefficient. You can pre-build an array of certain size instead. $#array: subscript of the last element in the array.
13. Everything in the array must be a scalar. No 2-D array. Array in another array simply concatenate each other.
14. Array quoted by () or qw//. Use .. with slice.
16. Push, pop at the end of array, shift/enshift at the beginning of array.
17. blocks are quoted by {}. Variables declared in the block is valid only in the block.
18. if/elsif/else, foreach. foreach my $item (@collection) { print "$item\n"; }
20. hashes(%) are not subscripted by numbers but an arbitrary scalar value. A hash is a list of value pairs, key and value. keys/values %hash return array of key or value.
22. Regular expression(quoted by //). * zero or more of the previous character; . any; | or ; () grouping; ^ start of string; $ end of string; =~ for pattern matching. \d match [0-9]. check 'perlre' for more.
24. Subrouting. sub subname { xxx; }, return; parameter. special array variable @_.
Screen
C-A c create
C-A p/n page forward/backward
C-A 0/1/2.. select a window
C-A d/r detach/retach
I also found a pretty handy tool, screen, a terminal manager. Just remember a few often used commands. There is a good introduction @ http://jmcpherson.org/screen.html
Perl
1. The first example. Just remember it.
#!/usr/bin/perl
use strict;
use warnings;
print "What is your username? ";
my $username;
$username =
chomp($username);
print "Hello, $username.\n";
2. Scalar variable can be either a string or a number. And a scalar variable is not defined as a string or a number. Perl does automatic conversion between string and number.
3. Single-quoted string. no special character except ' and \. Note \' and \\ is replaced but backslash followed by something else keeps both. For instance \o means \o, two characters.
4. New line can be embedded into a single-quoted string.
5. Double-quoted string is similar to that in C except that $ and @ are special characters and need backslash.
6. For number, you can use underscore for readability. It's just for readability.
7. Scalar variable support interpolation.
8. Undefined variable is allowed and assigned a special value 'undef'.
9. 0, undef, "" means false and others means true.
10. <=> cmp, . string concatenation, x string duplication.
11. Names are case sensitive.
12. Array(@) can grow and shrink dynamically as needed by setting $#array. When an array is growing very large very quickly, it can be a bit inefficient. You can pre-build an array of certain size instead. $#array: subscript of the last element in the array.
13. Everything in the array must be a scalar. No 2-D array. Array in another array simply concatenate each other.
14. Array quoted by () or qw//. Use .. with slice.
16. Push, pop at the end of array, shift/enshift at the beginning of array.
17. blocks are quoted by {}. Variables declared in the block is valid only in the block.
18. if/elsif/else, foreach. foreach my $item (@collection) { print "$item\n"; }
20. hashes(%) are not subscripted by numbers but an arbitrary scalar value. A hash is a list of value pairs, key and value. keys/values %hash return array of key or value.
22. Regular expression(quoted by //). * zero or more of the previous character; . any; | or ; () grouping; ^ start of string; $ end of string; =~ for pattern matching. \d match [0-9]. check 'perlre' for more.
24. Subrouting. sub subname { xxx; }, return; parameter. special array variable @_.
Screen
C-A c create
C-A p/n page forward/backward
C-A 0/1/2.. select a window
C-A d/r detach/retach
Saturday, March 3, 2007
Write Perl Script
I did some Shell and Tcl script designing before but apparently it's not enough to write a good backup script. Before starting to play with scripts, I need to decide which script language to use, Tcl or Perl. I searched for 'comparison tcl perl' and got some interesting comments.
Tom Christiansen has a nice comparison. From his view, Perl is a good system programming language while Tcl is a metalanguage. (Metalanguage means that you can create your own language based on it.) Perl is also much more efficient because the intepreter first compile the code and run the intermediate code. Also because of compiling, it's more robust.
I would say that perl is a language designed for high-level, portable, systems programming on tasks of small to medium scope, but with support for enough underlying general-purpose programming constructs to make it suitable for many users who would not characterize themselves as systems programmers. This includes not just systems administrators but also people doing software installations, rapid prototyping, generic data munging, simple client/server programming, customer support, and test suite design and analysis. Another application area for which perl provides an elegant and convenient solution is one which is growing so fast that I suspect even its second-derivative is still positive: World Wide Web script support (a.k.a. CGI programming). I suspect than in a few years, perl may well be better known as a CGI language than it is as a sysadmin language.
(From http://www.perl.com/doc/FMTEYEWTK/versus/tcl-discussion.html)
For me there are two other advantages: similarity to C and that my colleagues know Perl. Richard Stallman is negative to Tcl either from experience of Emacs development. So conclusion is clear now. I choose Perl.
There are quite some free Perl readings on Internet. I downloaded a tutorial called PickupPerl. It's a good reading to start although it can be more compact. Start to read it and backup application is a good exercise.
Tom Christiansen has a nice comparison. From his view, Perl is a good system programming language while Tcl is a metalanguage. (Metalanguage means that you can create your own language based on it.) Perl is also much more efficient because the intepreter first compile the code and run the intermediate code. Also because of compiling, it's more robust.
I would say that perl is a language designed for high-level, portable, systems programming on tasks of small to medium scope, but with support for enough underlying general-purpose programming constructs to make it suitable for many users who would not characterize themselves as systems programmers. This includes not just systems administrators but also people doing software installations, rapid prototyping, generic data munging, simple client/server programming, customer support, and test suite design and analysis. Another application area for which perl provides an elegant and convenient solution is one which is growing so fast that I suspect even its second-derivative is still positive: World Wide Web script support (a.k.a. CGI programming). I suspect than in a few years, perl may well be better known as a CGI language than it is as a sysadmin language.
(From http://www.perl.com/doc/FMTEYEWTK/versus/tcl-discussion.html)
For me there are two other advantages: similarity to C and that my colleagues know Perl. Richard Stallman is negative to Tcl either from experience of Emacs development. So conclusion is clear now. I choose Perl.
There are quite some free Perl readings on Internet. I downloaded a tutorial called PickupPerl. It's a good reading to start although it can be more compact. Start to read it and backup application is a good exercise.
Sunday, February 25, 2007
Build up home data center and backup policy
Last a few days I re-organized/cleanup my large hard disks to build up a center repository. All legacy data, reference information and current data are stored on the server which is the only data storage. The advantage is that there is no need to synchronize data and it simplify backup. And all data can be accessed anywhere as well.
A new backup policy is defined. It's in fact as important as the hard disk. :) Basically I want
1. robust data management
2. easy and flexible to use, accessible anywhere
3. easy to automate backup
4. searchable by desktop search engine
The general backup rule is:
1. all fixed data are stored on the external hard disk with read only permission.
2. all dynamic data are stored on another partition on external hard disk.
3. fixed data are backup to DVD with snapshots, dynamic data are weekly (monthly for media) archived and ftp to another computer.
Backup of dynamic data can be automated. I am going to write a script to do that automatically. All data is robust because they have at least one extra copy elsewhere.
All data on server are mapped to windows network drive. It's easy to use and new google desktop can index it! And it is really indexing now! :)
Resource now I have
/dev/hda1 system disk 10G
/dev/hdc5 temporary data disk 10G, used for Bittorrent as well
/dev/sda1 user data 15G
/dev/sda2 repository for fixed data and media 205G NTFS
/dev/sda3 shared data 15G
I bought an external Philips DVD writer last week. At first glance it looks not so good but now I like it very much. :) But I didn't try to burn DVD on Linux yet.
By the way, some often used commands for CVS under linux. Tortoise doesn't work with network drive.
CVSROOT=:ssh:sunwei@192.168.11.99:/home/cvs
(if on the same computer, simply set CVSROOT=/home/cvs)
cvs -q checkout [-r tag] -P ejpgl
cvs -q import ejpgl tcvs-vendor tcvs-release
cvs -q commit *.c
cvs -q tag -c TAGNAME
The last thing is that RealView can't open multiple MP3 files. I installed VideoLAN instead following instructions on VideoLAN site in yum approach. But in 'yum update' it's always error that it can't access some server. I use 'yum clean‘ and 'yum install video-lan' without update and it works.
A new backup policy is defined. It's in fact as important as the hard disk. :) Basically I want
1. robust data management
2. easy and flexible to use, accessible anywhere
3. easy to automate backup
4. searchable by desktop search engine
The general backup rule is:
1. all fixed data are stored on the external hard disk with read only permission.
2. all dynamic data are stored on another partition on external hard disk.
3. fixed data are backup to DVD with snapshots, dynamic data are weekly (monthly for media) archived and ftp to another computer.
Backup of dynamic data can be automated. I am going to write a script to do that automatically. All data is robust because they have at least one extra copy elsewhere.
All data on server are mapped to windows network drive. It's easy to use and new google desktop can index it! And it is really indexing now! :)
Resource now I have
/dev/hda1 system disk 10G
/dev/hdc5 temporary data disk 10G, used for Bittorrent as well
/dev/sda1 user data 15G
/dev/sda2 repository for fixed data and media 205G NTFS
/dev/sda3 shared data 15G
I bought an external Philips DVD writer last week. At first glance it looks not so good but now I like it very much. :) But I didn't try to burn DVD on Linux yet.
By the way, some often used commands for CVS under linux. Tortoise doesn't work with network drive.
CVSROOT=:ssh:sunwei@192.168.11.99:/home/cvs
(if on the same computer, simply set CVSROOT=/home/cvs)
cvs -q checkout [-r tag] -P ejpgl
cvs -q import ejpgl tcvs-vendor tcvs-release
cvs -q commit *.c
cvs -q tag -c TAGNAME
The last thing is that RealView can't open multiple MP3 files. I installed VideoLAN instead following instructions on VideoLAN site in yum approach. But in 'yum update' it's always error that it can't access some server. I use 'yum clean‘ and 'yum install video-lan' without update and it works.
Thursday, February 8, 2007
Upgrade to Fedora 4
Although RH7.2 works well, it doesn't support some new applications like VLC. I upgrade it into Fedora 4 in last a few days. Another reason I choose Fedora is that it suggests Pentium 500 and 256MB memory. That fits my DELL server well which is PIII 800 with 256MB RDRAM.
There is a great guide about how to set up Fedora 4, step by step, very detailed, http://stanton-finley.net/fedora_core_4_installation_notes.html. I downloaded the image from a mirror site http://ftp.uni-koeln.de/mirrors/fedora/linux/core/
The configuration is almost the same to RH7.2 while I use the whole disk for Fedora. It's because that I noticed some discussion about the problems to have Linux and Windows on the same disk. I also choose all graphical administration tools. After it starts, I disabled unused daemons according to Stanton.
CVS:
It's almost the same to that on RH7.2 while now the cvs is already exists in /etc/xinetd.d. You only need to enable it.
Samba:
You don't need to edit /etc/samba/smb.conf. Now it can be done via graphical tool. The other difference is that user access is not limited to his home directory. You can add any share directory and decide who can access it. After saving, restart smb by 'service smb restart'.
SSH and X-windows:
SSH is enabled by default. To set up remote X-windows, it's the same to that in RH7.2
FTP and web server:
Just enable vsftpd and httpd.
I also connect an external hard disk with NTFS to Fedora. It works well! To do that, we need to download the NTFS package from http://www.linux-ntfs.org/. Note we should download the package for Fedora not old Linux. Then rpm -ivh kernel-module-ntfs-2.6.11-1.1369_FC4-2.1.22-0.rr.6.0.i686.rpm. To be able to be accessed by users other than root, use 'mount -t ntfs -r -o umask=0222 /dev/sda2 /home/repository/'. Done!
Before I found the umask trick, all files are only accessible from root. I made a mistake to use 'chmod -R o+x o+r *' to add permission. I don't know if it would impact the NTFS system. I need to run filesystem check later.
I installed Xilinx EDK8.1 on it. The strange thing is that ISE8.1 always doesn't accept the registration ID which is correct. I try ISE webpack 8.1 later.
Anyway, my computing center is upgraded and now very convenient to use. :P
There is a great guide about how to set up Fedora 4, step by step, very detailed, http://stanton-finley.net/fedora_core_4_installation_notes.html. I downloaded the image from a mirror site http://ftp.uni-koeln.de/mirrors/fedora/linux/core/
The configuration is almost the same to RH7.2 while I use the whole disk for Fedora. It's because that I noticed some discussion about the problems to have Linux and Windows on the same disk. I also choose all graphical administration tools. After it starts, I disabled unused daemons according to Stanton.
CVS:
It's almost the same to that on RH7.2 while now the cvs is already exists in /etc/xinetd.d. You only need to enable it.
Samba:
You don't need to edit /etc/samba/smb.conf. Now it can be done via graphical tool. The other difference is that user access is not limited to his home directory. You can add any share directory and decide who can access it. After saving, restart smb by 'service smb restart'.
SSH and X-windows:
SSH is enabled by default. To set up remote X-windows, it's the same to that in RH7.2
FTP and web server:
Just enable vsftpd and httpd.
I also connect an external hard disk with NTFS to Fedora. It works well! To do that, we need to download the NTFS package from http://www.linux-ntfs.org/. Note we should download the package for Fedora not old Linux. Then rpm -ivh kernel-module-ntfs-2.6.11-1.1369_FC4-2.1.22-0.rr.6.0.i686.rpm. To be able to be accessed by users other than root, use 'mount -t ntfs -r -o umask=0222 /dev/sda2 /home/repository/'. Done!
Before I found the umask trick, all files are only accessible from root. I made a mistake to use 'chmod -R o+x o+r *' to add permission. I don't know if it would impact the NTFS system. I need to run filesystem check later.
I installed Xilinx EDK8.1 on it. The strange thing is that ISE8.1 always doesn't accept the registration ID which is correct. I try ISE webpack 8.1 later.
Anyway, my computing center is upgraded and now very convenient to use. :P
Monday, February 5, 2007
CVS Server
When I started to inspect the code, I realized that I need a CVS server as well. First check if there is any free CVS hosting site. Well, there are some, but $30 per month!
It's not difficult to setup a CVS server. I found a good paper at http://personal.vsnl.com/sureshms/linuxindex.html.
1. create cvs user and group
2. CVSROOT=/home/cvs; export CVSROOT add it into profile
3. cvs -d /home/cvs init
4. add /etc/xinetd.d/cvs
5. service xinetd restart
As it uses sshd, it's not necessary to start telnetd.
Done!
On client side, I use tortoiseCVS. Set home :ssh:sunwei@192.168.11.99:/home/cvs. First create a new directory. Use CVS->Make New Module, repository folder->/home/cvs, modulename->directory name. Afterwards you can add files into it.
Everything is now saved at /home/cvs. To backup I think just simply tar /home/cvs. It's easy. :)
Another problem of the Linux server is that I need to set DNS server address for it. It's /etc/resolv.conf. add 'nameserver 192.168.11.1' then it's fine.
service cvspserver
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = cvs
group = cvs
log_type = FILE /var/log/xinetdlog
server = /usr/bin/cvs
server_args = -f --allow-root=/home/cvs pserver
log_on_success += USERID DURATION
log_on_failure += HOST USERID
}
It's not difficult to setup a CVS server. I found a good paper at http://personal.vsnl.com/sureshms/linuxindex.html.
1. create cvs user and group
2. CVSROOT=/home/cvs; export CVSROOT add it into profile
3. cvs -d /home/cvs init
4. add /etc/xinetd.d/cvs
5. service xinetd restart
As it uses sshd, it's not necessary to start telnetd.
Done!
On client side, I use tortoiseCVS. Set home :ssh:sunwei@192.168.11.99:/home/cvs. First create a new directory. Use CVS->Make New Module, repository folder->/home/cvs, modulename->directory name. Afterwards you can add files into it.
Everything is now saved at /home/cvs. To backup I think just simply tar /home/cvs. It's easy. :)
Another problem of the Linux server is that I need to set DNS server address for it. It's /etc/resolv.conf. add 'nameserver 192.168.11.1' then it's fine.
service cvspserver
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = cvs
group = cvs
log_type = FILE /var/log/xinetdlog
server = /usr/bin/cvs
server_args = -f --allow-root=/home/cvs pserver
log_on_success += USERID DURATION
log_on_failure += HOST USERID
}
Sunday, February 4, 2007
Start to build my mini computing center
I experienced top-level IT infrastructure during my last internship. It's a kind of combination of Linux server clusters and Windows desktop. I like to build up my mini computing center at home.
Today I installed a Redhat 7.2 on the DELL. It's quite successful. The DELL server is 800Mhz system, though, it runs quite fast with RH7.2. I setup Samba, ftp, sshd, X-server, web services on that.
The installation disk is from the book "Red Hat Linux, the complete reference 2nd" by Richard Petersen. The fist trick is type of installation. I should choose customized otherwise it use the whole disk for Linux. The second is to partition the disk. It requires a separate swap partition which need to be at least the same the memory size. Then it goes. Of course, these used packages need to be installed. Sometimes Samba is called something like windows file sharing.
Samba
Go to /etc/samba. Edit smb.conf. Samba use a password file other than /etc/passwd. You can make it by
cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
chmod 600 /etc/samba/smbpasswd
However, Samba can only get username but not password from it. You need to run smbpasswd username to set password. After that, use command 'service smb start/restart'' to invoke.
To make it start automatically during booting, you need command 'chkconfig --level 35 smb on'. It enables smb during booting. Except for ftp server, sshd and httpd are both enabled by 'çhkconfig --level 35' because they are enabled in rc.d while ftpd is enabled in xintd.d.
There is a problem with cygwin. It can't write to Samba drive. It looks a common problem. Someone write a description but it doesn't work. Search "cygwin samba permission".
Ftp server
Simply use command 'chkconfig wu-ftpd on ; service xinted restart'. Ftp is enabled via xinetd. You can find the configuration file /etc/xinetd.conf/wu-ftpd. What chkconfig do is to remove the last line 'disable=yes'.
Sometimes it's very slow to connect to it from a client. But it's fast afterwards.
sshd & X-server
sshd can be enabled by 'chkconfig --level 35 sshd on'. Use putty to connect to it. To setup X-server, I found a good reference http://www.yolinux.com/TUTORIALS/LinuxTutorialMicrosoftWindowsNetworkIntegration.html. Basically it needs three steps.
1) edit /etc/X11/xdm/Xaccess, change from '#* any host can get a login window' to '* any host can get a login window'
2) /etc/X11/xdm/xdm-config, change from '!DisplayManager.requestPort 0' to 'DisplayManager.requestPort 0'
3) /etc/X11/gdm/gdm.conf, change from '[xdmcp] Enable=false' to '[xdmcp] Enable=true'.
And init 3 ; init 5 to restart X-windows.
Apache
Simply use 'chkconfig --level 35 httpd on'. The home directory is /var/www. There are already some files in. I didn't try Tcl yet.
Now I can use my notebook to control everything on Linux server! Excellent!
The only problem of RH7.2 is that ISE/EDK8.1 requires RH Enterprise Linux 3 WS or 4 WS, which are equivalent to RHL9 or Fedora 3 (from wiki). I have to re-install it when Internet is available.
Enclosing smb.conf
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
# workgroup = NT-Domain-Name or Workgroup-Name
workgroup = HOME
# server string is the equivalent of the NT Description field
server string = RHServer
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
hosts allow = 192.168.11. 127.
# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
printcap name = /etc/printcap
load printers = yes
# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx
printing = lprng
# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
; guest account = pcguest
# this tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/%m.log
# Put a capping on the size of the log files (in Kb).
max log size = 100
# Security mode. Most people will want user level security. See
# security_level.txt for details.
security = user
# Use password server option only with security = server
# The argument list may include:
# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
# or to auto-locate the domain controller/s
# password server = *
; password server =
# Password Level allows matching of _n_ characters of the password for
# all combinations of upper and lower case.
; password level = 8
; username level = 8
# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
# The following is needed to keep smbclient from spouting spurious errors
# when Samba is built with support for SSL.
; ssl CA certFile = /usr/share/ssl/certs/ca-bundle.crt
# The following are needed to allow password changing from Windows to
# update the Linux sytsem password also.
# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
# NOTE2: You do NOT need these to allow workstations to change only
# the encrypted SMB passwords. They allow the Unix password
# to be kept in sync with the SMB password.
; unix password sync = Yes
; passwd program = /usr/bin/passwd %u
; passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
# Unix users can map to different SMB User names
; username map = /etc/samba/smbusers
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /etc/samba/smb.conf.%m
# This parameter will control whether or not Samba should obey PAM's
# account and session management directives. The default behavior is
# to use PAM for clear text authentication only and to ignore any
# account or session management. Note that Samba always ignores PAM
# for authentication in the case of encrypt passwords = yes
; obey pam restrictions = yes
# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
; interfaces = 192.168.12.2/24 192.168.13.2/24
# Configure remote browse list synchronisation here
# request announcement to, or browse list sync from:
# a specific host or from / to a whole subnet (see below)
; remote browse sync = 192.168.3.25 192.168.5.255
# Cause this host to announce itself to local subnets here
; remote announce = 192.168.1.255 192.168.2.44
# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
; local master = no
# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
; os level = 33
# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
; domain master = yes
# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
; preferred master = yes
# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
; domain logons = yes
# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
; logon script = %m.bat
# run a specific logon batch file per username
; logon script = %U.bat
# Where to store roving profiles (only for Win95 and WinNT)
# %L substitutes for this servers netbios name, %U is username
# You must uncomment the [Profiles] share below
; logon path = \\%L\Profiles\%U
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
; wins support = yes
# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z
# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one WINS Server on the network. The default is NO.
; wins proxy = yes
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
dns proxy = no
# Case Preservation can be handy - system default is _no_
# NOTE: These can be set on a per share basis
; preserve case = no
; short preserve case = no
# Default case is normally upper case for all DOS files
; default case = lower
# Be very careful with case sensitivity - it can break things!
; case sensitive = no
#============================ Share Definitions ==============================
[homes]
comment = Home Directories
browseable = yes
writable = yes
valid users = %S
create mode = 0666
directory mode = 0777
# If you want users samba doesn't recognize to be mapped to a guest user
; map to guest = bad user
# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
; comment = Network Logon Service
; path = /usr/local/samba/lib/netlogon
; guest ok = yes
; writable = no
; share modes = no
# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;[Profiles]
; path = /usr/local/samba/profiles
; browseable = no
; guest ok = yes
# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
# Set public = yes to allow user 'guest account' to print
guest ok = no
writable = no
printable = yes
# This one is useful for people to share files
;[tmp]
; comment = Temporary file space
; path = /tmp
; read only = no
; public = yes
# A publicly accessible directory, but read only, except for people in
# the "staff" group
;[public]
; comment = Public Stuff
; path = /home/samba
; public = yes
; writable = yes
; printable = no
; write list = @staff
# Other examples.
#
# A private printer, usable only by fred. Spool data will be placed in fred's
# home directory. Note that fred must have write access to the spool directory,
# wherever it is.
;[fredsprn]
; comment = Fred's Printer
; valid users = fred
; path = /home/fred
; printer = freds_printer
; public = no
; writable = no
; printable = yes
# A private directory, usable only by fred. Note that fred requires write
# access to the directory.
;[fredsdir]
; comment = Fred's Service
; path = /usr/somewhere/private
; valid users = fred
; public = no
; writable = yes
; printable = no
# a service which has a different directory for each machine that connects
# this allows you to tailor configurations to incoming machines. You could
# also use the %U option to tailor it by user name.
# The %m gets replaced with the machine name that is connecting.
;[pchome]
; comment = PC Directories
; path = /usr/local/pc/%m
; public = no
; writable = yes
# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
;[public]
; path = /usr/somewhere/else/public
; public = yes
; only guest = yes
; writable = yes
; printable = no
# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.
;[myshare]
; comment = Mary's and Fred's stuff
; path = /usr/somewhere/shared
; valid users = mary fred
; public = no
; writable = yes
; printable = no
; create mask = 0765
Today I installed a Redhat 7.2 on the DELL. It's quite successful. The DELL server is 800Mhz system, though, it runs quite fast with RH7.2. I setup Samba, ftp, sshd, X-server, web services on that.
The installation disk is from the book "Red Hat Linux, the complete reference 2nd" by Richard Petersen. The fist trick is type of installation. I should choose customized otherwise it use the whole disk for Linux. The second is to partition the disk. It requires a separate swap partition which need to be at least the same the memory size. Then it goes. Of course, these used packages need to be installed. Sometimes Samba is called something like windows file sharing.
Samba
Go to /etc/samba. Edit smb.conf. Samba use a password file other than /etc/passwd. You can make it by
cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
chmod 600 /etc/samba/smbpasswd
However, Samba can only get username but not password from it. You need to run smbpasswd username to set password. After that, use command 'service smb start/restart'' to invoke.
To make it start automatically during booting, you need command 'chkconfig --level 35 smb on'. It enables smb during booting. Except for ftp server, sshd and httpd are both enabled by 'çhkconfig --level 35' because they are enabled in rc.d while ftpd is enabled in xintd.d.
There is a problem with cygwin. It can't write to Samba drive. It looks a common problem. Someone write a description but it doesn't work. Search "cygwin samba permission".
Ftp server
Simply use command 'chkconfig wu-ftpd on ; service xinted restart'. Ftp is enabled via xinetd. You can find the configuration file /etc/xinetd.conf/wu-ftpd. What chkconfig do is to remove the last line 'disable=yes'.
Sometimes it's very slow to connect to it from a client. But it's fast afterwards.
sshd & X-server
sshd can be enabled by 'chkconfig --level 35 sshd on'. Use putty to connect to it. To setup X-server, I found a good reference http://www.yolinux.com/TUTORIALS/LinuxTutorialMicrosoftWindowsNetworkIntegration.html. Basically it needs three steps.
1) edit /etc/X11/xdm/Xaccess, change from '#* any host can get a login window' to '* any host can get a login window'
2) /etc/X11/xdm/xdm-config, change from '!DisplayManager.requestPort 0' to 'DisplayManager.requestPort 0'
3) /etc/X11/gdm/gdm.conf, change from '[xdmcp] Enable=false' to '[xdmcp] Enable=true'.
And init 3 ; init 5 to restart X-windows.
Apache
Simply use 'chkconfig --level 35 httpd on'. The home directory is /var/www. There are already some files in. I didn't try Tcl yet.
Now I can use my notebook to control everything on Linux server! Excellent!
The only problem of RH7.2 is that ISE/EDK8.1 requires RH Enterprise Linux 3 WS or 4 WS, which are equivalent to RHL9 or Fedora 3 (from wiki). I have to re-install it when Internet is available.
Enclosing smb.conf
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
# workgroup = NT-Domain-Name or Workgroup-Name
workgroup = HOME
# server string is the equivalent of the NT Description field
server string = RHServer
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
hosts allow = 192.168.11. 127.
# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
printcap name = /etc/printcap
load printers = yes
# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx
printing = lprng
# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
; guest account = pcguest
# this tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/%m.log
# Put a capping on the size of the log files (in Kb).
max log size = 100
# Security mode. Most people will want user level security. See
# security_level.txt for details.
security = user
# Use password server option only with security = server
# The argument list may include:
# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
# or to auto-locate the domain controller/s
# password server = *
; password server =
# Password Level allows matching of _n_ characters of the password for
# all combinations of upper and lower case.
; password level = 8
; username level = 8
# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
# The following is needed to keep smbclient from spouting spurious errors
# when Samba is built with support for SSL.
; ssl CA certFile = /usr/share/ssl/certs/ca-bundle.crt
# The following are needed to allow password changing from Windows to
# update the Linux sytsem password also.
# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
# NOTE2: You do NOT need these to allow workstations to change only
# the encrypted SMB passwords. They allow the Unix password
# to be kept in sync with the SMB password.
; unix password sync = Yes
; passwd program = /usr/bin/passwd %u
; passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
# Unix users can map to different SMB User names
; username map = /etc/samba/smbusers
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /etc/samba/smb.conf.%m
# This parameter will control whether or not Samba should obey PAM's
# account and session management directives. The default behavior is
# to use PAM for clear text authentication only and to ignore any
# account or session management. Note that Samba always ignores PAM
# for authentication in the case of encrypt passwords = yes
; obey pam restrictions = yes
# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
; interfaces = 192.168.12.2/24 192.168.13.2/24
# Configure remote browse list synchronisation here
# request announcement to, or browse list sync from:
# a specific host or from / to a whole subnet (see below)
; remote browse sync = 192.168.3.25 192.168.5.255
# Cause this host to announce itself to local subnets here
; remote announce = 192.168.1.255 192.168.2.44
# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
; local master = no
# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
; os level = 33
# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
; domain master = yes
# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
; preferred master = yes
# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
; domain logons = yes
# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
; logon script = %m.bat
# run a specific logon batch file per username
; logon script = %U.bat
# Where to store roving profiles (only for Win95 and WinNT)
# %L substitutes for this servers netbios name, %U is username
# You must uncomment the [Profiles] share below
; logon path = \\%L\Profiles\%U
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
; wins support = yes
# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z
# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one WINS Server on the network. The default is NO.
; wins proxy = yes
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
dns proxy = no
# Case Preservation can be handy - system default is _no_
# NOTE: These can be set on a per share basis
; preserve case = no
; short preserve case = no
# Default case is normally upper case for all DOS files
; default case = lower
# Be very careful with case sensitivity - it can break things!
; case sensitive = no
#============================ Share Definitions ==============================
[homes]
comment = Home Directories
browseable = yes
writable = yes
valid users = %S
create mode = 0666
directory mode = 0777
# If you want users samba doesn't recognize to be mapped to a guest user
; map to guest = bad user
# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
; comment = Network Logon Service
; path = /usr/local/samba/lib/netlogon
; guest ok = yes
; writable = no
; share modes = no
# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;[Profiles]
; path = /usr/local/samba/profiles
; browseable = no
; guest ok = yes
# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
# Set public = yes to allow user 'guest account' to print
guest ok = no
writable = no
printable = yes
# This one is useful for people to share files
;[tmp]
; comment = Temporary file space
; path = /tmp
; read only = no
; public = yes
# A publicly accessible directory, but read only, except for people in
# the "staff" group
;[public]
; comment = Public Stuff
; path = /home/samba
; public = yes
; writable = yes
; printable = no
; write list = @staff
# Other examples.
#
# A private printer, usable only by fred. Spool data will be placed in fred's
# home directory. Note that fred must have write access to the spool directory,
# wherever it is.
;[fredsprn]
; comment = Fred's Printer
; valid users = fred
; path = /home/fred
; printer = freds_printer
; public = no
; writable = no
; printable = yes
# A private directory, usable only by fred. Note that fred requires write
# access to the directory.
;[fredsdir]
; comment = Fred's Service
; path = /usr/somewhere/private
; valid users = fred
; public = no
; writable = yes
; printable = no
# a service which has a different directory for each machine that connects
# this allows you to tailor configurations to incoming machines. You could
# also use the %U option to tailor it by user name.
# The %m gets replaced with the machine name that is connecting.
;[pchome]
; comment = PC Directories
; path = /usr/local/pc/%m
; public = no
; writable = yes
# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
;[public]
; path = /usr/somewhere/else/public
; public = yes
; only guest = yes
; writable = yes
; printable = no
# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.
;[myshare]
; comment = Mary's and Fred's stuff
; path = /usr/somewhere/shared
; valid users = mary fred
; public = no
; writable = yes
; printable = no
; create mask = 0765
Subscribe to:
Comments (Atom)