Technical Tips

Enquiry : Mr.Jason Chan (mwchan@phy.cuhk.edu.hk, Rm348)


1. How to customize my login environment

Your login shell should be a C-Shell (csh), every time you login, a file ".login" in your home directory will be executed. Also, each time you create a new shell or terminal, a file ".cshrc" will be executed.

Use any text editor to add any task you want to invoke every time you login or create a new shell by modifing .login & .cshrc

e.g. If I want to invoke a program "newmail" once (tell me when a new mail arrived) when I login :

e.g. If I want to set IMSL environment variables in all C-Shell that I created :

After modifications, you can take the changes immediately by :


2. How to check my disk quota

Login sun1, type "quota -v". You will see the soft-limit, hard-limit & your current disk usage in KiloByte.

If you exceed the soft-limit, the system will give you 24 hours to clean up some files. After 24 hours, your account will be locked if the usage is still over the limit.

If you exceed the hard-limit, the system will lock your account immediately.


3. How to change my password and add finger information

Change your password by this command : yppasswd

Some Rules on your Password :

You can get informations of a person on the network by using "finger" (e.g. finger kkchan)

You can also let others know more about you & your current work when someone "finger" you!

You can create two files .project & .plan in your home directory, then those informations will be printed when someone try to finger you. e.g. :

In .project file (only one line information) :

In .plan file (can be multi-lines) :


4. How to print my file on network printer

There are 5 HP laserjet printers, 2 color deskjet printer and 1 color laserjet printer connected to the network :

  Printer  Location           Charges/Page   Color/BW?     Postscript?
  --------------------------------------------------------------------
  lj326a   Rm326                HK$0.3/A4       BW            Yes
  lj328    Rm328                HK$0.3/A4       BW            Yes
  lj216    Rm216                HK$0.3/A4       BW            Yes
  lj204    Rm203a               HK$0.3/A4       BW            Yes
  ljg11    RmG11                HK$0.3/A4       BW            Yes
  dj326    Rm326                HK$1.0/A4       Color          No
  dj216    Rm216                HK$1.0/A4       Color          No
  clj108   Rm108 (Gen.Office)   HK$4.0/A3       Color         Yes

You can use "lpr" to print file

For example, print a file on lj326 :

> lpr -Plj326 myfile

Check the print job on the lj326 print queue :

> lpq -Plj326

Delete print job :

There is a control PC beside the laserjet printer, you had to delete your print job from the control PC. Press [F1], select your job, then press [Del]


5. If the BackSpace can delete char., many strange char. on the terminal......

When you press [BackSpace], it can erase the previous character, but ^H or ^? instead, you can simply correct this error by : Press [Enter] [BackSpace] [Enter]

If you find many strange characters occur on your terminal, it is most properly that you have set a wrong terminal type, please try :

On SUN Terminal : > set term=sun-cmd

On HP Terminal : > set term=hp

On other terminals : > set term=vt100


6. How to forward my email automatically / tell the sender I am on vacation

Forward incoming emails to other places :

Create a file ".forward" in home directory, add the email address(es) in this file, then set home directory to all executable & set .forward to all readable :

Examples of .forward :

Set the correct permissions :

Automatically reply the incoming emails, tell them I am on my vacation :

Type "vacation" on the command line. Then, this program will let you type in messages that will be automatically sent to all senders. The messages are saved in a file .vacation.msg and you can edit it afterward. Also a .forward file is created and the vacation program activates.

If you want to deactivate the vacation program, just delete the .forward file.


7. How to remote login other workstations / run program on remote machine

Use "rlogin" or "telnet" to remote login other UNIX machines. For example :

(remote login axp1 with the same account)

(remote login axp1 with another user account)

Use "rsh" to remote execute a program on other UNIX machines. For example :

(remote execute a program on axp1)


8. How to re-direct display on remote computer on local console

If you remote login another workstation and run an window application on the remote machine, then you must re-direct the display to the local console. Otherwise, you will not see the application display.

For example, you are on axp1. Remote login sun2 and run netscape on sun2 :

(add X-window permission that allow sun2 display onto axp1)

(remote login sun2)

(re-direct sun2 display to axp1 console)

(run the X-window application)


9. How to use CUHK phonebook system on workstations

Two ways to use the CUHK phonebook system :

If you are on SUN workstations, type "ph"

On any other machines :


10. How to create my WWW home pages

Step 1 : In home directory, make a sub-directory "wwwdocs"

Step 2 : In wwwdocs sub-directory, create your 1st WWW page "index.html"

Step 3 : Place all images, HTML files under ~/wwwdocs

Step 4 : Make all files & directories to all readable

Step 5 : Email to Jason Chan to let him know your 1st WWW page is ready.

For more informations about how to write a HTML file : A Beginner Guide to HTML

For quick reference of HTML : Quick Reference of HTML


11. How to set password on my WWW pages

Step 1 : Make a sub-directory for your secure files

Step 2 : Create a file .htaccess in that sub-directory

Step 3 : Create password file in the same directory

("-c" means create a new file .htpasswd, also enter passwod for peter)

(Enter password for mary)

Step 4 : Change the files/directory to all readable

Then, all files under ~/wwwdocs/confidential will ask for login name & password.


12. How to book the computer facilities

Only staff and tutors can book the computer facilities. Students can through their supervisors to book. Please goto the intranet site for booking affairs - http://www.phy.cuhk.edu.hk/intranet/

Current Computer Facilities that can be booked :


13. How to block the unwanted emails

You can now block all the unwanted incoming emails by your own defined word phrases by creating a file at your home directory called ".block_mail" and putting any phrases (e.g. email addresses, machine hostname, subject title, sender's names etc..) one per line into it.

The email server will scan all your incoming emails' HEADER LINES, which included Subject, From, To, Cc, Date, Receive-Path and other header information, and block mails which matched either one of .block_mail lines. (It will not check the email contents)

And there is a log message of blocked email appended to file .block_log at your home directory.



Below is the sample file of .block_mail :
==
GET OUT OF DEBT
Lucky Draw
canvasrepros@hotmail.com
drrose@pulford.ru
financebuy77
orac01.hae.de
jose_luis_argent@lycos.com.ar
mailgen@sglc.com.sg
==