- as root, edit /etc/xinetd.d/telnet. set “disable = no”.
- under the user home directory, put .rhosts there, and set it to mode 600. One example line in .rhosts file can be “hostanem userid”.
- check /etc/xinetd.conf file, /etc/xinetd.d/rlogin and /usr/sbin/in.rlogind are there.
April 9, 2004
Setup rlogin
Add second new hard drive
- As root, go single user:
telinit 1 - Partition new disk with tool, such as fdisk.
- Format new hard drive partition(s):
mkfs -t ext2 /dev/hdc1
Provide device and filesystem as appropriate for your system or your
choice. - Mount new hard drive:
mount -t ext2 /dev/hdc1 /mnt/newdisc
- Edit /etc/fstab to include new mount point:
/dev/hdc1 /mnt/newdisc ext2 defaults 1 2
- Or you can go to http://www.tldp.org/HOWTO/mini/Hard-Disk-Upgrade/ to find more information.
- Or these are two messages in Google Groups: MSG1 and MSG2
Setup cvs server
- as root, create the source direcory, and run “cvs init”. This will create CVSROOT directory.
- set the correct value to CVSROOT inside your login batch
file, such as in my .cshrc, I say “setenv CVSROOT /src/master”. - for importing into the source repository, first go the directory with the sources, and run “cvs import test yoyo start”.
- for checking out, after set correct CVSROOT, do “cvs update -d” or “cvs co [source module name]”.
- for create a personal branch, do “cvs rtag -b [branch name] [souecr module name]”, and then run “cvs update -r [branch name]”.
Or you can go to cvs document page to take a look.
Tag and Create a new branch
- cd an_up_to_date_working_copy
- cvs tag main_1_0
Create a branch and put the working copy on it.
- cvs tag -r main_1_0 -b B_1_0_branch
- cvs update -r B_1_0_branch
Make the changes for customer B, and commit them as you go. Because your working copy has a sticky tag from the “update -r B_1_0_branch”, your commits go to that branch instead of the trunk.
When your branch is good, tag it too.
- cvs tag B_1_0
You can now go to a clean directory and export revisions main_1_0 and B_1_0 for shipping.
Return to your working copy and put it back on the trunk.
- cvs update -A
All your “B” changes are gone, you are back to the mainline. Proceed with normal development. When your mainline is ready to ship again, tag it.
- cvs tag main_1_1
Now the fun part: you create a new branch for customer B and recreate all the changes you made the first time.
- cvs tag -r main_1_1 -b B_1_1_branch
- cvs update -r B_1_1_branch
- cvs update -j main_1_0 -j B_1_0
- # fix conflicts
- cvs commit
The “update -j -j” does most of the work for you, but it’s not foolproof so you have to manually inspect and test your sources. You’ll be surprised how little damage you have to fix. When you’re happy, tag the tip of your new B branch.
- cvs tag B_1_1
- cvs update -A
The process repeats after the second release. Tag, create new branch, merge the previous branch to it. You have to be very clear about the use of those branches: all development happens on the trunk, the “B” branches are *only* for customer-specific variants. You never merge these branches back to the trunk.
(In truth, you should also have bugfix branches for the normal code you ship, but that’s an easier pattern to master than the stepladder of branches I just described. Stick to the hard stuff for now… 🙂
When your mainline is ready to ship, tag it. You have to do this anyway to remember what you shipped.
Setup DHCP server
- on Linux DHCP client machine, run “dhcpcd -k” to send DHCP_RELEASE signal. run “dhcpcd” or “dhcpcd -h hostname” to get an ip from DHCP server
- on Linux DHCP server machine, run “cp /usr/share/doc/dhcp-/dhcpd.conf.sample /etc/dhcpd.conf”
- “edit /etc/dhcpd.conf”
- “touch /var/lib/dhcp/dhcpd.leases”
- “/usr/sbin/dhcpd eth1”
- for more detailed information, try DHCP Server Help
Setup NFS
- on the Linux server machine, edit /etc/exports, adding a line “/vol shanghai(rw) chuangchun(rw)” at the end; and run “/etc/init.d/nfs restart”
- or on the Linux server machine, following the steps as stated here – NFS Howto
- on the client machine, (can be a Unix or a Linux system), run “mount (SERVER_IP_ADDRESS):(SHARE_DIRECTORY) (LOCAL_SHARE_DIRECTORY)”; or on the Linux client machine, to mount file systems at boot time, edit /etc/fstab, adding a line “wenji:/opt
/mnt/shared/opt nfs rw 0 0” at
the end.
Setup Samba
- go http://www.samba.org,
and download the most updated stable version of samba for my redhat linux 6.0 system - untar the download file. If it is in rpm format, use “rpm –install” or “rpm –upgrade” to install the samba package.
- create a file, called /sbin/startsmb, and make it executable
#!/bin/sh
/usr/sbin/smbd -D
/usr/sbin/nmbd -D -G SIEGE
(the last word “SIEGE” is your Workgroup name. and if you want to start samba automatically at boot time, create two soft links under /etc/rc.d/init.d and under /etc/rc.d/rc5.d) - configure the /etc/smb.conf file.
- run /sbin/startsmb, that’s almost it on linux side
- On Both Windows 2000 and Windows 98 systems, set the computer name and workgroup name.
- I also installed NetBEUI Protocol on the network card talking to my linux box. I know that’s a must for Windows 98, but not sure for Windows 2000
- On Windows 2000, go Control Panel –> Users and Passwords –> Advanced –> Advanced –> Users –> Guest –> Properties –> unset “Account is disabled”, which make guest accout enabled
- on Windows 2000, I have also added a Windows component, Internet Information Services (IIS). Again, I don’t know whether this is a must or not. However, after installing IIS, I can ftp to my Windows 2000 now.
- So, that’s it. Now, from my linux box, I can see all the shared files and use shared printer on my Windows system. From my Windows system, I can see all the shared files defined in /etc/smb.conf. I can just click the files and edit them or winzip them directly on Windows. People won’t notice the files are on another computer. Is that beauty? ENJOY!
I am running samba on redhat linux 6.0. Then I tried to use samba to talk to another computer running both Windows 2000 and Windows 98.
Setup display remotely on X server
- on the server machine, run “xhost +(CLIENT_IP_ADDRESS)”.
- on the client machine, run “setenv DISPLAY (SERVER_IP_ADDRESS):0”.
- on the client machine, run the program.
Some useful commands
- ssh -v -g -l user_name -L local_port:remote_ip:remote_port remote_ip
Check for disk space
- df -kl
- du -sk *
- gcj –classpath . -g0 –main=HelloWorld -o HelloWorld.exe HelloWorld.java
- dig -mx yahoo.com
- nmap -sT 127.0.0.1
- /usr/include/sys/errno.h
- HEAD http://yad2yad.huji.ac.il/
- Result:
200 OK
Cache-Control: max-age=0
Connection: close
Date: Tue, 10 Dec 2002 08:38:37 GMT
Server: AOLserver/3.3.1+ad13
Content-Type: text/html; charset=utf-8
Setup port forward
translating a Java source file into a native executable using the GNU GCJ compiler
DNS lookup utility
Network exploration tool and security scanner
UNIX system error.h
returns the HTTP response headers from the named site
Setup xemacs
- Go to download 3 xemacs packages: “xemacs-21.1.9.tar.gz”, “xemacs-21.1.9-elc.tar.gz”, and “xemacs-21.1.9-info.tar.gz”.
- Expand the above files into the directory used for compiling, e.g. gzip -dc xemacs-21.1.*.tar.gz | tar xf -.
- Change to the directory where you expanded the files, e.g. cd /usr/src/xemacs-21.1.9.
- Type ./configure ; make.
- After the compile finishes, switch to the root account and type make install.
- Go to download another xemacs packages: “xemacs-sumo.tar.gz”.
- Expand the above files into /usr/local/lib/xemacs/xemacs-packages/. If you would prefer to install these in a different location, set the EMACSPACKAGEPATH environment variable to your preferred location, and then expand the files in the directory in the variable. Don’t forget to export the variable, and to add it to the appropriate startup script!
- Start XEmacs by typing xemacs.
Or you can go to this official insallation help page . There is
a little bit difference from what I said above. Combining them together probably is the best choice.GOOD LUCK!
Change Prompt in bash or tcsh
- for bashrc
# .bashrc
# very basic
#export PS1=”\w: ”
# basic with time
export PS1=”[\@ \u] \w: ”
# blue background
#export PS1=”\[33[44m\](\@) \w: \[33[44m\]”
# basic yellow
#export PS1=’\[33[0;33m\](\n\@) \w :33[0m\]’
# yellow
#export PS1=”[33[0;33m\]\u@\h \w]\\$ ”
# WHITE=”\[33[1;37m\]”
#export PS1=”[33[1;37m\]\u@\h \w]\\$ ”
#Black=
#export PS1=”[33[0;30m\]\u@\h \w]\\$ ”
#Blue
#export PS1=”[33[0;34m\]\u@\h \w]\\$ ”
#Green
#export PS1=”[33[0;32m\]\u@\h \w]\\$ ”
#Cyan
#export PS1=”[33[0;36m\]\u@\h \w]\\$ ”
#Red
#export PS1=”[33[0;31m\]\u@\h \w]\\$ ”
#Purple
#export PS1=”[33[0;35m\]\u@\h \w]\\$ ”
#Brown
#export PS1=”[33[0;33m\]\u@\h \w]\\$ ”
#Gray
#export PS1=”[33[0;37m\]\u@\h \w]\\$ ”
#DarkGray
#export PS1=”[33[1;30m\]\u@\h \w]\\$ ”
#LightBlue
#export PS1=”[33[1;34m\]\u@\h \w]\\$ ”
#LightGreen
#export PS1=”[33[1;32m\]\u@\h \w]\\$ ”
#LightCyan
#export PS1=”[33[1;36m\]\u@\h \w]\\$ ”
#LightRed
#export PS1=”[33[1;31m\]\u@\h \w]\\$ ”
#Yellow
#export PS1=”[33[0;33m\]\u@\h \w]\\$ ”
#White
#export PS1=”[33[1;37m\]\u@\h \w]\\$ ” - For cshrc on unix, using
set prompt=\[`/usr/xpg4/bin/id -nu`@`hostname`’ %~’\]\$’ ‘