Update for new API

This commit is contained in:
Vrganj 2021-01-23 21:31:23 +01:00
commit c10a30b69a
78 changed files with 2063 additions and 868 deletions

View file

@ -1,4 +1,4 @@
#!/bin/bash
cd /tmp/$2
timeout -s KILL 2 sed "/___code___/Q" code.code > code.stdin
timeout -s KILL 2 sed "1,/___code___/d" code.code > code.awk
runuser runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 awk -f code.awk < code.stdin"
timeout -s KILL 3 xargs -a args.args -d '\n' awk -f code.code < stdin.stdin

View file

@ -1,2 +1,4 @@
#!/bin/bash
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 bash code.code"
xargs -a args.args -d '\n' timeout -s KILL 3 bash code.code < stdin.stdin

View file

@ -1,2 +1,4 @@
#!/bin/bash
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 brainfuck code.code"
timeout -s KILL 3 xargs -a args.args -d '\n' brainfuck code.code < stdin.stdin

View file

@ -1,3 +1,5 @@
#!/usr/bin/bash
cd /tmp/$2
timeout -s KILL 10 gcc -std=c11 -o binary -x c code.code
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"
gcc -std=c11 -o binary -x c code.code
timeout -s KILL 3 xargs -a args.args ./binary < stdin.stdin

View file

@ -1,3 +1,5 @@
#!/bin/bash
cd /tmp/$2
timeout -s KILL 10 g++ -std=c++17 -o binary -x c++ code.code
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"
g++ -std=c++17 -o binary -x c++ code.code
timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin

View file

@ -1,3 +1,5 @@
#!/bin/bash
cd /tmp/$2
timeout -s KILL 10 mcs $(echo code.code | sed 's/\///') -nowarn:0219 -out:binary
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 mono binary"
mcs $(echo code.code | sed 's/\///') -nowarn:0219 -out:binary
timeout -s KILL 3 xargs -a args.args -d '\n' mono binary < stdin.stdin

View file

@ -1,4 +1,6 @@
#!/bin/bash
cd /tmp/$2
cp code.code code.d
timeout -s KILL 10 dmd code.d
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./code"
xtimeout -s KILL 3 args -a args.args -d '\n' ./code

View file

@ -1,7 +1,4 @@
cd /tmp/$2
#!/bin/bash
if [[ -z $(grep '[^[:space:]]' args.args) ]]; then
runuser runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 deno run code.code"
else
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 deno run code.code"
fi
cd /tmp/$2
timeout -s KILL 3 xargs -a args.args -d '\n' deno run code.code < stdin.stdin

View file

@ -1,7 +1,6 @@
cd /tmp/$2
#!/bin/bash
if [[ -z $(grep '[^[:space:]]' args.args) ]]; then
runuser runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 elixir code.code"
else
runuser runner$1 -c "cd /tmp/$2 ; cat args.args ; xargs -d '\n' timeout -s KILL 3 elixir code.code"
fi
export LC_ALL="en_US.UTF-8"
cd /tmp/$2
timeout -s KILL 3 xargs -a args.args -d '\n' elixir code.code < stdin.stdin

View file

@ -1,7 +1,4 @@
cd /tmp/$2
#!/bin/bash
if [[ -z $(grep '[^[:space:]]' args.args) ]]; then
runuser -l runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 emacs -Q --script code.code"
else
runuser -l runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 emacs -Q --script code.code"
fi
cd /tmp/$2
timeout -s KILL 3 xargs -a args.args -d '\n' emacs -Q --script code.code < stdin.stdin

View file

@ -1,6 +1,6 @@
#!/bin/bash
cd /tmp/$2
cp code.code interim.go
file="interim.go"
timeout -s KILL 10 go build $file
file=${file%%.*}
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./$file"
go build interim.go
timeout -s KILL 3 xargs -a args.args -d '\n' ./interim < stdin.stdin

View file

@ -1,4 +1,6 @@
#!/bin/bash
cd /tmp/$2
mv code.code code.hs
timeout -s KILL 10 ghc -dynamic -o binary code.hs > /dev/null 2>&1
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"
cp code.code code.hs
ghc -dynamic -o binary code.hs > /dev/null 2>&1
timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin

View file

@ -1,6 +1,7 @@
#!/bin/bash
cd /tmp/$2
cp code.code interim.java
name=$(grep -Po "(?<=\n|\A)\s*(public\s+)?(class|interface)\s+\K([^\n\s{]+)" interim.java)
mv interim.java $name.java
timeout -s KILL 10 javac $name.java
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 java $name"
name=$(grep -Po "(?<=\n|\A)\s*(public\s+)?(class|interface)\s+\K([^\/\\\\\n\s{]+)" code.code)
cp code.code $name.java
javac $name.java
timeout -s KILL 3 xargs -a args.args -d '\n' java $name < stdin.stdin

