summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/tasks/copy_rename_20_files_tail_env/task.py')
-rw-r--r--kpov_judge/tasks/copy_rename_20_files_tail_env/task.py86
1 files changed, 53 insertions, 33 deletions
diff --git a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
index 0b4bcff..504d102 100644
--- a/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
+++ b/kpov_judge/tasks/copy_rename_20_files_tail_env/task.py
@@ -2,43 +2,67 @@
# -*- coding: utf-8 -*-
# kpov_random_helpers should be imported by add_assignment.py
-# TODO (polz):
+# TODO (polz):
instructions = {
'si':u"""
Prijavi se na sistem kot uporabnik student z geslom vaje.
-V domači mapi najdeš imenik Mapa z 20 datotekami.
+V domači mapi najdeš imenik {file_rename_dirname} z 20 datotekami.
- Preimenuj vse datoteke tako, da zamenjaš minuse s podčrtaji
- - Napiši čim krajši ukaz v bash, ki vse datoteke iz enega (izvornega) podanega imenika premakne v drug (ciljni) podani imenik. Spravi ga v /home/student/mv_ukaz. Pazi, da bodo ob testiranju v izvornem imeniku iste datoteke, kot so bile, ko je bila virtualka nova, ciljni imenik pa bo prazen.
- - Napiši ukaz, ki s pomočjo ukaza grep v datoteko ~/mama.txt izpiše vse navadne (ne skrite) datoteke v trenutnem imeniku, ki vsebujejo niz "mama", v datoteko ~/napake.txt pa izpiše vse morebitne napake (npr. to, da so nekateri objekti v trenutnem imeniku dejansko imeniki ali napačne simbolične povezave). Ukaz spravite v datoteko /home/student/mama_ukaz.
- - Napiši program (lahko v bash), ki bo 5s sledil vsebini /var/log/syslog. V primeru, da se v syslogu pojavi niz "zmeda", naj program izpiše "imam ga". Poleg tega naj program med sledenjem syslog-u odšteva od 5 do 1 (vsako sekundo naj se izpiše naslednja številka. Program naj bo v /home/student/syslog_ukaz.sh
- - Nastavi okoljsko spremenljivko TEST, da bo imela isto vrednost kot okoljska spremenljivka USER + število okoljskih spremenljivk, ki v imenu ali vrednosti ne vsebujejo besede TEST. Primer: polz37
-# tole je zoprno, ker se lahko zelo hitro spremeni. Treba bo izbrati
-# neko drugo stran - recimo http://localhost/mojastran.html
- - S pomočjo programa cURL preštej pojavitev niza "images" v html kodi (shranjena stran 24ur.com) in število zapiši v spremenljivko $images.
- - V imeniku "Mapa" najdeš datoteko count.txt. Preštej število vrstic v njej in rezultat zapiši v novo datoteko lines.txt
+ - Napiši čim krajši ukaz v bash, ki vse datoteke iz imenika {mv_src_dir}
+ podanega imenika premakne v imenik {mv_dst_dir}. Spravi ga v
+ /home/student/mv_ukaz. Pazi, da bodo ob testiranju v izvornem imeniku iste
+ datoteke, kot so bile, ko je bila virtualka nova, ciljni imenik pa bo prazen.
+ - Napiši ukaz, ki s pomočjo ukaza grep v datoteko ~/mama.txt izpiše vse
+ navadne (ne skrite) datoteke v trenutnem imeniku, ki vsebujejo niz "mama",
+ v datoteko ~/napake.txt pa izpiše vse morebitne napake (npr. to, da so nekateri
+ objekti v trenutnem imeniku dejansko imeniki ali napačne simbolične povezave).
+ Ukaz spravite v datoteko /home/student/mama_ukaz.
+ - Napiši program (lahko v bash), ki bo 5s sledil vsebini /var/log/syslog. V
+ primeru, da se v syslogu pojavi niz "zmeda", naj program izpiše "imam ga".
+ Poleg tega naj program med sledenjem syslog-u odšteva od 5 do 1 (vsako sekundo
+ naj se izpiše naslednja številka. Program naj bo v /home/student/syslog_ukaz.sh
- Namesti paket "cowsay" in ga preizkusi :)
- - Napiši najkrajši ukaz, ki s pomočjo Pythona zažene preprost (integriran) HTTP strežnik kateri streže datoteke iz imenika, ki ga dobite podanega.
+ - Nastavi okoljsko spremenljivko TEST, da bo imela isto vrednost kot okoljska
+ spremenljivka USER + število okoljskih spremenljivk, ki v imenu ali
+vrednosti ne vsebujejo besede TEST. Primer: polz37
+ - S pomočjo programa cURL preštej število pojavitev niza "images" v html kodi,
+ ki jo dobiš na naslovu http://localhost/{curl_fname} na malishell in število zapiši
+ v spremenljivko $images na simpleArbiter v lupini, kjer poganjaš
+ task_check.py
+ - V imeniku {wc_dirname} najdeš datoteko count.txt. Preštej število vrstic v njej
+ in rezultat zapiši v novo datoteko lines.txt v istem imeniku.
""",
'en':u"""
-Log into the system.
-In your home folder you will find a directory called Folder containing 20 files.
- - Rename all files replacing minus sign with the underscore
- - Specify the shortest command for copying all the files located in /home/user/Folder into the folder /home/user/new
- - Specify the shortest command, which will, using the grep command,
-write all normal (not hidden) files containing a string "mama" located
-in working directory (pwd) into file "mama.txt" while writing errors such as files in current directory being folders or symbolic links in the file called "Errors.txt"
- - Specify a command, which will track the contents of /var/log/syslog
-for 5s. In case it finds the entry "confusion" in syslog, print "got it".
-In addition, let the program subtrack 1 from the counter every
-second(5 to 1) to show the status of the tracker.
+Log into the system as student using vaje as your password.
+In your home folder you will find a directory called {file_rename_dirname}
+ containing 20 files.
+ - Rename all files in that directory replacing all dashes with
+ underscores
+ - Find the shortest command for copying all the files located in
+ {mv_src_dir} into the folder {mv_dst_dir}.
+ Create a shell script /home/student/mv_ukaz containing this commant
+ - Specify the shortest command which will, using the grep command,
+ write all normal (not hidden) files containing a string "mama" located
+ in working directory (pwd) into the file ~/mama.txt while writing errors such as
+ files in current directory being folders or symbolic links in the file called
+ "napake.txt"
+ - Write a program (which may be a shell script) that will track the contents
+ of /var/log/syslog for 5s. Every time an entry containing the string "zmeda"
+ appears in the syslog, in syslog, the script should output "imam ga".
+ In addition, the script should count down from 5 to 1 with a 1 second
+ interval. Store the script in /home/student/syslog_ukaz.sh .
+ - Install the packet "cowsay" and test it :)
- Set the variable TEST, which will have the same value as the
-variable USER + the number of variables that do not include the name
-TEST, for example polz37.
-- With the help of cURL count the number of "images" string occurences in html code (saved 24ur.com website) and save it to variable $images.
-- In directory "Mapa" exists file count.txt
-- Install packet "cowsay" and test it :)
-- Write shortest command possible which will with the help of Python start a simple (integrated) HTTP server and will serve the files from the current directory on port 8000."""
-}
+ variable USER + the number of variables which do not include the name
+ TEST, for example polz37.
+ - With the help of cURL count the number of "images" string occurences in the
+ page accessible from malishell at http://localhost/{curl_fname}.
+ On simpleArbiter within the shell where you are running test_task.py, set
+ the environment variable $images to this number.
+ - In the directory {wc_dirname} there is a file called count.txt. Write the
+ number of lines in this file into a file in the same directory.
+"""
+}
computers = {
'malishell': {
@@ -157,10 +181,6 @@ def task(IP_malishell, file_rename_dirname, mv_src_dir, mv_dst_dir, cowsay_strin
#results['cowsay'] = subprocess.check_output(["dpkg --get-selections | grep","cowsay"])
#results['phttp'] = subprocess.check_output(["lsof -i ",":8080"])
-
-
-
-
return results
def gen_params(user_id, params_meta):