SCMP 318 – Linux for Programming

Using the Linux for programming

Goal

Get Python and C++ working on your server

Links

Steps

1. Log into your server using a terminal

Windows:

Mac:

  • Start terminal
  • Use terminal to log into your server:
    ssh user@ipaddress

2. Install C++ on your server: How to install C++ on Linux

3. Install Python on your server: How to install Python 3 on Ubuntu

4. Install Atom.io on your computer and start Atom.

  • Go into Edit->preferences.
  • Click on “+Install”
  • Type “remote-editor” in the search bar:
  • atom.png
  • Click on “Install”
  • Go to Packages->Remote-Editor->Toggle and click
  • Enter a password (you much remember!)
  • Click on edit servers. Enter information for your server: (As shown). Use your information. Hit save
  • Server.png
  • If you click on the server name you can see all your files. (You can close other windows in Atom)
  • Right-Click on the server name and click “New Folder”
  • Delete the “/” and type “FirstProgram”
  • Right click on “FirstProgram” and click “New File”. Enter test.txt.
  • Add some txt
  • Select “File->Save”
  • Go to the terminal and verify that the folder and ile are there.

4. Create c++ and python your programs in Atom on your server in the new directory.

Program (hello.cpp):

// my first program in C++

#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!" << endl;
  return 0;
}

Python (hello.py):

print(“hello world”)

For each program in Atom

5. Run you programs:

C++:

g++ -o hello
hello.cpp 
./helloHello World

Python:

python3 hello.cpp
Hello World

Turn in:

  • A screenshot of your working program in the terminal
Scroll to Top