Writing Python Programs on a FreeBSD server
Connect to the server from a Windows PC
- Start the PuTTY program.
- If your Windows PC does not have PuTTY installed, you may download
it.
- If you are running Mac OS X, please see the next section
- Type "STU.ipv6.club.tw" as the Host Name, change the port number to
2018, and click Open.
- If this is the first time you connect to this server, it will pop
up a security alert window as follow. Verify the fingerprint is
58:0e:67:ae:10:55:bc:0b:da:c8:61:cd:c3:77:d3:de
and click Yes to accept.
- Type your username, press Enter.
- Type your password, press Enter.
Please notice that your password will not be
shown on the screen
while you are typing.
- You will see a welcome message, and the last line is "1 STU:~>".
This is the prompt of the server, which implies that it is
ready to get commands from you.
Acknowledgment: The following tips are provided with the courtesy of
Jaslin Tan Shi Yee.
- First go to Terminal (you can find it in Launchpad>Other) , and
type the command "ssh -p 2018 s1053210xx@STU.ipv6.club.tw".
- If this is the first time which you connect to STU from this
MacBook, it will ask you to confirm. Please type "yes" and press Enter. (Don't simply
type "y".)
- Then, the same as Windows PuTTY, type your password (which will not
be shown on the screen), and you will successfully log into the server.
Now you are ready to start writing programs on the server.
Edit a C program
- Type the name of an editor ("nano" or "vi"), and the filename you
want to edit.
- nano test.cpp
- nano chaos.cpp
- Press Ctrl-X to exit the editor and save the program file.
Compile your source program to an executable file
- Invoke the Clang C++ compiler
- clang++ ex2_00.cpp
- The default output file is "a.out". You may also specify the
output file name with an option:
- clang++ ex2_00.cpp -o ex2_00.exe
- Run the executable file
- Simply type the filename to run it.
- Unix does not require an executable file to have a special
extension name (.EXE), so be careful when you name it.
- You may type the command "ls" to list all files under current
working directory.
- Try to type the command "ls -F". With the option "-F", you can
see that executable files are designated with a tailing star (*).
- Solution 1: Enable IPv6 on your PC.
- Solution 2: Use the TWAREN SSL/VPN service to access "site-local" servers.