1336 Mhz iesun3 - Dept. of IE, CUHK Personal Web Server

Download Report

Transcript 1336 Mhz iesun3 - Dept. of IE, CUHK Personal Web Server

IE Lab Survival Course
Part I : Remote Desktop
Part II : IE Lab Survival
Part III : Understanding Your Machine
Remote Desktop




Allow you to control your computer in home / hall
from another location
Comes from Windows XP Professional
Windows XP Home users can try VNC
Generally, remote desktop performs much better than
VNC
Setting up Remote Desktop

Four steps




Enable remote desktop in Windows
Set a password
Configure firewall to allow it (if you have one)
Setup a dynamic DNS service
Enable Remote Desktop



My Computer -> Properties (Window-Break)
Remote -> Allow users to connect remotely to this
computer
If you are not administrator, you need to add your
user at “Select Remote Users…”
Set password


For security reasons, Windows only allow you to
remote login into users with passwords
If you don’t want to enter password when turning on
your machine physically, the tool Tweak UI can help



http://www.google.com/search?q=Tweak+UI&btnI
(by the way, this is “I’m feeling lucky”)
Go to Logon -> Autologon and set a default user
Configuring firewall

If you have a firewall installed, you must configure it
to allow remote desktop connections
Windows XP SP2 or above has built-in Windows
Firewall
Enable incoming connections to TCP port 3389

Some basic networking concepts





IP
TCP / UDP
Ports
IP

Computers are identified by IP addresses




Control Panel -> Network Connections -> double-click a
connection -> Support
Alternatively, you can run “ipconfig” in cmd.exe
192.168.x.x, 169.254.x.x and 10.x.x.x are “fake” IP’s
Think of your mailing address
TCP / UDP

Messages sent to your computer usually come in two
different “protocols” – TCP and UDP





Web browsing (HTTP) : TCP
Email (SMTP) : TCP
Remote Desktop : TCP
Warcraft 3 : UDP
Think of postal mail and packages
Port


Your computer received a message, but which
program is it for?
Programs are identified by “port”, a number between
1-65535





Web servers : TCP port 80
Email : TCP port 25
Remote Desktop : TCP port 3389
Warcraft 3 : UDP port 6112
Think of the name written on envelopes
Now have a try

Start -> Programs -> Accessories -> Communications
-> Remote Desktop Connection


Find your IP address and connect to it


Alternatively, use Start -> Run (Window-R) -> “mstsc”
Do not use localhost / 127.0.0.1 to test
Couple of useful options



Display -> Full screen
Local Resources -> Local Devices -> Disk Drives
Enabling “Disk Drives” also allows you to copy and paste files
between local and remote machines!
Dynamic DNS service

For some ISP’s (and Resnet), your IP address
changes every time
Can we have a fixed “name” like yahoo.com ?
This is called DNS – Domain Name Service

Go to cmd.exe and run “ping yahoo.com”


C:\temp>ping yahoo.com
Pinging yahoo.com [216.109.112.135] with 32 bytes of data:
Reply from 216.109.112.135: bytes=32 time=360ms TTL=49

Even if the IP address changes, the domain name will
redirect you to the right machine
Dynamic DNS service

Two free services



DynDNS
No-IP
Demonstration…
IE Lab Survival Course
Part I : Remote Desktop
Part II : IE Lab Survival
Part III : Understanding Your Machine
Machines in IE network

WinXP machines




IEUGPxx
1008PCxx
Weird names such as A5, C2,
D6…
Solaris machines



Operating system is Unix
iesun2 ~ iesun11
iesun3 should be the fastest
Machine
Speed
iesun2
3x296 Mhz
iesun3
1336 Mhz
iesun4
400 Mhz
iesun5
502 Mhz
iesun6
550 Mhz
iesun7
400 Mhz
iesun8
333 Mhz
iesun9
400 Mhz
iesun10
333 Mhz
iesun11
550 Mhz
Command: psrinfo -v
Machines in IE network

Servers








samba-srv, samba-srv2 – U:
ielabnt0 – M:
iepclan – X:
printsrv – print server
gateway – SSH gateway
gateway2 – SFTP gateway
personal – web server
…
Windows XP tips


Where to put your working data?
Desktop, My Documents, etc are stored in your
“profile”, which is cleared when you login/logout


U: is no good for large files




Don’t put important files there as they are lost if your
machine hangs / reboots
Network drive = slow
The drive is reliable, but the connection isn’t
Many people have lost data when saving files to U:
C:\temp is quite good


Fast, stable, not wiped out at reboot
Remember - it is cleared every 6:00 / 6:30 am
Windows XP tips

U: is actually a share folder on samba-srv


A share folder has two parts – name/IP of the server, and
name of the share
You connect to it as a network drive




My computer -> Tools -> Map Network Drive
Server : samba-srv
Share : <your username>
Or in cmd.exe


net use u: \\samba-srv\<username>
To disconnect


My computer -> Tools -> Disconnect Network Drive
net use u: /delete
Windows XP tips


