Setting up my Dev Environment ECS 030

Similar documents
You can use the WinSCP program to load or copy (FTP) files from your computer onto the Codd server.

CS 246 Winter Tutorial 1

Lab 1 Introduction to UNIX and C

1 Installation (briefly)

C++ Programming on Linux

#Uncomment the second line to enable any form of FTP write command. #write_enable=yes

Running MESA on Amazon EC2 Instances: A Guide

Coding in C at Home. Part 2 Computational Physics. April 21, 2016

Unix. Examples: OS X and Ubuntu

CS Operating Systems, Fall 2018 Project #0 Description

CS 261 Recitation 1 Compiling C on UNIX

CMSC 201 Spring 2017 Lab 01 Hello World

Using WestGrid from the desktop Oct on Access Grid

CS 1301 Fall 2008 Lab 2 Introduction to UNIX

Bitnami Apache Solr for Huawei Enterprise Cloud

Bitnami MEAN for Huawei Enterprise Cloud

Operating System Interaction via bash

Setting up a Chaincoin Masternode

Topics. What is a RaspberryPi? Why should I want one? What is Raspbian? What is SSH? What is FTP? What is LAMP? Making a LAMP Stack!

Introduction to Linux. Fundamentals of Computer Science

Using Ruby and irb in CSE 341 Winter 2015

VPS SETUP: What is a VPS? A VPS is a cloud server, running on a virtual machine. You can t run a masternode on your computer itself.

KB How to upload large files to a JTAC Case

CMSC 201 Spring 2018 Lab 01 Hello World

CSE 391 Editing and Moving Files

Getting Started With Cpsc (Advanced) Hosted by Jarrett Spiker

Oregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011

Session 1: Accessing MUGrid and Command Line Basics

Bitnami JRuby for Huawei Enterprise Cloud

New User Tutorial. OSU High Performance Computing Center

Ftp Command Line Commands Linux Example Windows Putty

Spring 2017 Gabriel Kuri

sftp - secure file transfer program - how to transfer files to and from nrs-labs

Siemens PLM Software. HEEDS MDO Setting up a Windows-to- Linux Compute Resource.

LOCAL WALLET (COLD WALLET):

Linux Tutorial #1. Introduction. Login to a remote Linux machine. Using vim to create and edit C++ programs

CS CS Tutorial 2 2 Winter 2018

Firewalls can prevent access to the Unix Servers. Please make sure any firewall software or hardware allows access through Port 22.

When you first log in, you will be placed in your home directory. To see what this directory is named, type:

Introduction: What is Unix?

Science One CS : Getting Started

Parallel Programming Pre-Assignment. Setting up the Software Environment

Projects and Environment Introduction

ENCM 339 Fall 2017: Editing and Running Programs in the Lab

Setting up PuTTY. Version Updated for 2015 Fall (with corrections)

Setting up PuTTY. Software* Downoad PuTTY. Download PuTTY Download the putty.zip file. It contains several programs for SSH, SFTP, and SCP.

How to Secure SSH with Google Two-Factor Authentication

Gradle and Command Line Workshop Activity

CS 1301 Lab 2 Introduction to Webservers at GaTech

Ftp Command Line Manual Windows Example Port 22

Setting up PuTTY. CTEC1767 Data Communications & Networking CTEC1863 Operating Systems CTEC1906 Internet Computing

STAT 625: Statistical Case Studies

Chapter 1 An Introduction to C++, Unix, SSH and Komodo Edit

How to SSH to nice.fas.harvard.edu from Windows

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

Unit: Making a move (using FTP)

Temple University Computer Science Programming Under the Linux Operating System January 2017

Contents. Crave Masternode Setup Guides. Single / Multiple Local Masternode(s) Single Masternode using a VPS. Multiple Masternodes using a VPS

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C

L.A.M.P. Stack Part I

R- installation and adminstration under Linux for dummie

Unit 13. Linux Operating System Debugging Programs

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

CS 642 Homework #4. Due Date: 11:59 p.m. on Tuesday, May 1, Warning!

Table Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands

ELE409 SPRING2018 LAB0

Bitnami ez Publish for Huawei Enterprise Cloud

Bitnami Ruby for Huawei Enterprise Cloud

Beyond this course. Machine code. Readings: CP:AMA 2.1, 15.4

Lab 1 Introduction to UNIX and C

Linux Survival Guide

Installing the WinSCP Secure FTP Client

Using a Linux System 6

Lab 1: Introduction to C, ASCII ART & the Linux Command Line

Bitnami HHVM for Huawei Enterprise Cloud

Getting Started with UNIX

Remote Access to Unix Machines

SONOTON storage server

Introduction to the Linux Command Line

EMC Greenplum Data Computing Appliance to x Software Upgrade Guide. Rev: A02

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

DogeCash Masternode Setup Guide Version 1.2 (Ubuntu 16.04)

UoW HPC Quick Start. Information Technology Services University of Wollongong. ( Last updated on October 10, 2011)

Course Wiki. Today s Topics. Web Resources. Amazon EC2. Linux. Apache PHP. Workflow and Tools. Extensible Networking Platform 1

