diff options
author | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-10-21 21:35:40 +0000 |
---|---|---|
committer | gasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-10-21 21:35:40 +0000 |
commit | f3e2c6f2add893710dc9a54098acff13c5934a90 (patch) | |
tree | 7e03f8787f9cc383a2b7b0c51cd30b9b66a61c13 /kpov_judge | |
parent | be32ceb69271797a38b24d07930ac9afcd0c729f (diff) |
Separated tasks from lectures
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@2 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge')
-rwxr-xr-x | kpov_judge/add_task.py (renamed from kpov_judge/add_assignment.py) | 0 | ||||
-rw-r--r-- | kpov_judge/instructions_extractor.py | 24 | ||||
l--------- | kpov_judge/lectures/fri_kpov/01/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/01/lecture/idea.txt | 2 | ||||
l--------- | kpov_judge/lectures/fri_kpov/01/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/02/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/02/lecture/idea.txt (renamed from kpov_judge/tasks/remote_ssh/lecture/ideja.txt) | 0 | ||||
l--------- | kpov_judge/lectures/fri_kpov/02/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/03/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/03/lecture/idea.txt | 2 | ||||
l--------- | kpov_judge/lectures/fri_kpov/03/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/04/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/04/lecture/idea.txt (renamed from kpov_judge/tasks/copy_rename_40_files/lecture/ideja.txt) | 0 | ||||
l--------- | kpov_judge/lectures/fri_kpov/04/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/05/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/05/lecture/idea.txt (renamed from kpov_judge/tasks/set_motd_egotrip/lecture/ideja.txt) | 0 | ||||
l--------- | kpov_judge/lectures/fri_kpov/05/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/06/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/06/lecture/idea.txt (renamed from kpov_judge/tasks/dhcp_dns/lecture/ideja.txt) | 0 | ||||
l--------- | kpov_judge/lectures/fri_kpov/06/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/07/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/07/lecture/idea.txt (renamed from kpov_judge/tasks/network_boot/lecture/ideja.txt) | 0 | ||||
l--------- | kpov_judge/lectures/fri_kpov/07/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/08/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/08/lecture/idea.txt (renamed from kpov_judge/tasks/snmp/lecture/ideja.txt) | 0 | ||||
l--------- | kpov_judge/lectures/fri_kpov/08/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/09/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/09/lecture/idea.txt (renamed from kpov_judge/tasks/rdate/lecture/ideja.txt) | 0 | ||||
l--------- | kpov_judge/lectures/fri_kpov/09/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/10/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/10/lecture/idea.txt (renamed from kpov_judge/tasks/openvpn/lecture/ideja.txt) | 0 | ||||
l--------- | kpov_judge/lectures/fri_kpov/10/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/11/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/11/lecture/idea.txt (renamed from kpov_judge/tasks/radius/lecture/ideja.txt) | 0 | ||||
l--------- | kpov_judge/lectures/fri_kpov/11/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/12/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/12/lecture/idea.txt (renamed from kpov_judge/tasks/nat/lecture/ideja.txt) | 0 | ||||
l--------- | kpov_judge/lectures/fri_kpov/12/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/13/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/13/lecture/idea.txt (renamed from kpov_judge/tasks/openwrt/lecture/ideja.txt) | 0 | ||||
l--------- | kpov_judge/lectures/fri_kpov/13/preparation | 1 | ||||
l--------- | kpov_judge/lectures/fri_kpov/14/evaluation | 1 | ||||
-rw-r--r-- | kpov_judge/lectures/fri_kpov/14/lecture/idea.txt (renamed from kpov_judge/tasks/ldap/lecture/ideja.txt) | 0 | ||||
l--------- | kpov_judge/lectures/fri_kpov/14/preparation | 1 | ||||
-rw-r--r-- | kpov_judge/tasks/copy_rename_100_files/task.py (renamed from kpov_judge/tasks/copy_rename_40_files/evaluation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/copy_rename_20_files_tail_env/evaluation/task.py (renamed from kpov_judge/tasks/ieee802/evaluation/task.py) | 6 | ||||
-rw-r--r-- | kpov_judge/tasks/copy_rename_20_files_tail_env/lecture/ideja.txt | 1 | ||||
-rw-r--r-- | kpov_judge/tasks/copy_rename_20_files_tail_env/task.py (renamed from kpov_judge/tasks/copy_rename_40_files/preparation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/TejoLicen/rServe.zip (renamed from kpov_judge/tasks/rdate/preparation/TejoLicen/rServe.zip) | bin | 499 -> 499 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/bu1.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/bu1.png) | bin | 979 -> 979 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/bu15.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/bu15.png) | bin | 679 -> 679 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/bu2.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/bu2.png) | bin | 826 -> 826 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/bu3.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/bu3.png) | bin | 13656 -> 13656 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/bu4.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/bu4.png) | bin | 1564 -> 1564 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/bu5.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/bu5.png) | bin | 11278 -> 11278 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/bu6.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/bu6.png) | bin | 15244 -> 15244 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/bu7.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/bu7.png) | bin | 3842 -> 3842 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/bu8.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/bu8.png) | bin | 3420 -> 3420 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/bu9.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/bu9.png) | bin | 4245 -> 4245 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/predvaja_clip_image003.gif (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/predvaja_clip_image003.gif) | bin | 686 -> 686 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/s1.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/s1.png) | bin | 700 -> 700 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/s2.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/s2.png) | bin | 3882 -> 3882 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/images/s3.png (renamed from kpov_judge/tasks/rdate/preparation/howtos/images/s3.png) | bin | 3569 -> 3569 bytes | |||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/howtos/si/index.html (renamed from kpov_judge/tasks/rdate/preparation/howtos/si/index.html) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/lecture/ideja.txt | 2 | ||||
-rw-r--r-- | kpov_judge/tasks/custom_rdate/task.py (renamed from kpov_judge/tasks/rdate/preparation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/dhcp_dns_predefined_ip/task.py (renamed from kpov_judge/tasks/dhcp_dns/evaluation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/entrance_exam/task.py (renamed from kpov_judge/tasks/set_motd_egotrip/preparation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/ieee802/lecture/ideja.txt | 2 | ||||
-rw-r--r-- | kpov_judge/tasks/ieee802/preparation/task.py | 117 | ||||
-rw-r--r-- | kpov_judge/tasks/isc_dhcp_live_boot/lecture/ideja.txt | 1 | ||||
-rw-r--r-- | kpov_judge/tasks/isc_dhcp_live_boot/task.py (renamed from kpov_judge/tasks/dhcp_dns/preparation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/ldap_import/task.py (renamed from kpov_judge/tasks/ldap/evaluation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/ldap_search/lecture/ideja.txt | 2 | ||||
-rw-r--r-- | kpov_judge/tasks/ldap_search/task.py (renamed from kpov_judge/tasks/ldap/preparation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/nat_port_forward/task.py (renamed from kpov_judge/tasks/nat/evaluation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/nat_vlc/lecture/ideja.txt | 2 | ||||
-rw-r--r-- | kpov_judge/tasks/nat_vlc/task.py (renamed from kpov_judge/tasks/nat/preparation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/network_boot_custom_program/task.py (renamed from kpov_judge/tasks/network_boot/evaluation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/openvpn_multiple_hops/task.py (renamed from kpov_judge/tasks/openvpn/evaluation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/openvpn_simple_smb/lecture/ideja.txt | 2 | ||||
-rw-r--r-- | kpov_judge/tasks/openvpn_simple_smb/task.py (renamed from kpov_judge/tasks/openvpn/preparation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/openwrt/task.py (renamed from kpov_judge/tasks/openwrt/evaluation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/public_ip_ssh/lecture/ideja.txt | 2 | ||||
-rw-r--r-- | kpov_judge/tasks/public_ip_ssh/task.py (renamed from kpov_judge/tasks/remote_ssh/evaluation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/public_ssh_motd_http/lecture/ideja.txt | 1 | ||||
-rw-r--r-- | kpov_judge/tasks/public_ssh_motd_http/task.py (renamed from kpov_judge/tasks/set_motd_egotrip/evaluation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/radius_multiple_realms/task.py (renamed from kpov_judge/tasks/radius/evaluation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/radius_mysql_pam/lecture/ideja.txt | 1 | ||||
-rw-r--r-- | kpov_judge/tasks/radius_mysql_pam/task.py (renamed from kpov_judge/tasks/radius/preparation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/rdate_64bit/task.py (renamed from kpov_judge/tasks/rdate/evaluation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/remote_ssh/preparation/task.py | 4 | ||||
-rw-r--r-- | kpov_judge/tasks/set_ip_dhcp_hostname/task.py | 104 | ||||
-rw-r--r-- | kpov_judge/tasks/set_ip_static_dhcp/evaluation/navodila.html | 9 | ||||
-rw-r--r-- | kpov_judge/tasks/set_ip_static_dhcp/howtos/images/04.png (renamed from kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/04.png) | bin | 11706 -> 11706 bytes | |||
-rw-r--r-- | kpov_judge/tasks/set_ip_static_dhcp/howtos/images/09.png (renamed from kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/09.png) | bin | 187608 -> 187608 bytes | |||
-rw-r--r-- | kpov_judge/tasks/set_ip_static_dhcp/howtos/images/10.png (renamed from kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/10.png) | bin | 193147 -> 193147 bytes | |||
-rw-r--r-- | kpov_judge/tasks/set_ip_static_dhcp/howtos/images/11.png (renamed from kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/11.png) | bin | 189272 -> 189272 bytes | |||
-rw-r--r-- | kpov_judge/tasks/set_ip_static_dhcp/howtos/images/12.png (renamed from kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/12.png) | bin | 163954 -> 163954 bytes | |||
-rw-r--r-- | kpov_judge/tasks/set_ip_static_dhcp/howtos/images/13.png (renamed from kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/13.png) | bin | 175600 -> 175600 bytes | |||
-rw-r--r-- | kpov_judge/tasks/set_ip_static_dhcp/howtos/images/17.png (renamed from kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/17.png) | bin | 7062 -> 7062 bytes | |||
-rw-r--r-- | kpov_judge/tasks/set_ip_static_dhcp/howtos/si/index.html (renamed from kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/si/index.html) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/set_ip_static_dhcp/task.py (renamed from kpov_judge/tasks/set_ip_static_dhcp/preparation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/set_motd/evaluation/navodila.txt | 8 | ||||
-rw-r--r-- | kpov_judge/tasks/set_motd/preparation/task.py | 94 | ||||
-rw-r--r-- | kpov_judge/tasks/set_motd/task.py (renamed from kpov_judge/tasks/set_motd/evaluation/task.py) | 9 | ||||
-rw-r--r-- | kpov_judge/tasks/smb_nfs/lecture/ideja.txt | 1 | ||||
-rw-r--r-- | kpov_judge/tasks/smb_nfs/task.py (renamed from kpov_judge/tasks/network_boot/preparation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/snmp_agent_uptime/lecture/ideja.txt | 2 | ||||
-rw-r--r-- | kpov_judge/tasks/snmp_agent_uptime/task.py (renamed from kpov_judge/tasks/snmp/preparation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/snmp_alarms_interfaces/task.py (renamed from kpov_judge/tasks/snmp/evaluation/task.py) | 0 | ||||
-rw-r--r-- | kpov_judge/tasks/vlc_stream_rtp/lecture/ideja.txt | 2 | ||||
-rw-r--r-- | kpov_judge/tasks/vlc_stream_rtp/task.py (renamed from kpov_judge/tasks/openwrt/preparation/task.py) | 0 | ||||
-rwxr-xr-x | kpov_judge/test_task.py | 109 |
114 files changed, 302 insertions, 235 deletions
diff --git a/kpov_judge/add_assignment.py b/kpov_judge/add_task.py index 2453eeb..2453eeb 100755 --- a/kpov_judge/add_assignment.py +++ b/kpov_judge/add_task.py diff --git a/kpov_judge/instructions_extractor.py b/kpov_judge/instructions_extractor.py new file mode 100644 index 0000000..5574389 --- /dev/null +++ b/kpov_judge/instructions_extractor.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +import glob +import os.path +from bson.son import SON +import sys + + +if __name__ == '__main__': + l = glob.glob(sys.argv[1]) + l.sort() + for week in l: + print "---------------" + for part in ['preparation', 'evaluation']: + try: + print week.split('/')[2], '-' , part, ':' + with open(os.path.join(week, part, 'task.py')) as f: + task_code = compile(f.read(), 'task.py', 'exec') + exec(task_code) + print instructions['si'].encode('utf-8') + except Exception, e: + print e + pass + diff --git a/kpov_judge/lectures/fri_kpov/01/evaluation b/kpov_judge/lectures/fri_kpov/01/evaluation new file mode 120000 index 0000000..bc7800d --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/01/evaluation @@ -0,0 +1 @@ +../../../tasks/set_motd
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/01/lecture/idea.txt b/kpov_judge/lectures/fri_kpov/01/lecture/idea.txt new file mode 100644 index 0000000..e05a775 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/01/lecture/idea.txt @@ -0,0 +1,2 @@ +Sistem dela pri vajah. Kako izgleda pristopni kolokvij. Kako se ocenjuje. +Pogosti problemi pri VirtualBox. Dodajanje diskov. Problemi z mrežo. diff --git a/kpov_judge/lectures/fri_kpov/01/preparation b/kpov_judge/lectures/fri_kpov/01/preparation new file mode 120000 index 0000000..bc7800d --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/01/preparation @@ -0,0 +1 @@ +../../../tasks/set_motd
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/02/evaluation b/kpov_judge/lectures/fri_kpov/02/evaluation new file mode 120000 index 0000000..aa80e13 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/02/evaluation @@ -0,0 +1 @@ +../../../tasks/public_ip_ssh
\ No newline at end of file diff --git a/kpov_judge/tasks/remote_ssh/lecture/ideja.txt b/kpov_judge/lectures/fri_kpov/02/lecture/idea.txt index 23f5dcc..23f5dcc 100644 --- a/kpov_judge/tasks/remote_ssh/lecture/ideja.txt +++ b/kpov_judge/lectures/fri_kpov/02/lecture/idea.txt diff --git a/kpov_judge/lectures/fri_kpov/02/preparation b/kpov_judge/lectures/fri_kpov/02/preparation new file mode 120000 index 0000000..92a2558 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/02/preparation @@ -0,0 +1 @@ +../../../tasks/mock_entrance_exam
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/03/evaluation b/kpov_judge/lectures/fri_kpov/03/evaluation new file mode 120000 index 0000000..83669c5 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/03/evaluation @@ -0,0 +1 @@ +../../../tasks/set_ip_dhcp_hostname
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/03/lecture/idea.txt b/kpov_judge/lectures/fri_kpov/03/lecture/idea.txt new file mode 100644 index 0000000..92d984c --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/03/lecture/idea.txt @@ -0,0 +1,2 @@ +Mrežne nastavitve pod Linuxom. Ukazi za delo z mrežo. tcpdump. NetworkManager. +dbus. diff --git a/kpov_judge/lectures/fri_kpov/03/preparation b/kpov_judge/lectures/fri_kpov/03/preparation new file mode 120000 index 0000000..ecf9a02 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/03/preparation @@ -0,0 +1 @@ +../../../tasks/set_ip_static_dhcp
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/04/evaluation b/kpov_judge/lectures/fri_kpov/04/evaluation new file mode 120000 index 0000000..8c03708 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/04/evaluation @@ -0,0 +1 @@ +../../../tasks/copy_rename_100_files
\ No newline at end of file diff --git a/kpov_judge/tasks/copy_rename_40_files/lecture/ideja.txt b/kpov_judge/lectures/fri_kpov/04/lecture/idea.txt index 1a29e34..1a29e34 100644 --- a/kpov_judge/tasks/copy_rename_40_files/lecture/ideja.txt +++ b/kpov_judge/lectures/fri_kpov/04/lecture/idea.txt diff --git a/kpov_judge/lectures/fri_kpov/04/preparation b/kpov_judge/lectures/fri_kpov/04/preparation new file mode 120000 index 0000000..bf8f78f --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/04/preparation @@ -0,0 +1 @@ +../../../tasks/copy_rename_20_files_tail_env
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/05/evaluation b/kpov_judge/lectures/fri_kpov/05/evaluation new file mode 120000 index 0000000..bfe5840 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/05/evaluation @@ -0,0 +1 @@ +../../../tasks/public_ssh_motd_http
\ No newline at end of file diff --git a/kpov_judge/tasks/set_motd_egotrip/lecture/ideja.txt b/kpov_judge/lectures/fri_kpov/05/lecture/idea.txt index 91c85c2..91c85c2 100644 --- a/kpov_judge/tasks/set_motd_egotrip/lecture/ideja.txt +++ b/kpov_judge/lectures/fri_kpov/05/lecture/idea.txt diff --git a/kpov_judge/lectures/fri_kpov/05/preparation b/kpov_judge/lectures/fri_kpov/05/preparation new file mode 120000 index 0000000..214ed3a --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/05/preparation @@ -0,0 +1 @@ +../../../tasks/entrance_exam
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/06/evaluation b/kpov_judge/lectures/fri_kpov/06/evaluation new file mode 120000 index 0000000..13f05ef --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/06/evaluation @@ -0,0 +1 @@ +../../../tasks/dhcp_dns_predefined_ip
\ No newline at end of file diff --git a/kpov_judge/tasks/dhcp_dns/lecture/ideja.txt b/kpov_judge/lectures/fri_kpov/06/lecture/idea.txt index 89f3a3a..89f3a3a 100644 --- a/kpov_judge/tasks/dhcp_dns/lecture/ideja.txt +++ b/kpov_judge/lectures/fri_kpov/06/lecture/idea.txt diff --git a/kpov_judge/lectures/fri_kpov/06/preparation b/kpov_judge/lectures/fri_kpov/06/preparation new file mode 120000 index 0000000..aaee75c --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/06/preparation @@ -0,0 +1 @@ +../../../tasks/isc_dhcp_live_boot
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/07/evaluation b/kpov_judge/lectures/fri_kpov/07/evaluation new file mode 120000 index 0000000..a033e6b --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/07/evaluation @@ -0,0 +1 @@ +../../../tasks/network_boot_custom_program
\ No newline at end of file diff --git a/kpov_judge/tasks/network_boot/lecture/ideja.txt b/kpov_judge/lectures/fri_kpov/07/lecture/idea.txt index a380311..a380311 100644 --- a/kpov_judge/tasks/network_boot/lecture/ideja.txt +++ b/kpov_judge/lectures/fri_kpov/07/lecture/idea.txt diff --git a/kpov_judge/lectures/fri_kpov/07/preparation b/kpov_judge/lectures/fri_kpov/07/preparation new file mode 120000 index 0000000..338e3c4 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/07/preparation @@ -0,0 +1 @@ +../../../tasks/smb_nfs
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/08/evaluation b/kpov_judge/lectures/fri_kpov/08/evaluation new file mode 120000 index 0000000..9f38dbd --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/08/evaluation @@ -0,0 +1 @@ +../../../tasks/snmp_alarms_interfaces
\ No newline at end of file diff --git a/kpov_judge/tasks/snmp/lecture/ideja.txt b/kpov_judge/lectures/fri_kpov/08/lecture/idea.txt index 0832279..0832279 100644 --- a/kpov_judge/tasks/snmp/lecture/ideja.txt +++ b/kpov_judge/lectures/fri_kpov/08/lecture/idea.txt diff --git a/kpov_judge/lectures/fri_kpov/08/preparation b/kpov_judge/lectures/fri_kpov/08/preparation new file mode 120000 index 0000000..43d41d1 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/08/preparation @@ -0,0 +1 @@ +../../../tasks/snmp_agent_uptime
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/09/evaluation b/kpov_judge/lectures/fri_kpov/09/evaluation new file mode 120000 index 0000000..4cf01e0 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/09/evaluation @@ -0,0 +1 @@ +../../../tasks/rdate_64bit
\ No newline at end of file diff --git a/kpov_judge/tasks/rdate/lecture/ideja.txt b/kpov_judge/lectures/fri_kpov/09/lecture/idea.txt index 0fb111a..0fb111a 100644 --- a/kpov_judge/tasks/rdate/lecture/ideja.txt +++ b/kpov_judge/lectures/fri_kpov/09/lecture/idea.txt diff --git a/kpov_judge/lectures/fri_kpov/09/preparation b/kpov_judge/lectures/fri_kpov/09/preparation new file mode 120000 index 0000000..93958cb --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/09/preparation @@ -0,0 +1 @@ +../../../tasks/custom_rdate
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/10/evaluation b/kpov_judge/lectures/fri_kpov/10/evaluation new file mode 120000 index 0000000..7dad5da --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/10/evaluation @@ -0,0 +1 @@ +../../../tasks/openvpn_multiple_hops
\ No newline at end of file diff --git a/kpov_judge/tasks/openvpn/lecture/ideja.txt b/kpov_judge/lectures/fri_kpov/10/lecture/idea.txt index 3ae0c92..3ae0c92 100644 --- a/kpov_judge/tasks/openvpn/lecture/ideja.txt +++ b/kpov_judge/lectures/fri_kpov/10/lecture/idea.txt diff --git a/kpov_judge/lectures/fri_kpov/10/preparation b/kpov_judge/lectures/fri_kpov/10/preparation new file mode 120000 index 0000000..88dd369 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/10/preparation @@ -0,0 +1 @@ +../../../tasks/openvpn_simple_smb
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/11/evaluation b/kpov_judge/lectures/fri_kpov/11/evaluation new file mode 120000 index 0000000..632bdfe --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/11/evaluation @@ -0,0 +1 @@ +../../../tasks/radius_multiple_realms
\ No newline at end of file diff --git a/kpov_judge/tasks/radius/lecture/ideja.txt b/kpov_judge/lectures/fri_kpov/11/lecture/idea.txt index fd9d1a9..fd9d1a9 100644 --- a/kpov_judge/tasks/radius/lecture/ideja.txt +++ b/kpov_judge/lectures/fri_kpov/11/lecture/idea.txt diff --git a/kpov_judge/lectures/fri_kpov/11/preparation b/kpov_judge/lectures/fri_kpov/11/preparation new file mode 120000 index 0000000..193fb07 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/11/preparation @@ -0,0 +1 @@ +../../../tasks/radius_mysql_pam
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/12/evaluation b/kpov_judge/lectures/fri_kpov/12/evaluation new file mode 120000 index 0000000..63a7017 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/12/evaluation @@ -0,0 +1 @@ +../../../tasks/nat_port_forward
\ No newline at end of file diff --git a/kpov_judge/tasks/nat/lecture/ideja.txt b/kpov_judge/lectures/fri_kpov/12/lecture/idea.txt index 852ee43..852ee43 100644 --- a/kpov_judge/tasks/nat/lecture/ideja.txt +++ b/kpov_judge/lectures/fri_kpov/12/lecture/idea.txt diff --git a/kpov_judge/lectures/fri_kpov/12/preparation b/kpov_judge/lectures/fri_kpov/12/preparation new file mode 120000 index 0000000..28b7694 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/12/preparation @@ -0,0 +1 @@ +../../../tasks/nat_vlc
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/13/evaluation b/kpov_judge/lectures/fri_kpov/13/evaluation new file mode 120000 index 0000000..350e3c0 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/13/evaluation @@ -0,0 +1 @@ +../../../tasks/openwrt
\ No newline at end of file diff --git a/kpov_judge/tasks/openwrt/lecture/ideja.txt b/kpov_judge/lectures/fri_kpov/13/lecture/idea.txt index 7e12372..7e12372 100644 --- a/kpov_judge/tasks/openwrt/lecture/ideja.txt +++ b/kpov_judge/lectures/fri_kpov/13/lecture/idea.txt diff --git a/kpov_judge/lectures/fri_kpov/13/preparation b/kpov_judge/lectures/fri_kpov/13/preparation new file mode 120000 index 0000000..3fa7bd2 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/13/preparation @@ -0,0 +1 @@ +../../../tasks/vlc_stream_rtp
\ No newline at end of file diff --git a/kpov_judge/lectures/fri_kpov/14/evaluation b/kpov_judge/lectures/fri_kpov/14/evaluation new file mode 120000 index 0000000..e6e31f2 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/14/evaluation @@ -0,0 +1 @@ +../../../tasks/ldap_import
\ No newline at end of file diff --git a/kpov_judge/tasks/ldap/lecture/ideja.txt b/kpov_judge/lectures/fri_kpov/14/lecture/idea.txt index e9647ce..e9647ce 100644 --- a/kpov_judge/tasks/ldap/lecture/ideja.txt +++ b/kpov_judge/lectures/fri_kpov/14/lecture/idea.txt diff --git a/kpov_judge/lectures/fri_kpov/14/preparation b/kpov_judge/lectures/fri_kpov/14/preparation new file mode 120000 index 0000000..51c2854 --- /dev/null +++ b/kpov_judge/lectures/fri_kpov/14/preparation @@ -0,0 +1 @@ +../../../tasks/ldap_search
\ No newline at end of file diff --git a/kpov_judge/tasks/copy_rename_40_files/evaluation/task.py b/kpov_judge/tasks/copy_rename_100_files/task.py index 834cb2a..834cb2a 100644 --- a/kpov_judge/tasks/copy_rename_40_files/evaluation/task.py +++ b/kpov_judge/tasks/copy_rename_100_files/task.py diff --git a/kpov_judge/tasks/ieee802/evaluation/task.py b/kpov_judge/tasks/copy_rename_20_files_tail_env/evaluation/task.py index a7a81d1..834cb2a 100644 --- a/kpov_judge/tasks/ieee802/evaluation/task.py +++ b/kpov_judge/tasks/copy_rename_20_files_tail_env/evaluation/task.py @@ -5,7 +5,11 @@ instructions = { 'si':u""" -Nastavi Radius strežnik. Postavi sistem za avtentikacijo s pomočjo IEEE 802. +Ustvari dva navidezna računalnika. Za prvega uporabi sliko diska simpleArbiterDhcp. Na drugem računalniku +ustvari uporabnika test z geslom test. +Na sliki diska simpleArbiterDhcp najdeš imenik s 100 datotekami. Prekopiraj vse datoteke na drugi računalnik, v domači imenik uporabnika test. +Spremeni vsebino datotek tako, da vse male črke spremeniš v velike. Poskrbi, da se bo s prvega računalnika (simpleArbiterDhcp) mogoče prek +ssh prijaviti na drugi računalnik in prebrati predelane datoteke. """ } diff --git a/kpov_judge/tasks/copy_rename_20_files_tail_env/lecture/ideja.txt b/kpov_judge/tasks/copy_rename_20_files_tail_env/lecture/ideja.txt new file mode 100644 index 0000000..1a29e34 --- /dev/null +++ b/kpov_judge/tasks/copy_rename_20_files_tail_env/lecture/ideja.txt @@ -0,0 +1 @@ +Vprašanja/odgovori glede pristopnega kolokvija. Bashizmi. Morda window managerji. diff --git a/kpov_judge/tasks/copy_rename_40_files/preparation/task.py b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py index 05bfd2c..05bfd2c 100644 --- a/kpov_judge/tasks/copy_rename_40_files/preparation/task.py +++ b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py diff --git a/kpov_judge/tasks/rdate/preparation/TejoLicen/rServe.zip b/kpov_judge/tasks/custom_rdate/TejoLicen/rServe.zip Binary files differindex 9061692..9061692 100644 --- a/kpov_judge/tasks/rdate/preparation/TejoLicen/rServe.zip +++ b/kpov_judge/tasks/custom_rdate/TejoLicen/rServe.zip diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/bu1.png b/kpov_judge/tasks/custom_rdate/howtos/images/bu1.png Binary files differindex c6eeac8..c6eeac8 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/bu1.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/bu1.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/bu15.png b/kpov_judge/tasks/custom_rdate/howtos/images/bu15.png Binary files differindex c2ac808..c2ac808 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/bu15.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/bu15.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/bu2.png b/kpov_judge/tasks/custom_rdate/howtos/images/bu2.png Binary files differindex 85fcfa8..85fcfa8 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/bu2.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/bu2.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/bu3.png b/kpov_judge/tasks/custom_rdate/howtos/images/bu3.png Binary files differindex 831e764..831e764 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/bu3.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/bu3.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/bu4.png b/kpov_judge/tasks/custom_rdate/howtos/images/bu4.png Binary files differindex 495351a..495351a 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/bu4.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/bu4.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/bu5.png b/kpov_judge/tasks/custom_rdate/howtos/images/bu5.png Binary files differindex 103e0e6..103e0e6 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/bu5.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/bu5.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/bu6.png b/kpov_judge/tasks/custom_rdate/howtos/images/bu6.png Binary files differindex b032223..b032223 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/bu6.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/bu6.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/bu7.png b/kpov_judge/tasks/custom_rdate/howtos/images/bu7.png Binary files differindex bd50500..bd50500 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/bu7.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/bu7.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/bu8.png b/kpov_judge/tasks/custom_rdate/howtos/images/bu8.png Binary files differindex 98f7812..98f7812 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/bu8.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/bu8.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/bu9.png b/kpov_judge/tasks/custom_rdate/howtos/images/bu9.png Binary files differindex 9ed78ce..9ed78ce 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/bu9.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/bu9.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/predvaja_clip_image003.gif b/kpov_judge/tasks/custom_rdate/howtos/images/predvaja_clip_image003.gif Binary files differindex 02be389..02be389 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/predvaja_clip_image003.gif +++ b/kpov_judge/tasks/custom_rdate/howtos/images/predvaja_clip_image003.gif diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/s1.png b/kpov_judge/tasks/custom_rdate/howtos/images/s1.png Binary files differindex 52b6ee5..52b6ee5 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/s1.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/s1.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/s2.png b/kpov_judge/tasks/custom_rdate/howtos/images/s2.png Binary files differindex 78a65ce..78a65ce 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/s2.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/s2.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/images/s3.png b/kpov_judge/tasks/custom_rdate/howtos/images/s3.png Binary files differindex c32eae1..c32eae1 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/images/s3.png +++ b/kpov_judge/tasks/custom_rdate/howtos/images/s3.png diff --git a/kpov_judge/tasks/rdate/preparation/howtos/si/index.html b/kpov_judge/tasks/custom_rdate/howtos/si/index.html index a22f5c2..a22f5c2 100644 --- a/kpov_judge/tasks/rdate/preparation/howtos/si/index.html +++ b/kpov_judge/tasks/custom_rdate/howtos/si/index.html diff --git a/kpov_judge/tasks/custom_rdate/lecture/ideja.txt b/kpov_judge/tasks/custom_rdate/lecture/ideja.txt new file mode 100644 index 0000000..0fb111a --- /dev/null +++ b/kpov_judge/tasks/custom_rdate/lecture/ideja.txt @@ -0,0 +1,2 @@ +Napiši svoj rdate klient. Nastavi računalnik, da bo uro sinhroniziral z NTP strežnika. + diff --git a/kpov_judge/tasks/rdate/preparation/task.py b/kpov_judge/tasks/custom_rdate/task.py index caf6298..caf6298 100644 --- a/kpov_judge/tasks/rdate/preparation/task.py +++ b/kpov_judge/tasks/custom_rdate/task.py diff --git a/kpov_judge/tasks/dhcp_dns/evaluation/task.py b/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py index 5e443ce..5e443ce 100644 --- a/kpov_judge/tasks/dhcp_dns/evaluation/task.py +++ b/kpov_judge/tasks/dhcp_dns_predefined_ip/task.py diff --git a/kpov_judge/tasks/set_motd_egotrip/preparation/task.py b/kpov_judge/tasks/entrance_exam/task.py index 272407c..272407c 100644 --- a/kpov_judge/tasks/set_motd_egotrip/preparation/task.py +++ b/kpov_judge/tasks/entrance_exam/task.py diff --git a/kpov_judge/tasks/ieee802/lecture/ideja.txt b/kpov_judge/tasks/ieee802/lecture/ideja.txt deleted file mode 100644 index 98380fc..0000000 --- a/kpov_judge/tasks/ieee802/lecture/ideja.txt +++ /dev/null @@ -1,2 +0,0 @@ -Poveži se na omrežje IEEE 802 s pomočjo WPA supplicanta. Vzpostavi omrežje z avtentikacijo. - diff --git a/kpov_judge/tasks/ieee802/preparation/task.py b/kpov_judge/tasks/ieee802/preparation/task.py deleted file mode 100644 index 29a02cd..0000000 --- a/kpov_judge/tasks/ieee802/preparation/task.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# kpovRandomHelpers should be imported by add_assignment.py -# Poveži se na omrežje IEEE802.11 s pomočjo NetworkManagerja. Poglej ustvarjeno konfiguracijo za wpa supplicant. -# http://oob.freeshell.org/nzwireless/intro.html -instructions = { - 'si':u""" -Poveži se na omrežje IEEE802 s pomočjo NetworkManagerja. Poglej ustvarjeno konfiguracijo za wpa supplicant. -""" -} - -computers = { - 'maliNetworkManager': { - 'disks': [ - { 'name': 'maliNetworkManager', - }, - #{ 'name': 'CDROM', - # 'options':{'readonly': True}, - # 'parts': [],# no parts, no mounting. - #} - ], - 'network_interfaces': [{'network': 'net1'}], - 'flavor': 'm1.tiny', - 'config_drive': False - - }, - 'maliBrezNetworkManager': { - 'disks': [ - { 'name': 'maliBrezNetworkManager', - }, - #{ 'name': 'CDROM', - # 'options':{'readonly': True}, - # 'parts': [],# no parts, no mounting. - #} - ], - 'network_interfaces': [{'network': 'net1'}], - 'flavor': 'm1.tiny', - 'config_drive': False - - }, - 'SimpleArbiter': { - 'disks': [ - { 'name': 'simpleArbiterDhcp', - # attempt automount - }, - #{ 'name': 'CDROM', - # 'options': {'readonly': True}, - # 'parts': [{'dev': 'b1', 'path': '/cdrom'}], - #}, - ], - 'network_interfaces': [{'network': 'net1'}, {'network': 'test-net'}], - 'flavor': 'm1.tiny', - 'config_drive': False - } -} - -networks = { 'net1': {'public': False}, 'test-net': {'public': True} } - -params_meta = { - 'IP_NM': {'opis': 'Naslov maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True}, - 'DNS_NM': {'opis': 'DNS za maliNetworkManager', 'w': False, 'public':True, 'type': 'IP', 'generated': True}, - 'IP_static': {'opis': 'Naslov maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True}, - 'DNS_static': {'opis': 'DNS za maliBrezNetworkManager', 'w': False, 'public': True, 'type': 'IP', 'generated': True}, -} - -def task(IP_NM, DNS_NM, IP_static, DNS_static): - import pxssh - import pexpect - results = dict() - peer_user = 'student' - peer_passwd = 'vaje' - sA = pxssh.pxssh() - sB = pxssh.pxssh() - sA.login(IP_NM, peer_user, peer_passwd) - sB.login(IP_static, peer_user, peer_passwd) - # sA - # make sure NM is not handling eth0 - results['NM_nmcli'] = sA.run('nmcli d') - results['NM_nslookup'] = sA.run('nslookup www.arnes.si') - # sB - # check whether NM is handling eth0 - results['static_nmcli'] = sB.run('nmcli d') - results['static_nslookup'] = sB.run('nslookup www.arnes.si') - sA.logout() - sB.logout() - return results - -def gen_params(user_id, params_meta): - params = dict() - r = random.Random(user_id) - # IP_NM, DNS_NM, IP_static, DNS_static) - dns_servers = ['193.2.1.66', '193.2.1.72', '8.8.8.8', '8.8.4.4', '208.67.222.222', '208.67.220.220'] - net = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) - params['DNS_NM'] = r.choice(dns_servers) - params['IP_NM'], params['IP_static'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 2) - params['DNS_static'] = r.choice(dns_servers) - return params - -def task_check(results, params): - import re - score = -9 - if results['NM_nslookup'].find('Server:\t\t{0}\r'.format(params['DNS_NM'])) > -1: - score += 3 - if results['static_nslookup'].find('Server:\t\t{0}\r'.format(params['DNS_static'])) > -1: - score += 3 - if re.search(r'eth0 +802-.*connected', results['NM_nmcli']): - score += 2 - if not re.search(r'eth0 +802-.*connected', results['static_nmcli']): - score += 2 - score = 0 - return score - -def prepare_disks(templates, params): -# d = templates['simpleArbiterDhcp'] - pass - diff --git a/kpov_judge/tasks/isc_dhcp_live_boot/lecture/ideja.txt b/kpov_judge/tasks/isc_dhcp_live_boot/lecture/ideja.txt new file mode 100644 index 0000000..89f3a3a --- /dev/null +++ b/kpov_judge/tasks/isc_dhcp_live_boot/lecture/ideja.txt @@ -0,0 +1 @@ +Nastavi strežnik dhcp tako, da bodo računalniki v različnih skupinah dobili različna imena zagonskih datotek. Nastavi syslinux tako, da se bo ob zagonu syslinux pokazala slika. diff --git a/kpov_judge/tasks/dhcp_dns/preparation/task.py b/kpov_judge/tasks/isc_dhcp_live_boot/task.py index c060db6..c060db6 100644 --- a/kpov_judge/tasks/dhcp_dns/preparation/task.py +++ b/kpov_judge/tasks/isc_dhcp_live_boot/task.py diff --git a/kpov_judge/tasks/ldap/evaluation/task.py b/kpov_judge/tasks/ldap_import/task.py index fee168a..fee168a 100644 --- a/kpov_judge/tasks/ldap/evaluation/task.py +++ b/kpov_judge/tasks/ldap_import/task.py diff --git a/kpov_judge/tasks/ldap_search/lecture/ideja.txt b/kpov_judge/tasks/ldap_search/lecture/ideja.txt new file mode 100644 index 0000000..e9647ce --- /dev/null +++ b/kpov_judge/tasks/ldap_search/lecture/ideja.txt @@ -0,0 +1,2 @@ +Postavi strežnik OpenLDAP. Ustvari shemo. Ustvari uporabnika. Uporabi LDAP kot backend za RADIUS. + diff --git a/kpov_judge/tasks/ldap/preparation/task.py b/kpov_judge/tasks/ldap_search/task.py index c123c92..c123c92 100644 --- a/kpov_judge/tasks/ldap/preparation/task.py +++ b/kpov_judge/tasks/ldap_search/task.py diff --git a/kpov_judge/tasks/nat/evaluation/task.py b/kpov_judge/tasks/nat_port_forward/task.py index 763dee4..763dee4 100644 --- a/kpov_judge/tasks/nat/evaluation/task.py +++ b/kpov_judge/tasks/nat_port_forward/task.py diff --git a/kpov_judge/tasks/nat_vlc/lecture/ideja.txt b/kpov_judge/tasks/nat_vlc/lecture/ideja.txt new file mode 100644 index 0000000..852ee43 --- /dev/null +++ b/kpov_judge/tasks/nat_vlc/lecture/ideja.txt @@ -0,0 +1,2 @@ +Nastavi računalnik tako, da bo vse pakete za določene naslove prepošiljal na drug računalnik. +Vzpostavi NAT. diff --git a/kpov_judge/tasks/nat/preparation/task.py b/kpov_judge/tasks/nat_vlc/task.py index 6fb5700..6fb5700 100644 --- a/kpov_judge/tasks/nat/preparation/task.py +++ b/kpov_judge/tasks/nat_vlc/task.py diff --git a/kpov_judge/tasks/network_boot/evaluation/task.py b/kpov_judge/tasks/network_boot_custom_program/task.py index 8d1c308..8d1c308 100644 --- a/kpov_judge/tasks/network_boot/evaluation/task.py +++ b/kpov_judge/tasks/network_boot_custom_program/task.py diff --git a/kpov_judge/tasks/openvpn/evaluation/task.py b/kpov_judge/tasks/openvpn_multiple_hops/task.py index 679d136..679d136 100644 --- a/kpov_judge/tasks/openvpn/evaluation/task.py +++ b/kpov_judge/tasks/openvpn_multiple_hops/task.py diff --git a/kpov_judge/tasks/openvpn_simple_smb/lecture/ideja.txt b/kpov_judge/tasks/openvpn_simple_smb/lecture/ideja.txt new file mode 100644 index 0000000..3ae0c92 --- /dev/null +++ b/kpov_judge/tasks/openvpn_simple_smb/lecture/ideja.txt @@ -0,0 +1,2 @@ +Namesti OpenVPN. Ustvari OpenVPN strežnik. Omogoči sosedu, da se nanj poveže. +Ustvari javni in zasebni ključ. Omogoči več sosedom, da se povežejo na tvoj strežnik. diff --git a/kpov_judge/tasks/openvpn/preparation/task.py b/kpov_judge/tasks/openvpn_simple_smb/task.py index 2ca15fc..2ca15fc 100644 --- a/kpov_judge/tasks/openvpn/preparation/task.py +++ b/kpov_judge/tasks/openvpn_simple_smb/task.py diff --git a/kpov_judge/tasks/openwrt/evaluation/task.py b/kpov_judge/tasks/openwrt/task.py index 3326065..3326065 100644 --- a/kpov_judge/tasks/openwrt/evaluation/task.py +++ b/kpov_judge/tasks/openwrt/task.py diff --git a/kpov_judge/tasks/public_ip_ssh/lecture/ideja.txt b/kpov_judge/tasks/public_ip_ssh/lecture/ideja.txt new file mode 100644 index 0000000..23f5dcc --- /dev/null +++ b/kpov_judge/tasks/public_ip_ssh/lecture/ideja.txt @@ -0,0 +1,2 @@ +Primer pristopnega kolokvija. Odgovori na vprašanja. Pogoste težave v Virtualbox. +X11, desktopi, nastavitve. diff --git a/kpov_judge/tasks/remote_ssh/evaluation/task.py b/kpov_judge/tasks/public_ip_ssh/task.py index 0468b7d..0468b7d 100644 --- a/kpov_judge/tasks/remote_ssh/evaluation/task.py +++ b/kpov_judge/tasks/public_ip_ssh/task.py diff --git a/kpov_judge/tasks/public_ssh_motd_http/lecture/ideja.txt b/kpov_judge/tasks/public_ssh_motd_http/lecture/ideja.txt new file mode 100644 index 0000000..91c85c2 --- /dev/null +++ b/kpov_judge/tasks/public_ssh_motd_http/lecture/ideja.txt @@ -0,0 +1 @@ +Reši pristopni kolokvij z visoko oceno. diff --git a/kpov_judge/tasks/set_motd_egotrip/evaluation/task.py b/kpov_judge/tasks/public_ssh_motd_http/task.py index cd3d970..cd3d970 100644 --- a/kpov_judge/tasks/set_motd_egotrip/evaluation/task.py +++ b/kpov_judge/tasks/public_ssh_motd_http/task.py diff --git a/kpov_judge/tasks/radius/evaluation/task.py b/kpov_judge/tasks/radius_multiple_realms/task.py index 5472d10..5472d10 100644 --- a/kpov_judge/tasks/radius/evaluation/task.py +++ b/kpov_judge/tasks/radius_multiple_realms/task.py diff --git a/kpov_judge/tasks/radius_mysql_pam/lecture/ideja.txt b/kpov_judge/tasks/radius_mysql_pam/lecture/ideja.txt new file mode 100644 index 0000000..fd9d1a9 --- /dev/null +++ b/kpov_judge/tasks/radius_mysql_pam/lecture/ideja.txt @@ -0,0 +1 @@ +Nastavi apache tako, da se boš nanj prijavila s pomočjo avtentikacije pri sosedu. diff --git a/kpov_judge/tasks/radius/preparation/task.py b/kpov_judge/tasks/radius_mysql_pam/task.py index c160464..c160464 100644 --- a/kpov_judge/tasks/radius/preparation/task.py +++ b/kpov_judge/tasks/radius_mysql_pam/task.py diff --git a/kpov_judge/tasks/rdate/evaluation/task.py b/kpov_judge/tasks/rdate_64bit/task.py index bd77c13..bd77c13 100644 --- a/kpov_judge/tasks/rdate/evaluation/task.py +++ b/kpov_judge/tasks/rdate_64bit/task.py diff --git a/kpov_judge/tasks/remote_ssh/preparation/task.py b/kpov_judge/tasks/remote_ssh/preparation/task.py deleted file mode 100644 index ea2b361..0000000 --- a/kpov_judge/tasks/remote_ssh/preparation/task.py +++ /dev/null @@ -1,4 +0,0 @@ -instructions = { - 'si':u""" -Reši poizkusni pristopni kolokvij.""" -} diff --git a/kpov_judge/tasks/set_ip_dhcp_hostname/task.py b/kpov_judge/tasks/set_ip_dhcp_hostname/task.py new file mode 100644 index 0000000..2defe2a --- /dev/null +++ b/kpov_judge/tasks/set_ip_dhcp_hostname/task.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# TODO: finish thi +# kpovRandomHelpers should be imported by add_assignment.py + +instructions = { + 'si':u""" +Ustvari tri navidezne računalnike. Za disk prvega uporabi sliko diska simpleArbiterDhcp. +Za enega od ostalih dveh (Z_DHCP) poskrbi, da bo dobil IP prek DHCP, pri čemer +naj kot hostname strežniku pošlje ime, ki ga dobiš na simpleArbiterDhcp. +Za drugega (BREZ_DHCP) poskrbi, da bo imel statično nastavljen IP. + +Prvi omrežni vmesnik računalnika SimpleArbiter naj bo povezan na Internet. Drugi naj bo povezan na neko lokalno omrežje, na katerega bosta priklopljena računalnika Z_DHCP ter BREZ_DHCP. Na računalniku Z_DHCP poskrbite, da bo ob pridobivanju naslova DHCP strežniku poslal tudi posebej nastavljeno ime računalnika (hostname), ki ne bo enako dejanskemu imenu računalnika (tistemu, ki ga izpiše ukaz hostname). + +Naslov BREZ_DHCP ter ime računalnika za Z_DHCP dobite ob zagonu run_test.py na računalniku SimpleArbiter. +""" +} + +computers = { + 'Z_DHCP': { + 'disks': [ + { 'name': 'Z_DHCP', + }, + #{ 'name': 'CDROM', + # 'options':{'readonly': True}, + # 'parts': [],# no parts, no mounting. + #} + ], + 'network_interfaces': [{'network': 'net1'}], + 'flavor': 'm1.tiny', + 'config_drive': False + + }, + 'BREZ_DHCP': { + 'disks': [ + { 'name': 'BREZ_DHCP', + }, + #{ 'name': 'CDROM', + # 'options':{'readonly': True}, + # 'parts': [],# no parts, no mounting. + #} + ], + 'network_interfaces': [{'network': 'net1'}], + 'flavor': 'm1.tiny', + 'config_drive': False + + }, + 'SimpleArbiter': { + 'disks': [ + { 'name': 'simpleArbiterDhcp', + # attempt automount + }, + #{ 'name': 'CDROM', + # 'options': {'readonly': True}, + # 'parts': [{'dev': 'b1', 'path': '/cdrom'}], + #}, + ], + 'network_interfaces': [{'network': 'net1'}, {'network': 'test-net'}], + 'flavor': 'm1.tiny', + 'config_drive': False + } +} + +networks = { 'net1': {'public': False}, 'test-net': {'public': True} } + +params_meta = { + 'IP_DHCP': {'opis': 'Naslov za DHCP', 'w': False, 'public': False, 'type': 'IP', 'generated': True}, + 'Hostname_DHCP': {'opis': 'Ime DHCP', 'w': False, 'public': True, 'type': 'hostname', 'generated': True}, + 'IP_static': {'opis': 'Naslov BREZ_DHCP', 'w': False, 'public': True, 'type': 'IP', 'generated': True}, + 'IP_dhcp_static': {'opis': 'Dodeljen IP brez DHCP', 'w': False, 'public': False, 'type': 'IP', 'generated': True}, +} + +def task(IP_DHCP, Hostname_DHCP, IP_static, MAC_static, IP_dhcp_static): + import pxssh + import pexpect + results = dict() + # check hostname of DHCP + # check the hostname in the response of IP_DHCP + # check availability of IP_static + # check non-availability of IP_dhcp_static + return results + +def gen_params(user_id, params_meta): + r = random.Random(user_id) + # IP_NM, DNS_NM, IP_static, DNS_static) + net = kpovRandomHelpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + params['IP_DHCP'], params['IP_static'], params['IP_dhcp_static'] = kpovRandomHelpers.IPv4_addr_gen(r, net, 3) + params['Hostname_DHCP'] = kpovRandomHelpers.hostname_gen(r) + return params + +def task_check(results, params): + import re + score = -9 + if results['bla']: + score += 3 + return score + +def prepare_disks(templates, params): +# d = templates['simpleArbiterDhcp'] +# create config for static_DHCP +# set static_DHCP hostname + pass + diff --git a/kpov_judge/tasks/set_ip_static_dhcp/evaluation/navodila.html b/kpov_judge/tasks/set_ip_static_dhcp/evaluation/navodila.html deleted file mode 100644 index df4c68d..0000000 --- a/kpov_judge/tasks/set_ip_static_dhcp/evaluation/navodila.html +++ /dev/null @@ -1,9 +0,0 @@ -<p>Usposobite tri računalnike: -<ul> -<li>SimpleArbiter - testni računalnik</li> -<li>Z_DHCP - računalnik, ki bo svoje nastavitve dobil prek DHCP</li> -<li>BREZ_DHCP - računalnik, ki bo imel svoj IP nastavljen statično.</li> -</ul> -</p> -<p>Prvi omrežni vmesnik računalnika SimpleArbiter naj bo povezan na Internet. Drugi naj bo povezan na neko lokalno omrežje, na katerega bosta priklopljena računalnika Z_DHCP ter BREZ_DHCP. Na računalniku Z_DHCP poskrbite, da bo ob pridobivanju naslova DHCP strežniku poslal tudi posebej nastavljeno ime računalnika (hostname), ki ne bo enako dejanskemu imenu računalnika (tistemu, ki ga izpiše ukaz hostname).</p> -<p>Naslov BREZ_DHCP ter ime računalnika za Z_DHCP dobite ob zagonu run_test.py na računalniku SimpleArbiter. Uporabniško ime ter geslo na SimpleArbiter sta <pre>tester</pre> in <pre>SedemKrogovPekla</pre>.</p> diff --git a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/04.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/04.png Binary files differindex 754c200..754c200 100644 --- a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/04.png +++ b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/04.png diff --git a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/09.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/09.png Binary files differindex 866a51d..866a51d 100644 --- a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/09.png +++ b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/09.png diff --git a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/10.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/10.png Binary files differindex d6ccf42..d6ccf42 100644 --- a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/10.png +++ b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/10.png diff --git a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/11.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/11.png Binary files differindex 10b5ec7..10b5ec7 100644 --- a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/11.png +++ b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/11.png diff --git a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/12.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/12.png Binary files differindex 0a87ae6..0a87ae6 100644 --- a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/12.png +++ b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/12.png diff --git a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/13.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/13.png Binary files differindex e71474a..e71474a 100644 --- a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/13.png +++ b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/13.png diff --git a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/17.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/17.png Binary files differindex d4bba87..d4bba87 100644 --- a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/images/17.png +++ b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/17.png diff --git a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/si/index.html b/kpov_judge/tasks/set_ip_static_dhcp/howtos/si/index.html index 9b56a81..9b56a81 100644 --- a/kpov_judge/tasks/set_ip_static_dhcp/preparation/howtos/si/index.html +++ b/kpov_judge/tasks/set_ip_static_dhcp/howtos/si/index.html diff --git a/kpov_judge/tasks/set_ip_static_dhcp/preparation/task.py b/kpov_judge/tasks/set_ip_static_dhcp/task.py index 1d79a61..1d79a61 100644 --- a/kpov_judge/tasks/set_ip_static_dhcp/preparation/task.py +++ b/kpov_judge/tasks/set_ip_static_dhcp/task.py diff --git a/kpov_judge/tasks/set_motd/evaluation/navodila.txt b/kpov_judge/tasks/set_motd/evaluation/navodila.txt deleted file mode 100644 index 755719f..0000000 --- a/kpov_judge/tasks/set_motd/evaluation/navodila.txt +++ /dev/null @@ -1,8 +0,0 @@ -Poskrbite, da se bo ob prijavi uporabnika (v Message Of The Day, MOTD) prek ssh izpisal nek niz. -Računalnik nastavite tako, da bo dostopen s testnega računalnika (Test). Uporabniško ime na testnem računalniku je tester, geslo SedemKrogovPekla . - -Uporabniško ime in niz dobite kot parametre ob zagonu run_test.py. Pri nizu pazite, saj utegne biti dovolj dolg, da brez premikanja kurzorja ne bo takoj viden. - -IP navideznega računalnika ter geslo nastavite sami. Računalnik lahko namestite sami, lahko pa uporabite računalnik Student, na katerem imate uporabnika student z geslom vaje . Geslo uporabnika root je kaboom . - -Ocenjevalni program pričakuje, da se bo ob koncu prijave pojavila ukazna vrstica oblike uporabnisko_ime@ime_racunalnika:~$ . Pazite, da se bo takšna vrstica pojavila šele po nizu, ki ste ga dobili v navodilih. diff --git a/kpov_judge/tasks/set_motd/preparation/task.py b/kpov_judge/tasks/set_motd/preparation/task.py deleted file mode 100644 index e634959..0000000 --- a/kpov_judge/tasks/set_motd/preparation/task.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# bson.son.SON an -# kpovRandomHelpers should be imported by add_assignment.py -# OrderedDict = SON - -instructions = { - 'si':u""" -Namesti VirtualBox. Ustvari dva navidezna računalnika. Pri enem od njiju (imenujmo ga TEST) -kot disk uporabi datoteko Test_disk1. Na drugega (imenujmo ga A) namesti poljubno Linux distribucijo. -Poskrbi, da bosta oba računalnika na istem omrežju. Na računalnik A namesti strežnik ssh. -Z računalnika TEST se prek ssh poveži na A. Poskrbi, da bo TEST imel dostop tako do Interneta, kot -tudi do računalnika A. -""" -} - -computers = { - 'A': { - 'disks': [ - { 'name': 'A_disk1', - 'parts': [{'dev': 'a1', 'path': '/'}], - }, - #{ 'name': 'CDROM', - # 'options':{'readonly': True}, - # 'parts': [],# no parts, no mounting. - #} - ], - 'image': 'KPOV-bombica01', - 'flavor': 'm1.kpov', - 'network_interfaces': [{'network': 'net1'}], - 'config_drive': True, - 'userdata': {'string': "#!/bin/bash\nsed -i '/cloud/d' /etc/fstab\npoweroff &\n"} - }, - 'TEST': { - 'disks': [ - { 'name': 'Test_disk1', - # attempt automount - }, - #{ 'name': 'CDROM', - # 'options': {'readonly': True}, - # 'parts': [{'dev': 'b1', 'path': '/cdrom'}], - #}, - ], - 'image': 'KPOV-bombica01', - 'flavor': 'm1.kpov', - 'network_interfaces': [{'network': 'net1'},{'network':'test-net'}], - 'config_drive': False - }, -} - -networks = { 'net1': {'public': False}, 'test-net': {'public': True} } - -params_meta = { - 'peer_ip': {'opis': 'Naslov ssh strežnika', 'w': True, 'public':True, 'type': 'IP', 'generated': False}, - 'peer_user': {'opis': 'ime uporabnika', 'w': True, 'public': True, 'type': 'alnumstr', 'generated': False}, - 'peer_passwd': {'opis': 'geslo uporabnika', 'w': True, 'public': True, 'type': 'alnumstr', 'generated': False}, - 'addon_disk_filename': {'w': False, 'public': False, 'generated': True}, # datoteka na dodatnem disku -} - -def task(peer_ip, peer_user, peer_passwd): - "Check whether ssh works" - import pxssh - import pexpect - results = dict() - s = pxssh.pxssh() - s.login (peer_ip, peer_user, peer_passwd) - results['motd'] = s.before # print everything before the prompt. - s.sendline('ls /mnt') - s.prompt() - results['ls_remote'] = s.before - s.logout() - results['ls_local'] = pexpect.run('ls ~/') - return results - -def gen_params(user_id, params_meta): - return kpovRandomHelpers.default_gen(user_id, params_meta) - -def task_check(results, params): - fname = params['addon_disk_filename'] - score = 0 - if (results['ls_remote'].find(fname) > -1): - score += 5 - if (results['ls_local'].find(fname) > -1): - score += 5 - return score - -def prepare_disks(templates, params): - d1 = templates['A_disk1'] - # print "touching", d1 - d1.touch('/{0}.txt'.format(params['addon_disk_filename'])) - # print "writing to", '/{0}.txt'.format(params['addon_disk_filename']) - d1.write('/{0}.txt'.format(params['addon_disk_filename']), 'Studentje na KPOV ste ZAKON!') - # print d1.ls('/') diff --git a/kpov_judge/tasks/set_motd/evaluation/task.py b/kpov_judge/tasks/set_motd/task.py index 3338c80..b4a14fc 100644 --- a/kpov_judge/tasks/set_motd/evaluation/task.py +++ b/kpov_judge/tasks/set_motd/task.py @@ -12,6 +12,15 @@ Ustvari dva navidezna računalnika - imenujmo ju Test in Student. Za računalnik sliko diska, poimenovano Test. Na računalniku Test dobite kratek niz. Poskrbite, da se bo ta kratki niz pojavil v sporočilu, ki se ob prijavi izpiše na računalniku Student. Temu sporočilu v angleščini rečemo "message of the day" - MOTD. + +Poskrbite, da se bo ob prijavi uporabnika (v Message Of The Day, MOTD) prek ssh izpisal nek niz. +Računalnik nastavite tako, da bo dostopen s testnega računalnika (Test). + +Uporabniško ime in niz dobite kot parametre ob zagonu run_test.py. Pri nizu pazite, saj utegne biti dovolj dolg, da brez premikanja kurzorja ne bo takoj viden. + +IP navideznega računalnika ter geslo nastavite sami. + +Ocenjevalni program pričakuje, da se bo ob koncu prijave pojavila ukazna vrstica oblike uporabnisko_ime@ime_racunalnika:~$ . Pazite, da se bo takšna vrstica pojavila šele po nizu, ki ste ga dobili v navodilih. """ } diff --git a/kpov_judge/tasks/smb_nfs/lecture/ideja.txt b/kpov_judge/tasks/smb_nfs/lecture/ideja.txt new file mode 100644 index 0000000..a380311 --- /dev/null +++ b/kpov_judge/tasks/smb_nfs/lecture/ideja.txt @@ -0,0 +1 @@ +Zaženi računalnik. Spremeni initrd. Zaženi sistem prek NFS. Spremeni podatke v squashfs. diff --git a/kpov_judge/tasks/network_boot/preparation/task.py b/kpov_judge/tasks/smb_nfs/task.py index 8c54bf6..8c54bf6 100644 --- a/kpov_judge/tasks/network_boot/preparation/task.py +++ b/kpov_judge/tasks/smb_nfs/task.py diff --git a/kpov_judge/tasks/snmp_agent_uptime/lecture/ideja.txt b/kpov_judge/tasks/snmp_agent_uptime/lecture/ideja.txt new file mode 100644 index 0000000..0832279 --- /dev/null +++ b/kpov_judge/tasks/snmp_agent_uptime/lecture/ideja.txt @@ -0,0 +1,2 @@ +Postavi SNMP strežnik. Preberi podatke z njega. Dodaj agenta za temp. procesorja. Namesti CACTI. Nastavi CACTI, da bo bral podatke s strežnika. + diff --git a/kpov_judge/tasks/snmp/preparation/task.py b/kpov_judge/tasks/snmp_agent_uptime/task.py index 7bd6069..7bd6069 100644 --- a/kpov_judge/tasks/snmp/preparation/task.py +++ b/kpov_judge/tasks/snmp_agent_uptime/task.py diff --git a/kpov_judge/tasks/snmp/evaluation/task.py b/kpov_judge/tasks/snmp_alarms_interfaces/task.py index e8fb908..e8fb908 100644 --- a/kpov_judge/tasks/snmp/evaluation/task.py +++ b/kpov_judge/tasks/snmp_alarms_interfaces/task.py diff --git a/kpov_judge/tasks/vlc_stream_rtp/lecture/ideja.txt b/kpov_judge/tasks/vlc_stream_rtp/lecture/ideja.txt new file mode 100644 index 0000000..7e12372 --- /dev/null +++ b/kpov_judge/tasks/vlc_stream_rtp/lecture/ideja.txt @@ -0,0 +1,2 @@ +Postavi OpenWRT na router. Usposobi predvajanje filmov na Raspberry PI. + diff --git a/kpov_judge/tasks/openwrt/preparation/task.py b/kpov_judge/tasks/vlc_stream_rtp/task.py index 934dfe6..934dfe6 100644 --- a/kpov_judge/tasks/openwrt/preparation/task.py +++ b/kpov_judge/tasks/vlc_stream_rtp/task.py diff --git a/kpov_judge/test_task.py b/kpov_judge/test_task.py new file mode 100755 index 0000000..894bfe6 --- /dev/null +++ b/kpov_judge/test_task.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import yaml +import json +import urllib +import urllib2 +import dialog +import os +import inspect +import sys + +# SERVER_URL = "http://localhost/kpov_judge/" +SERVER_URL = "http://kpov.fri.uni-lj.si/kpov_judge/" +TASK_URL = SERVER_URL + '{task_id}/task.py' +PARAMS_URL = SERVER_URL + '{task_id}/params.json' +SUBMIT_URL = SERVER_URL + '{task_id}/results.json' + +PARAMS_FILE = os.path.expanduser("~/.kpov_params.yaml") + +def get_params(params, param_names, meta, d): + for name in param_names: + m = meta.get(name, {}) + if d is not None: + ret, s = d.inputbox(m.get('opis', name), init=params.get(name, '')) + if ret == 0 and m.get('w', False): + params[name] = s + else: + if name not in params: + raise "Missing param: {0}".format(name) + return params + +def auth_open(url, username, password): + password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() +# Add the username and password. +# If we knew the realm, we could use it instead of None. + password_mgr.add_password(None, SERVER_URL, username, password) + handler = urllib2.HTTPBasicAuthHandler(password_mgr) +# create "opener" (OpenerDirector instance) + opener = urllib2.build_opener(handler) +# use the opener to fetch a URL +# opener.open(SERVER_URL) +# Install the opener. +# Now all calls to urllib2.urlopen use our opener. + urllib2.install_opener(opener) + +def load_checker(request): + source = response.read() + t = compile(source, 'task.py', 'exec') + exec(t) + args_list = inspect.getargs(task.func_code)[0] + return task, args_list, param_meta + +if __name__ == '__main__': + try: + try: + saved_params = yaml.load(open(PARAMS_FILE)) + except: + print "Missing - creating anew.", PARAMS_FILE + saved_params = dict() + if len(sys.argv) > 1 and sys.argv[1] == '-q': + d = None + else: + d = dialog.Dialog(dialog="dialog") + basic_params = { + # 'param_name': ('prompt', editable) + "student_id": {'opis':"Upor. ime:", 'w': True}, + "student_password": {'opis':"Geslo:", 'w': True}, + "task_id": {'opis': "Naloga:", 'w': True}} + saved_params = get_params(saved_params, ['student_id', 'student_password', 'task_id'], basic_params, d) + task_id = saved_params['task_id'] + yaml.dump(saved_params, open(PARAMS_FILE, 'w')) + auth_open(SERVER_URL, saved_params['student_id'], saved_params['student_password']) + # get parameters + req = urllib2.Request(PARAMS_URL.format(**saved_params)) + response = urllib2.urlopen(req) + web_params = json.load(response) + task_params_dict = saved_params.get('tasks', {}) + task_params = task_params_dict.get(task_id, {}) + saved_params['tasks'] = task_params_dict + task_params.update(web_params) + # get task source + req = urllib2.Request(TASK_URL.format(**saved_params)) + response = urllib2.urlopen(req) + # load task_check over the net + task, args_list, meta = load_checker(response) + # get missing parameters from user + task_params = get_params(task_params, args_list, meta, d) + # save + # run checker + valid_task_params = dict() + for i in args_list: + valid_task_params[i] = task_params[i] + saved_params['tasks'][task_id] = valid_task_params + results = task(**valid_task_params) + data = urllib.urlencode({ + 'results': json.dumps(results), + 'params': json.dumps(valid_task_params) + }) + req = urllib2.Request(SUBMIT_URL.format(**saved_params), data) + response = urllib2.urlopen(req) + if d is not None: + d.msgbox(response.read()) + yaml.dump(saved_params, open(PARAMS_FILE, 'w')) + # d.add_persistent_args([('background_title', 'KPOVv')]) + except Exception, e: + yaml.dump(saved_params, open(PARAMS_FILE, 'w')) + print "problem!" + print e |