/etc/profile and /etc/bashrc is for system wide environment ,function and aliases setting. /usr/src/linux/document /lib/modules/2.4.2/ inside file with .o is compiled already /usr/X11R6/lib/X11/doc contains the general X windows document. edit /etc/issue , can put own message in the text file, it display on login. edit /etc/rc.d/rc.sysinit can change the welcome messge when start up. by issuing "init 3" can set default startup into text mode. "init 5" change back ################ SSH #################### scp -P 23 shadowman username@penguin.example.net:/home/username This will transfer the local file shadowman to /home/username/shadowman on port 23 on penguin.example.net. If you do not want to enter your password every time you ssh, scp, or sftp to a remote machine(but you still need to enter the "passphrase" specified during setting up ssh key), you can generate an authorization key pair. -- To generate a RSA key pair, use "ssh-keygen -t rsa" accept the default file location of ~/.ssh/id_rsa. Enter a passphrase(A passphrase is a string of words and characters used to authenticate a user.you can use spaces or tabs in the passphrase). -- Change the permissions of your .ssh directory using the command chmod 755 ~/.ssh. -- Copy the contents of ~/.ssh/id_rsa.pub to ~/.ssh/authorized_keys2 on the machine to which you want to connect. ############### firefox ############## problem: can't click through a url which containing simplified chinese. false url returned. environment: happens on webpage encoded in gb2312. utf8 page is fine. problem exists on firefox prior to version 1.1 (which is coming soon). solution: enter 'about:config' as url, enter. change 'network.standard-url.encode-utf8' to 'true' . ################ Start-up service ################ To disable insecure connection methods to your system, use ntsysv or chkconfig to make sure that these services do not start up with the system.At a minimum, you should deselect telnet, rsh, ftp, and rlogin To use ntsysv to configure services that start at runlevels 2, 3, and 5, type the command: /usr/sbin/ntsysv 235 Changes made to with ntsysv will not take affect until either the system is restarted or changes runlevels. If you disabled services used with xinetd, you must restart xinetd. By default, rlogin, rsh, and telnet are controlled by xinetd. To restart xinetd, type: /sbin/service xinetd restart For services not used with xinetd, you must stop them manually unless you are restart your system after using ntsysv. To stop a service, you will probably use a command such as: /sbin/service stop ################# Making hard drive faster ################## log in as root and make sure no one else is running the hard drive.AND don't try this on SCSI HD.( info : only the maxtor hdb support DMA , not the Fujisu one.) Enter following command to check whether 32-bit I/O and DMA are turned on. hdparm -c -d /dev/hda usually set to be 0 which means turned off. Perform timings of device reads for benchmark hdparm -t /dev/hda should see something like this: /dev/hda: Timing buffered disk reads: 64 MB in 30.61 seconds = 2.09 MB/sec now turn on the 32-bit I/O and DMA hdparm -c 1 -d 1 /dev/hda then run the benchmark again to see the difference. ################ Window manager setting ###################### you run X with the startx command. this is a frontend for "xinit". this program responsible for starting the X server and running various X clients that youi specify. xinit executes the shell script .xinitrc in home directory. if no such file in home directory, it's located in "/sur/lib/X11/xinit/xinitrc" (which is linked from /etc/X11/xinit) used as default. The window managers are specified in /etc/X11/xinit/Xclients (or $HOME/.Xclients). If all clients, like GNOME and KDE are installed, then the program switchdesk can be used to switch between them. Otherwise the .Xclients and .xinitrc files for the users will have to be built by hand. we can add .xsession(must be executable) file under root directory. simply add more lines like: # exec /usr/X11R6/bin/twm exec /usr/X11R6/bin/fvwm2 # exec /usr/bin/wmaker #################### Compile Kernel ########################## Must rebuild a module any time you upgrade your kernel to a new version or patch level. Rebuilding you kernel ,but keeping the sane kernel version ,doesn't require this though. when upgrading kernel, upgrade and reboot the new kernel first, then rebuild your modules and load them. when compiling module,it's good not to config all as "Y", choosing "M" will save kernel image size and it's load time. modules get invoked when needed and leak out when not. it's quite efficient. so type "lsmod" to see what gets loaded now... Module also can be load manually with insmod or modprobe , unload by "rmmod module". such as "rmmod autofs" . module can be get by command lsmod.lsmod list all modules are loading in the mem. for "autoclean" the one list under column "used by " means that it's load by kernel daemon. In order to load Module in startup time, add insmod in rc scripts(maybe rc.systcl) The use of module is : since module is loaded into mem, for some module we use rarely , there is no need to compile it into kernel image. so when in need, just insmod , when not, just rmmod. when compile, if you do not load something as module or add it into kernel, make sure it's not called as start-up service. otherwise service will throw out errors. also take a look at /var/log/XFree86.log can help to figure what get invoked when boot-time. if we want to do a minor change to kernel, back up ".config" file beforehead. 1 keep a backup of .config 2 run "make xconfig " ( make oldconfig will simply creat a common .config file) then load "/usr/src/linux/.config inot the configure setting , this way the old setting is kept , now do the change.) Read module help carefully, for some modules, we really need to say "Y" instead of "M" to get it work. 3 make dep 4 make clean 5 make bzImage if had modules added..... 5.1 make modules 5.2 make modules_install 5.3 depmod -a ( creat new modules dependency link ) 6 copy "/usr/src/linux/arch/i386/boot/bzImage " into " /boot " add similar lines into " /etc/lilo.conf " only change to " image=/boot/bzImage " it's the location of the kernel image which is whatever file you copy from /usr/src/....../boot/... 7 run lilo ---personal setting---- when recompile kernel make sure during "make xconfig " my previous network card falls into catergory RTL-8139. Current belongs to "Dec tulip" macronix Inc Mxic. In order to share windows file on the network through samba to turn on samba filesystem Since i got USB mouse, here make sure select "UHCI" "preliminary USB device system" "HID" support. and make sure the USB file system gets mounted at boot-time by command none /proc/bus/usb usbdevfs defaults 0 0 " or add mount -t usbdevfs none /proc/bus/usb to rc.local file ( not test yet) Sound card falls into "Ensoniq AudioPci ES1370 " `make mrproper' will do a more extensive `clean'ing. It is sometimes necessary; you may wish to do it at every patch. `make mrproper' will also delete your configuration file, so you might want to make a backup of it (.config) if you see it as valuable. `make oldconfig' will attempt to configure the kernel from an old configuration file; it will run through the `make config' process for you. If you haven't ever compiled a kernel before or don't have an old config file, then you probably shouldn't do this, as you will most likely want to change the default configuration. oldconfig is useful if you don't want to spend an hour hitting enter through all your settings as you would with config. If you don't want to change anything, oldconfig will go through using the current settings as defaults, and prompting for any new options that may have a ppeared in this version of the kernel. ###################### application install ####################### make clean - Clean all intermediate object files and binaries created from the source code dir during compilation.keeps all library and executables in place. make distclean - Clean everything, leaving the directories as they were before the compilation. You'll need to run `./configure' again to be able to re-build it( since the files that configures' created has been removed.. make install - Install the library files libttf.a, libttf.la or libttf.so to your system library path (`/usr/local/lib' by default). The path can be set manually with ./configure. make uninstall - Undo a `make install'. ###################### Opration on flopy ######################## format a floppy : " fdformat /dev/fd0 " then we have to make it to be one of the filesystem use " mkfs -t msdos /dev/fd0 1440 " to creat a MS-DOS floppy. then we can operate it. cp file /dev/floopy ###################### Mount ###################### read /usr/src/linux/fs to see what filesystem may supported by kernel. if not , we may have to rebuilt the kernel " mount -a " will mount all filesystemit executed at boot time by /etc/rc.d/rc.sysinit or other rcx.d files. all filesystems listed in /etc/fstab will be mounted during boot time . add similiar line into it will auto mount these filesystem. option to add : " ro " read only " rw " read and write . " umount /mnt/win_x " will unmount the specified filesystem. mount -t ntfs -o iocharset=cp936 /dev/hdb5 /mnt/winntff ( mount hard disk which has chinese stuff on it) 950 is for big5 Chown and Chmod don't work for FAT file systems -- FAT file systems have neither ownership nor protection (in the UNIX sense). Instead, the ownership and protection are set at mount time via mount options.use mount -t vfat -o umask=002 /dev/hda5 /mnt/win_d ######################## Linux Start-up ######################## first step is booting the kernel and initialize each device . type " dmesg " to see the kernel message. once device are initialized , kernel executes " /sbin/init ". everything init does is controlled by " /etc/inittab/ " inittab set the default runlevel and execute " /etc/rc.d/rc.sysinit " . then it run /etc/rc.d/rc with the runlevel as an argument. rc * runlevel as * is called. all command being called in rc * is symbolic link to "/etc/rc.d/init.d " now base on the commands from "/etc/rc.d/init.d , we can call /etc/rc.d/init.d httpd start or stop /etc/rc.d/rc.local is excuted after the other system-initializaion scripts are run. ( it is set to be an symbolic link in rc*.d file as S99local , since the file name , it is excuted at the last of rc*.d) we cam edot rc.local t oaccomplish any peculiar or otherwise out-of-place system commands at boot time, or if not sure where else they should be executed. ######################## Chinese linux ########################## install pth and unicon . since RH7.2 has Chinput installed in /usr/lib/Chinput/,no need to install it. here store the chinese gb and big5 fonts /usr/X11R6/lib/X11/fonts/TrueType creat .i18n file under home dir. add LANG="zh_CN" edit "/etc/X11/XF86Config-4" add Section "Files" FontPath "unix/:7100" FontPath "/usr/X11R6/lib/X11/fonts/TrueType" # is what we add. different than /usr/share/fonts/default/TrueType EndSection and in "module" section, add 'Load "xtt" ' disable ' Load "freetype" ' edit "/usr/lib/Chinput/Chinput.ad" edit lines as : chinput.font = 8x16 chinput.gbfont = -default-ming-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0 chinput.big5font = -default-ming-medium-r-normal--0-0-0-0-c-0-big5-0 用MOZILLA0.9也是要修改才可以支持chinput浮动的输入条的,就是把user_pref("xim.input_style","over-the-spot");加到~/.mozilla/..... 里面的一个prefs.js文件里面. ######################## Customize shell prompt ########################## type " echo $PS1 " shows the current setting of the prompt. To customize it, edit /etc/bashrc Here is an example on how to add colour. See the next chapter for details about colour: PS1="\[\033[1;32m\][\u@\h \W]\\$\[\033[0m\] " more about color on text terminal see bottom \\$ will make a # sign for root and $ for normal user \$ only make $ for both ######################## Color on text terminal ########################## echo -e "\033[44;37;5m ME \033[0m COOL" The above sets the background to blue, foreground white, blinking video, and prints " ME ", then resets the terminal back to defaults and prints " COOL". The "-e" is an option specific to the echo command--it enables the interpretations of the special characters. The "\033[" introduces the escape sequence. The "m" means "set attribute" and thus finishes the sequence. The actual codes in the example above are "44;37;5" and "0". Change the "44;37;5" to produce different colour combinations--the number/order of codes do not matter. The codes to choose from are listed below: Code Action/Color 0 reset all attributes to their defaults 1 set bold 2 set half-bright (simulated with color on a color display) 4 set underscore (simulated with color on a color display) 5 set blink 7 set reverse video 22 set normal intensity 24 underline off 25 blink off 27 reverse video off 30 set black foreground 31 set red foreground 32 set green foreground 33 set brown foreground 34 set blue foreground 35 set magenta foreground 36 set cyan foreground 37 set white foreground 38 set underscore on, set default foreground color 39 set underscore off, set default foreground color 40 set black background 41 set red background 42 set green background 43 set brown background 44 set blue background 45 set magenta background 46 set cyan background 47 set white background 49 set default background color Other interesting codes: \033[2J clear screen \033[0q clear all keyboard LEDs (won't work from Xterm) \033[1q set "Scroll Lock" LED \033[2q set "Num Lock" LED \033[3q set Caps Lock LED \033[15;40H move the cursor to line 15, column 40 \007 bell (beep) LEDs (="Light Emitting Diods) are the lights on the keyboard which indicate if , and are engaged. See man console_codes for more. ######################## Rogers@Home internet setting ########################## add " dhcpcd -h cr*****-a " at the last line of file /etc/rc.local ######################## Lba32 ########################## lba32 makes it possible to boot from partitions partially or completely above cylinder 1024 but this option is disabled by default. In order to use it , have to replace "linear" with "lba32" in /etc/lilo.conf ######################## Color on text terminal ########################## use chkconfig to disable/enable daemons : such as #Disable automounters chkconfig --level 2345 amd off #Disable unless this is a laptop chkconfig --level 2345 apmd off #Disable unless you want to run batch programs within certain loads chkconfig --level 2345 atd off #Disable unless you want emails of EVERY ARP on your network segment chkconfig --level 2345 arpwatch off #Disable unless you want boot diskless workstations chkconfig --level 2345 bootparamd off #Disable unless this machine will be a DHCP *SERVER* chkconfig --level 2345 dhcpd off #Disable unless this machine will be a full blown router chkconfig --level 2345 gated off #Disable unless this machine will be a WWW server chkconfig --level 2345 httpd off #Disable unless this machine uses a modularized kernel # NOTE: Not needed for 2.2.x+ kernels chkconfig --level 2345 kerneld off #Disable unless you really want to configure remote machines via Linuxconf chkconfig --level 2345 linuxconf off #Disable unless this machine will be a print server #(for the local or remote machine) chkconfig --level 2345 lpd off #Disable unless you really need the proprietary MC server chkconfig --level 2345 mcserv off #Disable unless this machine will be a database server chkconfig --level 2345 mysql off #Disable unless this machine will be a caching or full blown DNS server chkconfig --level 2345 named off #Disable unless this machine will be a NFS server chkconfig --level 2345 nfs off #Disable unless this machine is a laptop or the PC has PCMCIA cards chkconfig --level 2345 pcmcia off #Disable unless this machine will be an NFS server or needs RPC tools chkconfig --level 2345 portmap off #Disable all R-cmds chkconfig --level 2345 rusersd off chkconfig --level 2345 rwalld off chkconfig --level 2345 rwhod off #Disable unless this machine is a email server chkconfig --level 345 sendmail off #Disable unless this machine is a Samba (MS File&Print) server chkconfig --level 345 smb off #Disable unless this machine is to support SNMP chkconfig --level 2345 snmpd off #Disable unless this machine is a local/remote HTTP proxy server chkconfig --level 2345 squid off #Disable unless this machine will be running X-windows chkconfig --level 2345 xfs off #Disable unless this machine will be an NTP server chkconfig --level 2345 xntpd off #Disable unless this machine will be part of a NIS/YP domain chkconfig --level 2345 ypbind off chkconfig --level 2345 yppasswdd off #Disable unless this machine will be a NIS/YP server chkconfig --level 2345 ypserv off