Working Outside the Lab

RETROPIE INSTALLATION GUIDE

Bitnami MySQL for Huawei Enterprise Cloud

Introduction to Cuda Visualization. Graphical Application Tunnelling on Palmetto

Online Backup Client User Manual

ssh and handson Matsuzaki maz Yoshinobu 1

The Command Line. Matthew Bender. September 10, CMSC Command Line Workshop. Matthew Bender (2015) The Command Line September 10, / 25

Lab 2 Building on Linux

Helsinki 19 Jan Practical course in genome bioinformatics DAY 0

Chapter 1 An Introduction to C++, Unix, SSH and Komodo Edit

Bitnami Piwik for Huawei Enterprise Cloud

Saint Louis University. Intro to Linux and C. CSCI 2400/ ECE 3217: Computer Architecture. Instructors: David Ferry

SmartCVS Tutorial. Starting the putty Client and Setting Your CVS Password

Lab 1: Accessing the Linux Operating System Spring 2009

Carnegie Mellon. Linux Boot Camp. Jack, Matthew, Nishad, Stanley 6 Sep 2016

Transcription:

Setting up my Dev Environment ECS 030 1 Command for SSHing into a CSIF Machine If you already have a terminal and already have a working ssh program (That is, you type ssh into the terminal and it doesn t say it cannot recognize the command), simply type in the following: ssh username@pcxx.cs.ucdavis.edu Replace username by your CAS Kerberos username and xx by a two-digit number (I checked 10 and 12 and they worked, but you can choose any between 1-60). Once successful, the terminal would prompt you to input your password. Type in your Kerberos password for CAS and you should be able to login. For logging out the ssh session, type logout or exit. 2 How to Install SSH 2.1 Windows 1. Go to https://www.cygwin.com and download the setup.exe. Make sure that you make the right choice for 32/64-bit. Remark. Briefly speaking, cygwin is something that emulates a Unix-like environment on Windows. It includes, among a lot of other things, a terminal program where you can execute Unix commands like cd, ls, etc.. 2. Double click the setup.exe and begin the installation. Choose the following options during the process: (a) Choose Install from Internet at Choose A Download Source page. (b) Choose a root directory yourself. This will be the place which the going-tobe installed cygwin bash treats as its own root. For example, if you specify C:\cygwin64 as your root directory, /home/james will in fact be located in C:\cygwin64\home\james. (c) Choose All Users (the other option should also work, even though I haven t tested it.). (d) Choose a local package direcotry. This is the place cygwin stores all the files that are necessary for emulating the unix environment. (e) Select Direct Connection. (f) Select an available download site from the provided list. Any of them should work. I simply chose the very first one: http://cygwin.mirror.constant.com (g) The installer will grab some package listing info from the site you chose, and then open a package setup window. This window allows you to specify which packages to install. 1

(h) Under Net category, find the openssh package and click the Skip field of it. Make sure it changes to a version number and the checkbox of the Bin? column is checked. Basically, you need to install this ssh implementation, so that you can execute the ssh command once the installation completes. (i) Leave everything else unchanged (that is, the default option). Click Next button. (j) Wait until the installation finishes. I experienced an error message of incomplete download the first time, but a second trial succeeded. 3. After installation of cygwin completes, find the Cygwin64 Terminal program and open it (it should appear in the start menu if you told the installer to include an icon in the start menu ). Now you can pretty much treat this terminal as a Unix one and since you already installed openssh, you can ssh into a CSIF machine directly. Another option to connect to CSIF is the use of PuTTy. This application is a dedicated SSH client. The installation steps and usage is very simple. 1. Go to http://www.chirak.greenend.org.uk/ sgtatham/putty/download.html and download putty.exe file according to your installation. 2. Launch PuTTy by double clicking on the downloaded file. 3. In the Host Name (or IP address) box, type pcxx.cs.ucdavis.edu. Replace xx by a two-digit number from 1 to 60. 4. A security alert should appear the first time you connect to any given box. This warning is just to inform you about the rsa2 key fingerprint of the machine. You can safely click Yes. 5. The terminal should ask you for a login user. Use you Kerberos user and password. 2

2.2 MAC OS X MAC OS X should include a built-in SSH client that you can use directly in the Terminal. Simply type ssh to see what happens. It might prompt you to install other developer tools. In that case, just follow the instructions. 2.3 Ubuntu (Other Debain-based System) To install ssh. Open a terminal and type the command: sudo apt-get install ssh The above command uses apt-get, the package manager on Debian-based linux systems to automatically download and install ssh. For linux distributions that s not Debian based, google and check the corresponding documentation to find out what package manager they use and use them to install ssh. 3 Developing locally If for some reason you can not have access to the CSIF machines, you can still work on your homeworks locally in your computers. Although before submission we request that you test it in a CSIF machine, because we can not guarantee that what ever you have in your environment is applicable for CSIF. And given we will grade in the later, it is your responsibility to guarantee it will compile and run in CSIF machines. 3.1 Windows Windows systems provide a C compiler that can be downloaded when installing Visual Studio; an Integrated Development Environment. Although VS is a very nice tool, it regularly introduces a lot of special files and characters that makes development in C very complicated when doing cross platform development. Therefore we do not suggest you use this tool. Nevertheless if you decided to install Cygwin, you are in great standing! Given that Cygwin is a Unix emulator, it also allows you to install a C/C++ compiler as another of the options in the installation process. You just have to select the gcc-core and gcc-g++ packages under devel. 3

