forked from 61c-teach/fa24-lab-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
def get_airspeed_velocity_of(unladen_swallow): | ||
if unladen_swallow.type == "african": | ||
return # redacted | ||
elif unladen_swallow.type == "european": | ||
return # redacted | ||
|
||
# pretend there's code here... | ||
|
||
def fizzbuzz(num): | ||
if num == 3: # edit this line | ||
print(f"{num}: fizz") | ||
if num == 5: # edit this line | ||
print(f"{num}: buzz") | ||
|
||
for i in range(1, 20): | ||
fizzbuzz(i) | ||
|
||
# pretend there's code here... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
if [[ "$HOSTNAME" == hive* ]]; then | ||
echo "Please run this on your local machine, not a hive machine." | ||
fi | ||
|
||
echo "OSTYPE='$OSTYPE'" > debug.txt | ||
echo "BASH_VERSION='$(bash --version 2>&1 | cat)'" >> debug.txt | ||
echo "SH_VERSION='$(sh --version 2>&1 | cat)'" >> debug.txt | ||
echo "GIT_VERSION='$(git --version 2>&1 | cat)'" >> debug.txt | ||
echo "PYTHON3_VERSION='$(python3 --version 2>&1 | cat)'" >> debug.txt | ||
echo "PYTHON_VERSION='$(python --version 2>&1 | cat)'" >> debug.txt | ||
echo "PY_VERSION='$(py --version 2>&1 | cat)'" >> debug.txt | ||
echo "JAVA_VERSION='$(java -version 2>&1 | cat)'" >> debug.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -euf -o pipefail | ||
|
||
SSH_HOST=${1:-s275-4.cs.berkeley.edu} | ||
|
||
for OUTPUT in $(ssh "$SSH_HOST" -G | grep "^identityfile " | cut -d " " -f2-) | ||
do | ||
filename="${OUTPUT/#\~/$HOME}" | ||
if [[ -f $filename ]]; then | ||
echo "You already have an SSH key at: $OUTPUT" | ||
echo "Make note of this, as you'll need this information later!" | ||
exit 0 | ||
fi | ||
done | ||
|
||
echo "I couldn't find an existing SSH key for you, so let's make one now..." | ||
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N '' | ||
echo "Great! Your new SSH key is at: ~/.ssh/id_ed25519" | ||
echo "Make note of this, as you'll need this information later!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
lab00_ref="starter/lab00-oski" | ||
|
||
git fetch starter | ||
|
||
lab00_start_ref="$(git rev-parse "${lab00_ref}~1")" | ||
|
||
git tag -f lab00-backup | ||
git push -f origin refs/tags/lab00-backup | ||
git reset --hard "$lab00_start_ref" | ||
git push -f origin "${lab00_ref}:main" | ||
git update-ref refs/remotes/origin/main "$lab00_start_ref" "$lab00_ref" | ||
|
||
echo "Finished setup" |