Jed Rembold
February 5, 2025
An extremely useful aspect of working in a shell is the simplicity with which you can connect to other remote systems
The program usually used to do so is called
ssh, standing for “secure shell”
To log into a remote server, the command looks something like:
ssh {user name}@{ip address or domain name}
where
user name is your user name on the
remote server (which may be different than your local
name)ip address or domain name is either the
direct ip address of the server (eg. 165.213.13.194) or the domain name
(myserver.net)-pexit to
leave the remote connection and return to your local shell
If you just need to run a quick command on the remote system, you
can do so directly from ssh
Simply add the desired command as the last
ssh argument
ssh username@server mycommand
To create a new key, you can use
ssh-keygen -t ed25519 -C {desc comment}
.ssh folder in your home directory: one with
just id_ed25519 and one with
id_ed25519.pubTo copy the public key over to the desired server:
ssh-copy-id {username}@{servername}
Often, you are connecting to the same servers again and again
Instead, you can set up “profiles” in your
.ssh/config file
A general profile entry might look something like:
Host {profile_name}
User {username}
HostName {domain name or ip address}
Port {port, if not default}There are more options and settings that can be configured. See
man ssh_config.
SSH + tee: The
tee command “splits” a stream, displaying it
both to stdout and writing it to a file at the same time. You can thus
do things like:
cat local_file | ssh remote_server tee remote_file
using normal pipes
scp: The
scp command combines normal
cp and ssh,
allowing you to include a remote server in the standard format
scp local_file remote_server:remote_fileThe previous options can be nice for just copying single files, but what if you need to copy over entire folders?
rsync is probably your best option
rsync -avP local_folder/ remote_server:remote_path
Common options
-a is for archive, and basically means:
“make a perfect copy”-v is for verbose, to output more
information as it is copied-P is for partial and progress, so that
partial transfers will resume and progress output to the screenI emailed you all earlier with a server address and login information. Use that to work through the following:
passwd. Note that when you type in
passwords on most shells, they will not show anything
for security but are indeed recording what you type..ssh/config file to facilitate connecting to
this server
SELECT * FROM table_a
JOIN table_b
ON table_a.key_col = table_b.key_col;
SELECT tab1.name, tab1.age, tab2.name
FROM tab1
JOIN tab2 ON tab1.age = tab2.age;
CROSS JOIN will return a table of all
of these possibilitiesLEFT JOIN
or RIGHT JOIN
LEFT JOIN is decidedly the more common,
and you can make any RIGHT JOIN a
LEFT JOIN just by flipping the table
orderingNULL values will be inserted for the
secondary table columns if it is missing a matchFULL OUTER JOIN will do
what you want
LEFT JOIN followed by
a RIGHT JOIN with the existing tableNULL values
First names of students who have submitted any assignment?

Student ID and name of the assignment for all perfect scores?

Number of assignments with no submissions?

All combinations of students and homework assignments?
ON statement!AND or OR, just
like you could with WHERESELECT *
FROM table1
JOIN table2
ON table1.col1 = table2.col1
AND table1.col2 > table2.col2;
ASFROM or
JOIN statementAS is optional, but it
helps some with readabilitySELECT *
FROM tablename AS tn
JOIN tablename2 AS tn2
ON tn.col1 = tn2.col2;
SELECT *
FROM tablename AS t1
JOIN tablename2 AS t2 ON t1.col1 = t2.col1
JOIN tablename3 AS t3 ON t1.col2 = t3.col1;

First names of all individuals who are missing at least one assignment (no submission made)?
