320 likes | 491 Views
Intro to Programming Environment. Today You Will. Learn how to connect to a machine remotely with “nomachine NX client” Learn how to create a new “source file” with an editor (gedit) Learn how to edit a perl program Learn how to execute a program You will learn some basic Linux commands.
E N D
Today You Will • Learn how to connect to a machine remotely with “nomachine NX client” • Learn how to create a new “source file” with an editor (gedit) • Learn how to edit a perl program • Learn how to execute a program • You will learn some basic Linux commands
Background • Our development platform of choice is Linux (specifically Open Suse) http://en.opensuse.org (if you are curious) • Our interpretor of choice is perl http://www.perl.org/(if you are curious) • Why do we have to use Linux when XP/MacOSX/Vista/Sun is the best OS and Bill Gates/Steven Jobs/Scott MacNealy is the smartest/richest person in the world?
Linux • Reasons for using Linux: • Open source means we have access to every line of code • Open source means we have control over the OS • Cost • Uniform platform (that way when you write your program on Linux and you get it to work, the TA can run it on Linux and it will also work) • The college of engineering is currently supporting this platform
For subsequent connections, you only need to use the “NX Client for Windows” The FIRST time you connect, you will use the “NX Connection Wizard”
Check this box if you want a Shortcut created on your desktop
Click to close annoying “Useful Tips”
Click here to Open menu
Click on Applications then Utilities Scroll down: HINT – if you don’t get the scroll bar – you can just use the “arrow down” on the keyboard. Click on “Utilities”
Select “Text Editor gedit”
Type in file name – hello.c The “dot-c” is a convention to specify that this is actually a “C” source file Enter file name: Note – the procedure for saving files in discussion will be slightly more complicated – the TA’s will cover that in discussion
Now select “Applications” --> “System” “Terminal” “Terminal Program Konsole”
Your screen will look something like this.
ls – command lists all files/directories Note the “hello.pl” file Also – you are likely to have different files in your account (my directory is a mess and should probably be “cleaned up.”)
Unix and Linux basics: • ls – list files and directories • perl – invoke the interpreter • gedit – start our editor from the command line • mkdir dir1 – make a directory with the name “dir1” (aka called folders by Windows and Mac users) • cd dir1 – navigate down one directory level to “dir1” • cd .. – move up one level in a directory structure • rm hello.pl – this will permanently remove the file “hello.pl” CAUTION – once you do this – there is NO getting your file back (you can also rm a directory once it is empty of files) • There is also a way to rm multiple directories/files – but maybe we’ll show that at a later time
Navigating a File System • Students tend to be more comfortable navigating a file system with Windows because of the graphical representation • Ex.) My Computer (C:) Local Disk Documents and Settings , etc…. • However, the concept is the same with Linux • cd My Computer/Local Disk/Documents and Settings • You can navigate “down” (or up) multiple levels with “cd”
Your CSS account and “home” • All CSS accounts have a “home” directory • cd – without any parameters always takes you to your “home” directory • pwd – print working directory Note that if you perform ‘pwd’ before you ‘cd’, you will see a “strange’ home directory – this has to do with how the drives are shared across the network. These are in fact the same directory. After you ‘cd’ – you will always see /usr/eng/tbraun $ cd $ pwd /usr/eng/tbraun $ pwd /nfs/server00/local/vol00/t/b/tbraun
Making a directory, and traversing mkdir EPS2 cd EPS2 mkdir hw1 cd hw1 gedit hw1.pl (save and quit) cd cd EPS2/hw1 cd ..
ENDING your session After you click the little red button below – after a few seconds, this entire window will close. To end your connection – click this little red button
Connecting from off-campus • You may download and install the “NX client” from virtually any machine including PC, Macs, and Linux http://www.nomachine.com/download.php Select “NX Client for Windows” if you are using Windows, etc.
Other ways of doing things • You should play around with the desktop. • You will find there are multiple ways to navigate (try My Computer -> My Home Folder)