4.8 KiB
# You must run this cell, but you can ignore its contents.
import hashlib
def ads_hash(ty):
"""Return a unique string for input"""
ty_str = str(ty).encode()
m = hashlib.sha256()
m.update(ty_str)
return m.hexdigest()[:10]
Q1 SSH, command line, exit codes, etc¶
SSH to your account at python-course
(e.g. ssh your-user-name@python-course
) and follow the puzzle starting in the directory /schnitzeljagd
.
You must be in the University of Freiburg network in order to be able to SSH correctly.
Your username is your the lowercase version of your lastname (e.g. Cem Özdemir would have a username of oezdemir
). Your password is your matriculation number followed by "x" (e.g. 12345678x
).
Place the final answer in the variable final_answer
.
final_answer = "lada0df89ksdjf8alkds9339akklafk93"
assert ads_hash(final_answer) == 'dfb81c4fac'
Q2 Starting conda environment from command line¶
On the above server, we have Anaconda installed at /anaconda3
so from the command line, you can start the anaconda base
environment like this:
eval "$(/anaconda3/bin/conda shell.bash hook)"
If you do this, your command-line prompt will start with (base)
.
Steps:
0) Login to 10.4.66.100
as described above.
1) Start the anaconda base
environment.
2) Change to the directory /course
.
3) Run the python program program1.py
4) Put the program console output into the variable program1_output
below
program1_output=300
assert ads_hash(program1_output) == '983bd614bb'