Lots of upperclassmen will tease you if dont know how to navigate your tools. This is not to say they wont help you learn them though!
So here I have tried to compile some tools I have found helpful.
First we must generate a public/private key pair. If you want to know more about this you will need to look more into RSA encryption. For this the command is: ssh-keygen. But without the period, maybe it seems silly but I have been the college student mistyping commands because I thought the period was part of it. Now this command is going to ask you where to store it so make sure you know where your home directory is and store it in /home/.ssh/stu.cs.jmu.edu and no need to give it a password.
Before we add the key into our authorized key file let's add some information to our ssh config. Place the following information but with your e-id
Host * ServerAliveInterval 30 ServerAliveCountMax 120 AddKeysToAgent yes IdentitiesOnly yes Host stu HostName stu.cs.jmu.edu IdentityFile ~/.ssh/stu.cs.jmu.edu User e-id Host w3 User e-id IdentityFile ~/.ssh/w3.cs.jmu.edu ProxyJump stu
Now let's ssh into stu to edit our authorized keys!
In order to edit this run the following command: vim ~/.ssh/authorized_keys
Then paste the contents of the contents of your public key e.g. the stuff we just generated e.g. paste the contents of /home/.ssh/stu.cs.jmu.edu.pub
If you dont quite know where to get this you can type : cat /home/.ssh/stu.cs.jmu.edu.pub and then copy and paste
So lets say that you have created a git repository or maybe your teacher created on for you for some assignment.
The first step is to clone the repository so you can add your code to it from your machine. To do this you need to go the the github page and you should see a clone or download button in the top right. Copy the link to it.
Now back in the command line type "git clone link" where link is the appropriate place. Note that this will create the repository wherever you are so make sure you are located in the directory you want.
If you dont have a repository created yet but instead need to initialize on you would type "git init".
Now what is the process of adding code to the repository:
git status
tells you the current status of your local repogit add *
this means adds all my files you can add just specific files by saying "git add hi.py" This specifies which files are going to be added to the repositorygit commit -m "a message descriping your changes"
Now this command will commit your changes to your local repository but doesnt make changes to the remote repositorygit push
this will push your changes to the remote repository
Now these are the commands you will need for your own repository. If this is a repository with multiple team members you will need one more.
Lets say your teammate made changes to your group's code and now you need the most up to date code. you would say "git pull". Everytime you are about to push code to a shared repository you need to call this command. This could lead to merge conflicts meaning there were changes that were made while you were working on the same code. You would need to fix this conflicts and then push your code.
There are a plenty of commands that are out there but these are the mains ones that you would be using. The only other one I have touched is "git checkout" and this is to "checkout" a branch but I will leave it up to you to learn what that means.
One of I have just recently learned about is "git diff". You can use this in multiple different ways. One way is you have made some changes git diff will tell you where these changes are and whether they are addition or subtractions. Happy coding!
Unfortunately, I do not know much about this command but look forward to the opportunity to learn more about it.
For now I will provide what I do know. So there are two different file transfer commands scp and ftp. You always want to use scp because it is secure. So to transfer a file from stu to your machine you would type in the terminal "scp e-id@stu.cs.jmu.edu:path-to-file place-you-want-it" The last part of the path to file will be the /fileName.extension. It is very important that you dont add a space before your path-to-file. Also you can say "." to mean place it where I am currently located. If you want an entire folder instead of a file it is the same command with a -r meaning recursive (I believe) so you would say "scp -r e-id@stu.cs.jmu.edu: path-to-file place-you-want-it" Now stu is just a host. So you can scp from other hosts but this is all the information I can provide you with
I do not know too many VIM commands but I do love knowing it. For example, when you ssh into stu you cant use text editors that are downloaded on your local machine such as gedit. But.... VIM is there and so that is really convenient because then I can edit files in current time. You could scp the file but then if you want changes on stu you'd have to find some way to get those changes onto stu. Below are the commands I know and in front of Dr. Lam's office he has a sheet with plenty more.
To open tmux you just type "tmux" in a terminal
cd directory
stands for change directory and will move you to the directory you specify e.g. cd Desktop/Cs354
means go to my desktop and then my CS354 folder ls
stands for list and will list the items in your current directoryll
will lists all items in your current directory including hidden filespwd
stands for the path of your working directory and will give you the entire path of where you are currentlymv this-file to-here
stands for move what I specify to my specified spot e.g. mv Desktop/Cs354/hw1.py .
means move my hw1.py file in the Cs354 folder located on my desktop to where I am currently working. You can also use move to rename a file by being located in the same directory as your file and giving it a new name.cp this-file here
means copy the file located at this path to where you specify itrm this-file
means remove this fileWith a lot of these commands you can add a -r which means recursively for an entire folder instead of just a singular file. Also my own personal warning be careful with mv because you can overwrite your files!!