diff options
| author | Cassio de Campos <cassiopc@gmail.com> | 2017-08-10 10:49:24 +0000 |
|---|---|---|
| committer | Cassio de Campos <cassiopc@gmail.com> | 2017-08-10 10:49:24 +0000 |
| commit | e926ad94df156c2a58e35e24d25229e0ab041aae (patch) | |
| tree | 38db549a3337693aefe30e99582383d5e853e2f9 /tools/control-machines.sh | |
| parent | 02b4aacc81613792b0fa618692145dc1e2989e42 (diff) | |
| parent | 94c6cd12dacf9de46051c57e6f6bf216e86c8df8 (diff) | |
| download | boca-e926ad94df156c2a58e35e24d25229e0ab041aae.tar.gz boca-e926ad94df156c2a58e35e24d25229e0ab041aae.zip | |
Merge branch 'master' of github.com:cassiopc/boca
Diffstat (limited to 'tools/control-machines.sh')
| -rw-r--r-- | tools/control-machines.sh | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tools/control-machines.sh b/tools/control-machines.sh new file mode 100644 index 0000000..2b52e33 --- /dev/null +++ b/tools/control-machines.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +if [ "$1" == "users" ]; then + for i in `ls runs-submitted*.txt`; do + a="" + cat $i | while read lin; do + if [ "$a" == "" ]; then + a=$lin + else + a1=`echo $a | cut -d'-' -f1` + l1=`echo $lin | cut -d'-' -f1` + if [ "$a1" != "$l1" ]; then + echo "$i $a1 $l1" + a=$lin + fi + fi + done + done +else + if [ "$1" == "gencodes" ]; then + while read lin; do + #First Surname:email@gmail.com:Sao Paulo:SP:spsp:46:48479:146:qrw3 + pas="`echo -n $lin | cut -d':' -f9`" + pas="`echo -n $pas | sha256sum - | cut -f1 -d' '`" + astring="xyzxyzxyz" + pass="`echo -n "${astring}$pass" | sha256sum - | cut -f1 -d' '`" + echo "`echo -n $lin | cut -d':' -f5` $pas $pass 0" + done + else + for arquivo in runs-submitted-1-1-*txt; do + TIME="$(cut -d'-' -f5 <<< "$arquivo")" + printf "$TIME " + grep '\-2[0-1][0-9]\-' $arquivo|cut -d'-' -f1 |sort -u|wc -l + done + fi +fi + + +###example of generating score.sep +###First Surname:email@gmail.com:Sao Paulo:SP:spsp:46:48479:146:qrw3 +# #!/bin/bash +# while read lin; do +# prefix="`echo -n $lin | cut -d':' -f8`" +# prenam="`echo -n $lin | cut -d':' -f5`" +# echo "$prenam ${prefix}000/${prefix}399/1 # /^team${prenam}/ /^staff${prenam}/ /^score${prenam}/" +# echo "${prenam}ccl ${prefix}000/${prefix}500/1 # /^staff${prenam}/ /^teamccl${prenam}/ /^judge/" +# done +# #!/bin/bash +# i=1 +# j=1 +# k=1 +# while [ $i -le 49 ]; do +# let "jj = $j + 1" +# let "ii = $i - 1" +# let "ff = $ii * 100 + 50000" +# let "gg = $i * 100 + 49999" +# echo "sede$i $ff/$gg/1 # /^team${j}\$/ /^team${jj}\$/ /^staff${i}\$/" +# let "i = $i + 1" +# let "j = $j + 2" +# done |