Starter Tasks
Want to dive into learning about technical infrastructure at the OCF, but not sure where to start? Here are some self-paced tasks you can do on your own. Feel free to ask for help in our Slack workspace or in person during staff hours!
Tasks marked with an asterisk (*) require staff privileges. If you want to work on these but haven't officially been given staff privileges yet, let a current staffer know you’re working on starter tasks and we will add you.
These tasks don’t have to be completed in order.
Connect to the OCF IRC network
Internet Relay Chat (IRC) is a chat protocol invented in the 80s, an early precursor to Slack. The OCF runs an IRC server (since 2002!), which is bridged to our Slack network. Many staffers prefer IRC to Slack due to its wide breadth of customizable clients, as opposed to Slack, which requires using their application.
For this task, pick an IRC client, install it on your computer, and use it to connect to the OCF IRC network (details at https://ocf.io/irc). Some popular clients are:
- Irssi (Mac/Linux, console)
- Weechat (Max/Linux, console)
- Hexchat (Windows/Linux, graphical)
- Colloquy (Mac, graphical)
See http://www.irchelp.org/clients/ for more recommendations.
Once you’ve joined IRC, pick any channel (#rebuild, #henlo, etc) and say hi!
Get familiar with the command line
All of our servers run Linux, and we interact with them over the command line. There are a lot of online resources about using the Linux command line, so if you're confused about something, try Googling it!
If you haven't used the command line before, you can go to our command reference page and try running some commands. You
can also connect to our ssh server
(ssh.ocf.berkeley.edu
) using your own SSH client.
If you want to get more comfortable, try completing lab 1 from the OCF/XCF Linux System Administration DeCal.
Run the IRC bot in development mode* (requires being on IRC)
Our chat bot is named create
and its source code can be found at
https://github.com/ocf/ircbot. Before testing the IRC bot right away, make sure
you know how to use it:
- Using your IRC client (or Slack), join the #test channel.
- Trigger some bot commands. See https://ircbot.ocf.berkeley.edu/ for a list of
commands. For example, saying
create: thanks
will trigger a response! - Find the source code for a particular command to learn how it works.
Once you’ve learned about create
, you can start making changes to it!
- Follow the steps in the GitHub README to run the bot in development mode.
- Make sure you can talk to the bot in development mode-- it will be named
create-yourusername
instead of simplycreate
. - Make a simple change and test that it works.
- Bonus: figure out how to get your development bot to join a public channel like #test. (there are multiple ways to do this!)
Play with staff utilities*
OCF staff use a collection of scripts when interacting with the campus
community. For example, before creating an account for a student organization,
we make sure the person requesting the account is listed as a signatory for that
group. Staff members use the
signat
command to perform this
check.
- Log into supernova.
- Use the
signat
command to list the signatories for the Open Computing Facility or another student organization of your choice. Hint: if you are not sure how to use thesignat
command, try runningsignat --help
. This trick works with most commands. OCF scripts also have documentation on this website. - Find the source code for this script on GitHub. Hint: if you’re not sure which repository something is in, you can use OCF Sourcegraph to search across all repositories!
Play with your webspace
Every OCF account has web hosting enabled at https://www.ocf.berkeley.edu/~yourusername. As an example, check out ckuehl’s website.
- Add some files to your webspace and preview it in your web browser.
- (optional) Most student groups that host with the OCF use WordPress. Install WordPress in your webspace. (hint: instructions for this are on our website)
Play with ocflib*
ocflib is a Python library we maintain which is installed on every OCF host. For this exercise, you won’t need to make modifications to ocflib.
Log into supernova and start an IPython3 shell (the
ipython3
command).To make sure things are working:
- Run
import ocflib.lab.staff_hours
to import utilities relating to staff hours. - Run
staffhours = ocflib.lab.staff_hours.get_staff_hours()
to get the list of staff hours. - Take a look at the list
staffhours
and check that it matches the info on the staff hours page. For instance, you should be able to runstaffhours[0]
to see the info corresponding to the first staff hour entry on the page.
- Run
Your turn! Use ocflib functions to get the following information in your interactive Python shell:
- Get the list of signatories for the OCF, and your favorite student org. (hint: look at the signat source code from before!)
- Find the toner levels of each printer.
- Find the hours the OCF was open on your most recent birthday.
If you get stuck, don't forget that you can search the GitHub repo or Sourcegraph to find more info.
Make a pull request!*
Whenever a technical change to the OCF is made, we use a pull request on GitHub. Pull requests allow staffers to propose changes in discrete chunks and get feedback before the code goes live.
You're going to make a pull request to ocfweb. Specifically, you'll add your name to the list of everyone who's completed this task.
Set up
- Log into GitHub. If your OCF email (
<OCF username>@ocf.berkeley.edu
) is not connected to your account, add it to your account emails. - Create your personal fork of ocfweb.
- Log into supernova.
- Optional: For easier authentication to GitHub, generate an SSH
key and add it to your GitHub account.
Note: the
xclip
commands will probably not work. Instead, just runcat ~/.ssh/id_rsa.pub
and manually copy it to your clipboard. - Return to your new fork of ocfweb and clone the
repository. Enter your clone with
cd ocfweb
. - Take a look at the README. It will tell you to run a few commands to finish setting up.
You only have to do this part once. Now that your fork is set up, all future pull requests to ocfweb will use this same clone.
Make your change
First, you want to create a new branch to separate this change from other changes that you or other people are making. To do this, choose a very short name for your branch and run
git checkout -b <branch-name>
. You have now created and switched to your new branch.Now, you can edit the file and add your username. Figure out which file corresponds to the completion list and add your username to that file. (Just add the name for now, don't worry about adding the URL or brackets.)
There are a few options for editing the file:
- If you are familiar with a console text editor like
vim
oremacs
, you can use that to edit the file. - If you are using a desktop in the OCF lab, you can use the
~/remote
folder on the desktop, which is synced to your home directory on supernova. - Other editors may have plugins to let you edit files over SSH, such as VS Code.
- If you are familiar with a console text editor like
Now that you've made the change, check out the README to see how to run ocfweb in development mode. Once you're running in dev-mode, navigate to the page in your browser and visually check it.
Run tests! The instructions for running the tests are also in the README. We didn't make any drastic changes, so the tests should hopefully pass without any issue.
If everything looks good, stage your changes using
git add
, and make a commit usinggit commit
.Push the change to your fork by running
git push origin <branch-name>
.Return to the GitHub page for your fork. You should see a button to open a pull request for the change you just pushed. Go ahead and open that PR!
Once the pull request has been submitted, other OCF staff will have a change to review your changes and make sure they look good. Once one or two people approve, the pull request can be merged and your change will go live.
Update your PR (optional)
Sometimes you will want to update a pull request after it has been created, because you thought of something new or because another staffer suggested a change. In this case, you'll update your pull request so that your username on the list links to the pull request you made.
- If you have disconnected, log back into supernova and navigate to your ocfweb folder.
- Copy the URL to the GitHub pull request you opened in the last part. Edit the
list file again, and replace your username with
[username](https://link.to/pull/request)
. The brackets and parentheses indicate that this is a link in Markdown, which is the markup language we use for the docs. - As before, stage your changes and commit them.
- Optional: Squash your changes. A pull request often will accumulate lots of
little commits that are not very important. You can "squash" all these
commits together to make things cleaner.
- Run
git rebase -i HEAD~2
(~2
is the number of commits to rebase) to do an "interactive rebase" of the last two commits. - A text editor will open with a line for each commit. Leave the first commit marked as "pick", but for the second commit, replace "pick" with "squash" to squash it into the first one. Save and exit.
- You will get a chance to edit the commit message for the squashed commit. By default, it just puts the two commit messages together. You might want to delete the second message. Save and exit.
- You did it! You can run
git log
to check: you should only see one commit at the top that is authored by you, instead of two.
- Run
- Push your new changes as before. If you did the optional step, you will have
to add the argument
--force-with-lease
afterpush
.
After pushing, the pull request on GitHub will automatically update with the new changes.
Congrats on making your PR! If you want to learn more about what you can do with git, check out our documentation on git.