View file

@ -1,2 +1,4 @@
#!/bin/bash
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 jelly fu code.code"
timeout -s KILL 3 xargs -a args.args -d '\n' jelly fu code.code < stdin.stdin

View file

@ -1,2 +1,4 @@
#!/bin/bash
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 julia code.code"
timeout -s KILL 3 xargs -a args.args -d '\n' julia code.code < stdin.stdin

View file

@ -1,4 +1,6 @@
#!/bin/bash
cd /tmp/$2
cp code.code code.kt
timeout -s KILL 10 kotlinc code.kt -include-runtime -d code.jar
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 java -jar code.jar"
kotlinc code.kt -include-runtime -d code.jar
timeout -s KILL 3 xargs -a args.args -d '\n' java -jar code.jar < stdin.stdin

View file

@ -1,2 +1,4 @@
#!/bin/bash
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 lua code.code"
timeout -s KILL 3 xargs -a args.args -d '\n' lua code.code < stdin.stdin

View file

@ -1,4 +1,6 @@
#!/bin/bash
cd /tmp/$2
timeout -s KILL 10 nasm -f elf32 -o binary.o code.code
timeout -s KILL 10 ld -m elf_i386 binary.o -o binary
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"
nasm -f elf32 -o binary.o code.code
ld -m elf_i386 binary.o -o binary
timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin

View file

@ -1,4 +1,6 @@
#!/bin/bash
cd /tmp/$2
timeout -s KILL 10 nasm -f elf64 -o binary.o code.code
timeout -s KILL 10 ld -m elf_x86_64 binary.o -o binary
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"
nasm -f elf64 -o binary.o code.code
ld -m elf_x86_64 binary.o -o binary
timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin

View file

@ -1,4 +0,0 @@
cd /tmp/$2
timeout -s KILL 10 nim --hints:off c code.code
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./code"

View file

@ -1,7 +1,4 @@
cd /tmp/$2
#!/bin/bash
if [[ -z $(grep '[^[:space:]]' args.args) ]]; then
runuser runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 node code.code"
else
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 node code.code"
fi
cd /tmp/$2
timeout -s KILL 3 xargs -a args.args -d '\n' node code.code < stdin.stdin

View file

@ -1,2 +1,5 @@
#!/bin/bash
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 python3 -m paradoc code.code <<< args.args"
export PYTHONPATH=$PYTHONPATH:/opt/paradoc
timeout -s KILL 3 python3.8 -m paradoc code.code < args.args

View file

@ -1,2 +1,4 @@
#!/bin/bash
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 perl code.code"
timeout -s KILL 3 xargs -a args.args -d '\n' perl code.code < stdin.stdin

View file

@ -1,2 +1,4 @@
#!/bin/bash
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 php code.code"
timeout -s KILL 3 xargs -a args.args -d '\n' php code.code < stdin.stdin

View file

@ -1,2 +1,4 @@
#!/bin/bash
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 python code.code"
timeout -s KILL 3 xargs -a args.args -d '\n' python code.code < stdin.stdin

View file

@ -1,2 +1,4 @@
#!/bin/bash
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 python3.8 code.code"
timeout -s KILL 3 xargs -a args.args -d '\n' python3.8 code.code < stdin.stdin

View file

@ -1,2 +1,4 @@
#!/bin/bash
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ruby code.code"
timeout -s KILL 3 xargs -a args.args -d '\n' ruby code.code < stdin.stdin

View file

@ -1,3 +1,5 @@
#!/bin/bash
cd /tmp/$2
timeout -s KILL 10 rustc -o binary code.code
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary"
rustc -o binary code.code
timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin

View file

@ -1,2 +1,4 @@
#!/bin/bash
cd /tmp/$2
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 swift code.code"
timeout -s KILL 3 xargs -a args.args -d '\n' swift code.code < stdin.stdin

View file

@ -1,6 +1,8 @@
#!/bin/bash
cd /tmp/$2
mv code.code interim.ts
timeout -s KILL 10 tsc interim.ts
rm interim.ts
tsc interim.ts
rm -f interim.ts
mv interim.js code.code
runuser runner$1 -c "cd /tmp/$2 ; cat args.args | xargs -d '\n' timeout -s KILL 3 node code.code"
timeout -s KILL 3 xargs -a args.args -d '\n' node code.code < stdin.stdin