3.2 MAC OS X Mac machines already have a C/C++ compiler. Unfortunately it is not the same as the one used in CSIF. While CSIF uses GCC compiler, Mac has clang installed. This will not cause a lot of issues for the initial part of the course, given that the code is pretty generic. But as we move forward into more advanced topics this could become an issue. Therefore the recommendation for this cases is that once you think you are done with your code in your machine, test it in a CSIF machine via SSH as described above. 3.3 Ubuntu (Other Debain-based System) Linux machines also already have a C/C++ compiler, the only thing you have to be aware is the version. But that should not be an issue. If for some reason your terminal does not finds the gcc command, you can install it using the following commands. sudo apt-get update sudo apt-get install gcc-5 g++-5 3.4 Compiling To compile your code remember that you have to be in the folder locaton where your source code is located. You should get there through the cd command. Once there you can call the compilation command gcc mycode.c -o mycode This command will compile mycode.c file and create the mycode executable. If you ommit the -o option the executable will be named a.out. To execute the file just call it as follows../mycode 4 Text Editor The selection of a text editor is crucial so you are not facing weird unforseen errors down the road. You should choose the most basic ones in order to avoid the insertion of hidden characters in the executable code that could cause problems at compilation time. Here are a list of some editors you can check and choose from the one you feel most comfortable with. Notepad (Win) - A simple out of the box solution that is already installed in Windows machines. Notepad++ (Win) - A free source code editor that provides some higlighting functionalities for syntax and some tools for transfering your files from your local machine to a CSIF box. Simple, clean and FREE! Sublime (All platforms) - One of the best development tools you could ever get! It is a very mature text editor that provides tons of tools that eases the development and sharing of your code. Provides support for multiple languages for syntax checking as well as customization options. But with great power comes great... cost; this is not a free tool, but definitively is worth every penny. 4

Atom.io (All platforms) - An open source version of Sublime developed by GitHub. Just as Sublime this tool grants you great tools and support for multiple languages and customizations and is FREE! But as such, it does present some bugs. Nevertheless it is supported by one of the most dynamic communities of open source, so if you report any issue, chances are that they will be solved in a reasonable amount of time. If you decide to work directly on the CSIF machines via SSH, you also have some options available. These are the vi editor, nano and emacs. These are console based Text Editors. If you decide to use any of these, you can google their usage, because it is not as simple as any of the others. Having said that, being able to use any of these editors tells a lot about your programming skills. 5 Transfering files to CSIF Once you are done developing and compiling your code in your machine, you should test it in the CSIF machines. To do so you must first be able to send your source code to CSIF boxes. To do so, there are two commands you can try sftp or scp. 5.1 sftp This is the Secure FTP command that allows a safe connection between your machine and a CSIF box to transfer files. To connect to any given box you have to run the command sftp <username>@pc##.cs.ucdavis.edu Remember to substitute < username > for your user name and ## with a number between 1 and 60. This command will open the ftp console that allows you to put files into the location that you connect or get files from the remote location to your local machine. It is important to notice 2 things: The location where the files will be taken in order to be able to put them in the remote machine is the working directory where you call the sftp command. For example: Assume I have a file sample.txt at \home\user\mydocs, and a file named mycode.c at \home\user\code. If I placed myself into mydocs folder, I would not be able to get the mycode.c file to put it into the server. In the sftp prompt you can also use all the filesystem navigation commands that will allow you to navigate to any given folder in the remote machine in order to pull it to your local machine. This also applies for the placing of files from my local machine. To exit the client you just have to type the command exit and the sftp client will be closed. 5.2 scp This is the Secure copy command. This tool allows you to send files to a remote location, but does not allows you to get files from there. This is a great way to send your code from your local machine to the remote CSIF boxes. To use it, you call it as follows 5

scp [list_of_files] <username>@pc##.cs.ucdavis.edu:<remote_destination_path> Remember to substitute < username > for your user name and ## with a number between 1 and 60. The list of files can be any number of filenames placed in the relative location to the working directory where the command is executed. The remote destination path should be the place where you want to put the files you are sending. 5.3 Visual interfaces For Windows users there are two tools that could help with this task. These are Filezilla and WinSCP. Both tools are just front ends for both SFTP and SCP commands that allow you to do drag and drop between both machines and avoids you to have to rewrite the commands multiple times with slight variations. The setup for either is pretty simple and is available in ther download sites. 6 Final Remark The best way to learn how to configure and develop stuff is always to try them out and google them. Therefore, if you experience some difficulties you should always think about what exactly your operation has done and googled accordingly, instead of directly asking some seniors for help (Do not understand what sudo means in the above? Google that!). Believe it or not, no programmers can live without google and stackoverflow! 6