more ~rcg6p/phys1655/p1655.shBasically, the commands in the .bashrc setup python, and do a few other nice configurations to your terminal.
source ~rcg6p/phys1655/p1655.sh
Note: if you do not have a .bashrc file, it will be created by the editor.
If you do it right, when you login from now on it will source (execute) the .bashrc file in my area and you will have all of the tools ready to use for class:
Very important Note: The command above needs to be copied exactly into your .bashrc file. The command executes a program in professor Group's area. So don't change "rcg6p" to your username. Don't do it! That file does not exist in your area, and you will get a "file not found error".
Watch out! If you make a typo in your .bashrc file you might not be able to log back in. So check it first with the command below before logging out! This command will execute your .bashrc file to make sure it works. Type this command on the linux command line:
source ~/.bashrc
If there are no errors, you are probably good.
Then log out and log back in - close the terminal, and open again should be good enough. Now type the command: printenv. This command will display a variety of variables that have been defined for your shell to use.
You can now also type p1655env to see a list of definitions related to this class (only 1). Don't worry about the details of how these are used for now, just make sure that you can see a variable with the string “P1655” in their name. This will allow your account to access special tools and programs throughout the semester. These settings are handled globally, so any changes will propagate to the whole class.
Next we will introduce working with the git code management system, which will be used to distribute starter code and for you and for you to submit your work for this class.
Using GitHub offers several advantages, including: gaining experience in one of the most highly-used tools for managing modern software development, providing backups of your work (as long as you check in your changes!), providing a way for TAs to check your work in progress, and more.
Start by:
For this part of the lab exercise, first read our GitHub/GitHub Classroom tutorial and get your GitHub account as described in the tutorial.
AFTER you complete our GitHub Classroom turotial above (you should have setup your GitHub account and loaded your ssh-key):
A directory named "Class02-<userid>" should have appeared in your area. cd into that directory and follow the instructions in the 'Readme.md' file of your repository (you can read it in the GitHub browser or from the rivanna command line using the command 'more Readme.md'). The Readme will be automatically shown when you view your repository in GitHub.
To run the included python file, type:
>>> python hello.py
at the command line.
You can edit the file using one of the available text editors, eg: nano .hello.py, emacs hello.py,vim hello.py, gedit hello.py,
Now that you cloned the repository, you can edit a file in the repository (hello.py), add it to the staging area, commit it, and push it back to your GitHub repository.
Don't know how to do that yet? No problem... The commands you will type are:
1) After we edit the file we need to do "git add". This adds a change in the working directory to the staging area. It tells Git that you want to include updates to a particular file in the next commit. But, it doesn't do the commit yet.
>>> git add hello.py
2) We can do a "git status" to see that our file is listed as not yet committed. This step isn't required. It just gives you the status
>>> git status
3) Now, we can commit. We need to add some comment about what we changed, that is what -m does.
>>> git commit -m "my first check in"
4) Now, we are ready to push it to GitHub
>>> git push
Now reload the web page for your GitHub repo and you will see that your file has changed.
You can find your repositories for the GitHub classroom by going to:
https://github.com/PHYS1655Su24
That is it. Just make sure you got the updated 'hello.py' to upload to your GitHub account and you completed the work for today.