You can connect to someone else’s U: !
You have to do it in cmd.exe



net use v: \\samba-srv\<username> /user:<username>
It will prompt for a password
Handy when working on group projects
Solaris tips


Do you even know they exist?
Most common use is FTP to U:


But you can also connect to a unix shell with




Use SSH File Transfer Client or some FTP software to
connect to gateway2.ie.cuhk.edu.hk
PuTTY (recommended)
SSH Shell Client
Inside CU (or with CU VPN) : iesun??.ie.cuhk.edu.hk
Outside CU : gateway.ie.cuhk.edu.hk, then run

ssh iesun??
Solaris tips

Usage




Do Unix programming
Write PHP/Perl/Python programs
Setup website
Check U: quota
iesun3 ~> quota -v
Disk quotas for tng6 (uid 22989):
Filesystem
usage quota limit
/data/grad
330260 500000 500500
timeleft
files
5176
quota
8000
limit
8100
Website setup

You can setup your website there


Example: http://personal.ie.cuhk.edu.hk/~tng6/
Steps





Create public_html folder in U: or by SSH-ing to gateway2
Upload files into public_html folder
For folders, set “others” permission to read+execute (705)
For files, set “others” permission to read (604)
Usually the default setting is ok
Website setup


Directory listing is by default disabled
To enable, create a file named “.htaccess” (yes,
beginning with a dot) under public_html with the
following:
Options Indexes

More advanced configurations:
DirectoryIndex index.htm index.html index.cgi index.php
Options Indexes ExecCGI FollowSymLinks
IndexOptions FancyIndexing NameWidth=* FoldersFirst IgnoreCase
SuppressDescription
RewriteEngine on
RewriteRule ^wiki/?(.*)$ /~tng6/w/index.php?title=$1 [L,QSA]
IE VPN


You should be familiar with CU VPN
In fact, there is an IE VPN as well




Allow you to access FYP lab machines and U:


Server: rlabvpn.cuhk.edu.hk
Username: <IE username>
Password: <Windows/Unix password, I forgot>
net use u: \\samba-srv.iepclan.ie.cuhk.edu.hk\<username>
/user:<username>
We used to be able to access M:, but it seems no
longer working
IE VPN



Principle of VPN?
Actually, every network card (instead of computer)
has an IP address
VPN is like creating a virtual network card with a long
long LAN cable connecting your machine and the VPN
server
IE VPN

When connecting to samba-srv…



samba-srv.iepclan.ie.cuhk.edu.hk is a domain name
Windows resolves it by DNS and get 192.168.100.251
Windows consider the three network interfaces (cards)





203.218.123.234
137.189.210.251
192.168.58.51
192.168.58.51 “matches best” with 192.168.100.251, so it
connects through IE VPN
Not entirely accurate, but the idea is like that
IE Lab Survival Course
Part I : Remote Desktop
Part II : IE Lab Survival
Part III : Understanding Your Machine
Why?

Help eliminate repetitive tasks


Know how to utilize existing tools in creative ways



DOS commands?
Registry editing?
Make your computer run more efficiently


Computers are supposed to simplify stuff, but without proper
understanding it just make your life harder
No need to upgrade so often, wonderful $$ savings!
Fix common problems by yourself
Important concepts in Windows

Filesystem




Don’t worry, not talking about NTFS today
Registry
Processes
Services
Filesystem

Foundation of your machine

Everything you run, everything you see (or don’t) exists
somewhere in the filesystem

Knowing which files are which can be very helpful
Essential if you want to learn DOS commands

Tips




Set fixed pagefile size
Proper partitioning and defragmentation
Set very small browser cache
Registry

A place for programs and Windows itself to store
settings and run time information






HKEY_CLASSES_ROOT : filetype information
HKEY_CURRENT_USER (HKCU) : your own config
HKEY_LOCAL_MACHINE (HKLM) : machine-wide config
HKEY_USER contains the configuration for all users, one of
the subkeys is mapped to HKCU
HKEY_CURRENT_CONFIG contains run time information, e.g.
hardware information, running services; don’t modify
Tips


Show filename extensions in explorer
Keep an eye on Software\Windows\CurrentVersion\Run
Processes


You can think of processes as “running programs”
Bring up task manager and look at them one by one



If you are familiar enough with your own machine, you can
identify suspicious programs easily
Google is your friend
Tips


Keep the task manager icon in system tray
Watch the columns CPU usage, Virtual Memory size, Read
and Write bytes
Services

Services are essential components that keep your
machine operational







DNS
Networking
File and printer sharing
Windows update
And many others
Not readily visible from task manager
But there are also a lot of useless services that waste
CPU time and memory


You can get rid of them from services.msc
Warning : be very, very careful!
Useful tools

Msconfig


Tweak UI


Change many “hidden” settings
Process Explorer


Control what programs are run on startup
Get detailed information on running processes
Treesize Professional

Nice overview of your disk usage
Thank you!

Any questions?