aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xold/C.compare129
-rwxr-xr-xold/C.run141
-rwxr-xr-xold/Cpp.compare129
-rwxr-xr-xold/Cpp.run142
-rwxr-xr-xold/Java.compare129
-rwxr-xr-xold/Java.run160
-rwxr-xr-xold/Pascal.compare129
-rwxr-xr-xold/Pascal.run107
-rwxr-xr-xold/compare.sh129
-rw-r--r--old/connect.php44
-rwxr-xr-xold/create-import-file.sh197
-rw-r--r--old/getextdata.old931
-rw-r--r--old/getextdata.php931
-rw-r--r--old/import-system.txt78
-rw-r--r--old/import.php280
-rw-r--r--old/import.txt1143
-rwxr-xr-xold/run.sh164
-rwxr-xr-xold/updatescore.sh118
-rw-r--r--old/webcast/config.php25
-rw-r--r--old/webcast/contest/index.php61
l---------old/webcast/index.php1
-rw-r--r--old/webcast/runs/index.php41
-rw-r--r--old/webcast/time/index.php12
-rw-r--r--old/webcast/version/index.php10
-rw-r--r--src/fextdata.php46
-rw-r--r--src/private/remotescores/otherservers1
-rwxr-xr-xtools/boca-auth-runs4
-rwxr-xr-xtools/boca-submit-run-aux6
-rw-r--r--tools/etc/apache2/conf.d/boca15
-rw-r--r--tools/etc/cron.hourly/.placeholder2
-rwxr-xr-xtools/etc/cron.hourly/ntp2
-rwxr-xr-xtools/etc/icpc/becomeserver.sh273
-rwxr-xr-xtools/etc/icpc/cleandisk.sh4
-rwxr-xr-xtools/etc/icpc/createbocajail.sh137
-rwxr-xr-xtools/etc/icpc/doclean.sh29
-rwxr-xr-xtools/etc/icpc/installboca.sh251
-rwxr-xr-xtools/etc/icpc/restart.sh31
-rwxr-xr-xtools/etc/icpc/setup.sh98
-rwxr-xr-xtools/etc/icpc/update.sh20
-rwxr-xr-xtools/etc/icpc/updatedbpass.sh85
-rw-r--r--tools/etc/network/if-pre-up.d/boca30
-rw-r--r--tools/etc/network/if-up.d/boca30
-rwxr-xr-xtools/etc/rc.local35
-rw-r--r--tools/etc/sysctl.d/10-shmmax.conf2
-rw-r--r--tools/etc/sysctl.d/10-vm-swappiness.conf1
-rwxr-xr-xtools/genpackage.sh64
-rw-r--r--tools/getrunlist.sh57
-rw-r--r--tools/icpc.etc.tgzbin9525 -> 0 bytes
-rwxr-xr-xtools/install_12_04.sh405
-rwxr-xr-xtools/installv2.sh373
-rwxr-xr-xtools/sendscore.sh69
-rwxr-xr-xtools/singlefilebkp.sh6
-rwxr-xr-xtools/updatescore.sh141
53 files changed, 32 insertions, 7416 deletions
diff --git a/old/C.compare b/old/C.compare
deleted file mode 100755
index cc4c63b..0000000
--- a/old/C.compare
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-#Last modified: 31/oct/2011 by cassio@ime.usp.br
-#
-# This script receives:
-# $1 team_output
-# $2 sol_output
-# $3 languagename
-# $4 problemname
-# $5 problem_input
-#
-# BOCA reads the last line of the standard output
-# and pass it to judges
-#
-if [ ! -r "$1" -o ! -r "$2" ]; then
- echo "Parameter problem"
- exit 43
-fi
-
-# if there is an special checker, use it. It can be defined by an sol_output
-# which has .sh extension (which makes it be executed instead of compared to)
-# or by the existence of the file bocachecker.$4 in the execution path (here
-# $4 is in fact the short problename, which has to match with the spec in BOCA)
-schecker=
-if [ ${2: -3} == ".sh" ]; then
- schecker=$2
- chmod 755 "$schecker"
-else
- if [ "$4" != "" ]; then
- schecker=`which "bocachecker.$4"`
- fi
-fi
-if [ -x "$schecker" ]; then
- echo "Calling special checker $schecker"
- "$schecker" "$@"
- ret=$?
- if [ "$ret" == "0" ]; then
- echo "Checker answered YES"
- exit 4
- fi
- if [ "$ret" == "1" ]; then
- echo "Checker answered WRONG ANSWER"
- exit 6
- fi
- if [ "$ret" == "2" ]; then
- echo "Checker answered OUTPUT FORMAT ERROR"
- exit 5
- fi
- echo "special checker returned unknown code"
- exit 43
-fi
-
-# Next lines of this script just compares team_output and sol_output,
-# although it is possible to change them to more complex evaluations.
-
-diff -q "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff \"$1\" \"$2\" # files match"
- echo "Files match exactly"
- exit 4
-fi
-diff -q -b "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b \"$1\" \"$2\" # files match"
- echo -e "diff -c \"$1\" \"$2\" # files dont match - see output"
- diff -c "$1" "$2"
- echo "Files match with differences in the amount of white spaces"
- exit 5
-fi
-diff -q -b -B "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b -B \"$1\" \"$2\" # files match"
- echo -e "diff -c -b \"$1\" \"$2\" # files dont match - see output"
- diff -c -b "$1" "$2"
- echo "Files match with differences in the amount of white spaces and blank lines"
- exit 5
-fi
-diff -q -i -b -B "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -i -b -B \"$1\" \"$2\" # files match"
- echo -e "diff -c -b -B \"$1\" \"$2\" # files dont match - see output"
- diff -c -b -B "$1" "$2"
- echo "Files match if we ignore case and differences in the amount of white spaces and blank lines"
- exit 5
-fi
-diff -q -b -B -w "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b -B -w \"$1\" \"$2\" # files match"
- echo -e "diff -c -i -b -B \"$1\" \"$2\" # files dont match - see output"
- diff -c -i -b -B "$1" "$2"
- echo "Files match if we discard all white spaces"
- exit 5
-fi
-diff -q -i -b -B -w "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -i -b -B -w \"$1\" \"$2\" # files match"
- echo -e "diff -c -b -B -w \"$1\" \"$2\" # files dont match - see output"
- diff -c -b -B -w "$1" "$2"
- echo "Files match if we ignore case and discard all white spaces"
- exit 5
-fi
-wd=`which wdiff`
-if [ "$wd" != "" ]; then
- wdiff \"$1\" \"$2\" >/dev/null 2>/dev/null
- if [ "$?" == "0" ]; then
- echo -e "wdiff \"$1\" \"$2\" # files match"
- echo -e "diff -c -i -b -B -w \"$1\" \"$2\" # files dont match - see output"
- diff -c -i -b -B -w "$1" "$2"
- echo "BUT Files match if we compare word by word, ignoring everything else, using wdiff"
- echo "diff has a bug that, if a line contains a single space, this is not discarded by -w"
- exit 5
- fi
-fi
-echo -e "### files dont match - see output"
-diff -c -i -b -B -w "$1" "$2"
-echo "Differences found"
-exit 6
diff --git a/old/C.run b/old/C.run
deleted file mode 100755
index 6336c09..0000000
--- a/old/C.run
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-#Last modified: 17/oct/2011 by cassio@ime.usp.br
-#
-# parameters are:
-# $1 base_filename
-# $2 source_file
-# $3 input_file
-# $4 languagename
-# $5 problemname
-# $6 timelimit
-#
-# the output of the submission should be directed to the standard output
-#
-# the return code show what happened (according to safeexec):
-# 0 ok
-# 1 compile error
-# 2 runtime error
-# 3 timelimit exceeded
-# 4 internal error
-# 5 parameter error
-# 6 internal error
-# 7 memory limit exceeded
-# 8 security threat
-# 9 runtime error
-# other_codes are unknown to boca: in this case BOCA will present the
-# last line of standard output to the judge
-
-umask 0022
-id -u bocajail >/dev/null 2>/dev/null
-if [ $? == 0 ]; then
- bocau=`id -u bocajail`
- bocag=`id -g bocajail`
- chown bocajail.nogroup .
-else
- bocau=`id -u nobody`
- bocag=`id -g nobody`
- chown nobody.nogroup .
-fi
-if [ "$bocau" == "" -o "$bocag" == "" ]; then
- echo "error finding user to run script"
- exit 43
-fi
-
-# this script makes use of safeexec to execute the code with less privilegies
-# make sure that directories below are correct.
-sf=`which safeexec`
-[ -x "$sf" ] || sf=/usr/bin/safeexec
-gcc=`which gcc`
-[ -x "$gcc" ] || gcc=/usr/bin/gcc
-
-if [ "$1" == "" -o "$2" == "" -o "$3" == "" ]; then
- echo "parameter problem"
- exit 43
-fi
-if [ ! -r $2 ]; then
- echo "$2 not found or it's not readable"
- exit 44
-fi
-if [ ! -r $3 ]; then
- echo "$3 not found or it's not readable"
- exit 45
-fi
-if [ ! -x $sf ]; then
- echo "$sf not found or it's not executable"
- exit 46
-fi
-if [ ! -x $gcc ]; then
- echo "$gcc not found or it's not executable"
- exit 47
-fi
-
-prefix=$1
-name=$2
-input=$3
-
-# setting up the timelimit according to the problem
-if [ "$6" == "" ]; then
-time=5
-else
-time=$6
-fi
-let ttime=$time+30
-
-$gcc -O2 -lm -o $prefix "$name"
-ret=$?
-if [ "$ret" != "0" ]; then
- echo "Compilation Error: $ret"
- exit 1
-else
- cdir=`pwd`
- echo "Current directory is $cdir" >&2
- echo $cdir | grep -q "/bocajail"
- if [ $? == 0 ]; then
- cdir=`echo $cdir | sed "s/.*\/bocajail//"`
- cat <<EOF > runit.sh
-#!/bin/bash
-[ -f /proc/cpuinfo ] || /bin/mount -t proc proc /proc
-#/bin/mount --bind /dev /dev
-[ -d /sys/kernel ] || /bin/mount -t sysfs sysfs /sys
-cd $cdir
-$sf -F10 -n0 -U$bocau -G$bocag -C. -ostdout0 -estderr0 -d512000 -m512000 -f20000 -t$time -T$ttime -i$input ./$prefix
-echo \$? > runit.retcode
-/bin/umount /proc 2>/dev/null
-#/bin/umount /dev
-/bin/umount /sys 2>/dev/null
-EOF
- chmod 755 runit.sh
- chroot /bocajail $cdir/runit.sh
- ret=`cat runit.retcode`
- if [ "$ret" == "" ]; then
- echo "Execution error - check autojudging"
- exit 49
- fi
- else
- echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2
- echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2
- echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2
- $sf -F10 -n0 -C. -U$bocau -G$bocag -ostdout0 -estderr0 -d512000000 -m512000000 -t$time -T$ttime -i$input ./$prefix
- ret=$?
- fi
- if [ $ret -gt 10 ]; then
- ret=0
- fi
-fi
-if [ -f stdout0 ]; then
- cat stdout0
-fi
-exit $ret
diff --git a/old/Cpp.compare b/old/Cpp.compare
deleted file mode 100755
index cc4c63b..0000000
--- a/old/Cpp.compare
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-#Last modified: 31/oct/2011 by cassio@ime.usp.br
-#
-# This script receives:
-# $1 team_output
-# $2 sol_output
-# $3 languagename
-# $4 problemname
-# $5 problem_input
-#
-# BOCA reads the last line of the standard output
-# and pass it to judges
-#
-if [ ! -r "$1" -o ! -r "$2" ]; then
- echo "Parameter problem"
- exit 43
-fi
-
-# if there is an special checker, use it. It can be defined by an sol_output
-# which has .sh extension (which makes it be executed instead of compared to)
-# or by the existence of the file bocachecker.$4 in the execution path (here
-# $4 is in fact the short problename, which has to match with the spec in BOCA)
-schecker=
-if [ ${2: -3} == ".sh" ]; then
- schecker=$2
- chmod 755 "$schecker"
-else
- if [ "$4" != "" ]; then
- schecker=`which "bocachecker.$4"`
- fi
-fi
-if [ -x "$schecker" ]; then
- echo "Calling special checker $schecker"
- "$schecker" "$@"
- ret=$?
- if [ "$ret" == "0" ]; then
- echo "Checker answered YES"
- exit 4
- fi
- if [ "$ret" == "1" ]; then
- echo "Checker answered WRONG ANSWER"
- exit 6
- fi
- if [ "$ret" == "2" ]; then
- echo "Checker answered OUTPUT FORMAT ERROR"
- exit 5
- fi
- echo "special checker returned unknown code"
- exit 43
-fi
-
-# Next lines of this script just compares team_output and sol_output,
-# although it is possible to change them to more complex evaluations.
-
-diff -q "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff \"$1\" \"$2\" # files match"
- echo "Files match exactly"
- exit 4
-fi
-diff -q -b "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b \"$1\" \"$2\" # files match"
- echo -e "diff -c \"$1\" \"$2\" # files dont match - see output"
- diff -c "$1" "$2"
- echo "Files match with differences in the amount of white spaces"
- exit 5
-fi
-diff -q -b -B "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b -B \"$1\" \"$2\" # files match"
- echo -e "diff -c -b \"$1\" \"$2\" # files dont match - see output"
- diff -c -b "$1" "$2"
- echo "Files match with differences in the amount of white spaces and blank lines"
- exit 5
-fi
-diff -q -i -b -B "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -i -b -B \"$1\" \"$2\" # files match"
- echo -e "diff -c -b -B \"$1\" \"$2\" # files dont match - see output"
- diff -c -b -B "$1" "$2"
- echo "Files match if we ignore case and differences in the amount of white spaces and blank lines"
- exit 5
-fi
-diff -q -b -B -w "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b -B -w \"$1\" \"$2\" # files match"
- echo -e "diff -c -i -b -B \"$1\" \"$2\" # files dont match - see output"
- diff -c -i -b -B "$1" "$2"
- echo "Files match if we discard all white spaces"
- exit 5
-fi
-diff -q -i -b -B -w "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -i -b -B -w \"$1\" \"$2\" # files match"
- echo -e "diff -c -b -B -w \"$1\" \"$2\" # files dont match - see output"
- diff -c -b -B -w "$1" "$2"
- echo "Files match if we ignore case and discard all white spaces"
- exit 5
-fi
-wd=`which wdiff`
-if [ "$wd" != "" ]; then
- wdiff \"$1\" \"$2\" >/dev/null 2>/dev/null
- if [ "$?" == "0" ]; then
- echo -e "wdiff \"$1\" \"$2\" # files match"
- echo -e "diff -c -i -b -B -w \"$1\" \"$2\" # files dont match - see output"
- diff -c -i -b -B -w "$1" "$2"
- echo "BUT Files match if we compare word by word, ignoring everything else, using wdiff"
- echo "diff has a bug that, if a line contains a single space, this is not discarded by -w"
- exit 5
- fi
-fi
-echo -e "### files dont match - see output"
-diff -c -i -b -B -w "$1" "$2"
-echo "Differences found"
-exit 6
diff --git a/old/Cpp.run b/old/Cpp.run
deleted file mode 100755
index 6c6d7ea..0000000
--- a/old/Cpp.run
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-#Last modified: 17/oct/2011 by cassio@ime.usp.br
-#
-# parameters are:
-# $1 base_filename
-# $2 source_file
-# $3 input_file
-# $4 languagename
-# $5 problemname
-# $6 timelimit
-#
-# the output of the submission should be directed to the standard output
-#
-# the return code show what happened:
-# 0 ok
-# 1 compile error
-# 2 runtime error
-# 3 timelimit exceeded
-# 4 internal error
-# 5 parameter error
-# 6 internal error
-# 7 memory limit exceeded
-# 8 security threat
-# 9 runtime error
-# other_codes are unknown to boca: in this case BOCA will present the
-# last line of standard output to the judge
-
-umask 0022
-id -u bocajail >/dev/null 2>/dev/null
-if [ $? == 0 ]; then
- bocau=`id -u bocajail`
- bocag=`id -g bocajail`
- chown bocajail.nogroup .
-else
- bocau=`id -u nobody`
- bocag=`id -g nobody`
- chown nobody.nogroup .
-fi
-if [ "$bocau" == "" -o "$bocag" == "" ]; then
- echo "error finding user to run script"
- exit 43
-fi
-
-# this script makes use of safeexec to execute the code with less privilegies
-# make sure that directories below are correct.
-sf=`which safeexec`
-[ -x "$sf" ] || sf=/usr/bin/safeexec
-gpp=`which g++`
-[ -x "$gpp" ] || gcc=/usr/bin/g++
-
-if [ "$1" == "" -o "$2" == "" -o "$3" == "" ]; then
- echo "parameter problem"
- exit 43
-fi
-if [ ! -r $2 ]; then
- echo "$2 not found or it's not readable"
- exit 44
-fi
-if [ ! -r $3 ]; then
- echo "$3 not found or it's not readable"
- exit 45
-fi
-if [ ! -x $sf ]; then
- echo "$sf not found or it's not executable"
- exit 46
-fi
-if [ ! -x $gpp ]; then
- echo "$gpp not found or it's not executable"
- exit 47
-fi
-
-prefix=$1
-name=$2
-input=$3
-
-# setting up the timelimit according to the problem
-# note that problems should spelling the same as inside BOCA
-if [ "$6" == "" ]; then
-time=5
-else
-time=$6
-fi
-let ttime=$time+30
-
-$gpp -O2 -lm -o $prefix "$name"
-ret=$?
-if [ "$ret" != "0" ]; then
- echo "Compiling Error: $ret"
- exit 1
-else
- cdir=`pwd`
- echo "Current directory is $cdir" >&2
- echo $cdir | grep -q "/bocajail"
- if [ $? == 0 ]; then
- cdir=`echo $cdir | sed "s/.*\/bocajail//"`
- cat <<EOF > runit.sh
-#!/bin/bash
-[ -f /proc/cpuinfo ] || /bin/mount -t proc proc /proc
-#/bin/mount --bind /dev /dev
-[ -d /sys/kernel ] || /bin/mount -t sysfs sysfs /sys
-cd $cdir
-$sf -F10 -t$time -T$ttime -i$input -ostdout0 -estderr0 -U$bocau -G$bocag -n0 -C. -f20000 -d512000 -m512000 ./$prefix
-echo \$? > runit.retcode
-/bin/umount /proc 2>/dev/null
-#/bin/umount /dev
-/bin/umount /sys 2>/dev/null
-EOF
- chmod 755 runit.sh
- chroot /bocajail $cdir/runit.sh
- ret=`cat runit.retcode`
- if [ "$ret" == "" ]; then
- echo "Execution error - check autojudging"
- exit 49
- fi
- else
- echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2
- echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2
- echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2
- $sf -F10 -n0 -C. -U$bocau -G$bocag -ostdout0 -estderr0 -d512000000 -m512000000 -t$time -T$ttime -i$input ./$prefix
- ret=$?
- fi
- if [ $ret -gt 10 ]; then
- ret=0
- fi
-fi
-if [ -f stdout0 ]; then
- cat stdout0
-fi
-exit $ret
diff --git a/old/Java.compare b/old/Java.compare
deleted file mode 100755
index cc4c63b..0000000
--- a/old/Java.compare
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-#Last modified: 31/oct/2011 by cassio@ime.usp.br
-#
-# This script receives:
-# $1 team_output
-# $2 sol_output
-# $3 languagename
-# $4 problemname
-# $5 problem_input
-#
-# BOCA reads the last line of the standard output
-# and pass it to judges
-#
-if [ ! -r "$1" -o ! -r "$2" ]; then
- echo "Parameter problem"
- exit 43
-fi
-
-# if there is an special checker, use it. It can be defined by an sol_output
-# which has .sh extension (which makes it be executed instead of compared to)
-# or by the existence of the file bocachecker.$4 in the execution path (here
-# $4 is in fact the short problename, which has to match with the spec in BOCA)
-schecker=
-if [ ${2: -3} == ".sh" ]; then
- schecker=$2
- chmod 755 "$schecker"
-else
- if [ "$4" != "" ]; then
- schecker=`which "bocachecker.$4"`
- fi
-fi
-if [ -x "$schecker" ]; then
- echo "Calling special checker $schecker"
- "$schecker" "$@"
- ret=$?
- if [ "$ret" == "0" ]; then
- echo "Checker answered YES"
- exit 4
- fi
- if [ "$ret" == "1" ]; then
- echo "Checker answered WRONG ANSWER"
- exit 6
- fi
- if [ "$ret" == "2" ]; then
- echo "Checker answered OUTPUT FORMAT ERROR"
- exit 5
- fi
- echo "special checker returned unknown code"
- exit 43
-fi
-
-# Next lines of this script just compares team_output and sol_output,
-# although it is possible to change them to more complex evaluations.
-
-diff -q "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff \"$1\" \"$2\" # files match"
- echo "Files match exactly"
- exit 4
-fi
-diff -q -b "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b \"$1\" \"$2\" # files match"
- echo -e "diff -c \"$1\" \"$2\" # files dont match - see output"
- diff -c "$1" "$2"
- echo "Files match with differences in the amount of white spaces"
- exit 5
-fi
-diff -q -b -B "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b -B \"$1\" \"$2\" # files match"
- echo -e "diff -c -b \"$1\" \"$2\" # files dont match - see output"
- diff -c -b "$1" "$2"
- echo "Files match with differences in the amount of white spaces and blank lines"
- exit 5
-fi
-diff -q -i -b -B "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -i -b -B \"$1\" \"$2\" # files match"
- echo -e "diff -c -b -B \"$1\" \"$2\" # files dont match - see output"
- diff -c -b -B "$1" "$2"
- echo "Files match if we ignore case and differences in the amount of white spaces and blank lines"
- exit 5
-fi
-diff -q -b -B -w "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b -B -w \"$1\" \"$2\" # files match"
- echo -e "diff -c -i -b -B \"$1\" \"$2\" # files dont match - see output"
- diff -c -i -b -B "$1" "$2"
- echo "Files match if we discard all white spaces"
- exit 5
-fi
-diff -q -i -b -B -w "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -i -b -B -w \"$1\" \"$2\" # files match"
- echo -e "diff -c -b -B -w \"$1\" \"$2\" # files dont match - see output"
- diff -c -b -B -w "$1" "$2"
- echo "Files match if we ignore case and discard all white spaces"
- exit 5
-fi
-wd=`which wdiff`
-if [ "$wd" != "" ]; then
- wdiff \"$1\" \"$2\" >/dev/null 2>/dev/null
- if [ "$?" == "0" ]; then
- echo -e "wdiff \"$1\" \"$2\" # files match"
- echo -e "diff -c -i -b -B -w \"$1\" \"$2\" # files dont match - see output"
- diff -c -i -b -B -w "$1" "$2"
- echo "BUT Files match if we compare word by word, ignoring everything else, using wdiff"
- echo "diff has a bug that, if a line contains a single space, this is not discarded by -w"
- exit 5
- fi
-fi
-echo -e "### files dont match - see output"
-diff -c -i -b -B -w "$1" "$2"
-echo "Differences found"
-exit 6
diff --git a/old/Java.run b/old/Java.run
deleted file mode 100755
index 7708811..0000000
--- a/old/Java.run
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-#Last modified: 17/oct/2011 by cassio@ime.usp.br
-#
-# parameters are:
-# $1 base_filename
-# $2 source_file
-# $3 input_file
-# $4 languagename
-# $5 problemname
-# $6 timelimit
-#
-# the output of the submission should be directed to the standard output
-#
-# the return code show what happened:
-# 0 ok
-# 1 compile error
-# 2 runtime error
-# 3 timelimit exceeded
-# 4 internal error
-# 5 parameter error
-# 6 internal error
-# 7 memory limit exceeded
-# 8 security threat
-# 9 runtime error
-# other_codes are unknown to boca: in this case BOCA will present the
-# last line of standard output to the judge
-
-umask 0022
-id -u bocajail >/dev/null 2>/dev/null
-if [ $? == 0 ]; then
- bocau=`id -u bocajail`
- bocag=`id -g bocajail`
- chown bocajail.nogroup .
-else
- bocau=`id -u nobody`
- bocag=`id -g nobody`
- chown nobody.nogroup .
-fi
-if [ "$bocau" == "" -o "$bocag" == "" ]; then
- echo "error finding user to run script"
- exit 43
-fi
-
-export CLASSPATH=.:$CLASSPATH
-
-# this script makes use of safeexec to execute the code with less privilegies
-# make sure that directories below are correct.
-sf=`which safeexec`
-[ -x "$sf" ] || sf=/usr/bin/safeexec
-java=`which java`
-[ -x "$java" ] || java=/usr/java/bin/java
-javac=`which javac`
-[ -x "$javac" ] || javac=/usr/java/bin/javac
-
-if [ "$1" == "" -o "$2" == "" -o "$3" == "" ]; then
- echo "parameter problem"
- exit 43
-fi
-if [ ! -r $2 ]; then
- echo "$2 not found or it's not readable"
- exit 44
-fi
-if [ ! -r $3 ]; then
- echo "$3 not found or it's not readable"
- exit 45
-fi
-if [ ! -x $sf ]; then
- echo "$sf not found or it's not executable"
- exit 46
-fi
-if [ ! -x $java ]; then
- echo "$java not found or it's not executable"
- exit 47
-fi
-if [ ! -x $javac ]; then
- echo "$javac not found or it's not executable"
- exit 47
-fi
-
-prefix=$1
-name=$2
-input=$3
-
-# setting up the timelimit according to the problem
-# note that problems should spelling the same as inside BOCA
-if [ "$6" == "" ]; then
-time=5
-else
-time=$6
-fi
-let ttime=$time+30
-
-$javac "$name"
-ret=$?
-if [ "$ret" != "0" ]; then
- echo "Compilation Error: $ret"
- exit 1
-else
- if [ ! -f "$prefix.class" ]; then
- echo "Class file $prefix.class not generated - possible name mismatch"
- exit 48
- fi
- cdir=`pwd`
- echo "Current directory is $cdir" >&2
- echo $cdir | grep -q "/bocajail"
- if [ $? == 0 ]; then
- cdir=`echo $cdir | sed "s/.*\/bocajail//"`
- cat <<EOF > runit.sh
-#!/bin/bash
-[ -f /proc/cpuinfo ] || /bin/mount -t proc proc /proc
-#/bin/mount --bind /dev /dev
-[ -d /sys/kernel ] || /bin/mount -t sysfs sysfs /sys
-cd $cdir
-$sf -t$time -T$ttime -i$input -F256 -u256 -ostdout0 -estderr0 -U$bocau -G$bocag -n0 -C. -f20000 -d1000000 -m1000000 -- $java -Xmx512M -Xms512M $prefix
-echo \$? > runit.retcode
-/bin/umount /proc 2>/dev/null
-#/bin/umount /dev
-/bin/umount /sys 2>/dev/null
-EOF
- chmod 755 runit.sh
- chroot /bocajail $cdir/runit.sh
- ret=`cat runit.retcode`
- if [ "$ret" == "" ]; then
- echo "Execution error - check autojudging"
- exit 49
- fi
- if [ $ret -gt 10 ]; then
- echo "> > > > > > > Nonzero return code - possible runtime error - GUESSING IT IS RUNTIME ERROR! < < < < < < < <"
- exit 9
- fi
- else
- echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2
- echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2
- echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2
-# $java $prefix < $input
- $sf -t$time -T$ttime -i$input -F256 -u256 -U$bocau -G$bocag -ostdout0 -estderr0 -n0 -C. -d900000000 -m900000000 -- $java -Xmx512M -Xms512M $prefix
- ret=$?
- fi
- if [ $ret -gt 10 ]; then
- echo "> > > > > > > Nonzero return code - possible runtime error - GUESSING IT IS RUNTIME ERROR! < < < < < < < <"
- ret=9
- fi
-fi
-if [ -f stdout0 ]; then
- cat stdout0
-fi
-exit $ret
diff --git a/old/Pascal.compare b/old/Pascal.compare
deleted file mode 100755
index cc4c63b..0000000
--- a/old/Pascal.compare
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-#Last modified: 31/oct/2011 by cassio@ime.usp.br
-#
-# This script receives:
-# $1 team_output
-# $2 sol_output
-# $3 languagename
-# $4 problemname
-# $5 problem_input
-#
-# BOCA reads the last line of the standard output
-# and pass it to judges
-#
-if [ ! -r "$1" -o ! -r "$2" ]; then
- echo "Parameter problem"
- exit 43
-fi
-
-# if there is an special checker, use it. It can be defined by an sol_output
-# which has .sh extension (which makes it be executed instead of compared to)
-# or by the existence of the file bocachecker.$4 in the execution path (here
-# $4 is in fact the short problename, which has to match with the spec in BOCA)
-schecker=
-if [ ${2: -3} == ".sh" ]; then
- schecker=$2
- chmod 755 "$schecker"
-else
- if [ "$4" != "" ]; then
- schecker=`which "bocachecker.$4"`
- fi
-fi
-if [ -x "$schecker" ]; then
- echo "Calling special checker $schecker"
- "$schecker" "$@"
- ret=$?
- if [ "$ret" == "0" ]; then
- echo "Checker answered YES"
- exit 4
- fi
- if [ "$ret" == "1" ]; then
- echo "Checker answered WRONG ANSWER"
- exit 6
- fi
- if [ "$ret" == "2" ]; then
- echo "Checker answered OUTPUT FORMAT ERROR"
- exit 5
- fi
- echo "special checker returned unknown code"
- exit 43
-fi
-
-# Next lines of this script just compares team_output and sol_output,
-# although it is possible to change them to more complex evaluations.
-
-diff -q "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff \"$1\" \"$2\" # files match"
- echo "Files match exactly"
- exit 4
-fi
-diff -q -b "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b \"$1\" \"$2\" # files match"
- echo -e "diff -c \"$1\" \"$2\" # files dont match - see output"
- diff -c "$1" "$2"
- echo "Files match with differences in the amount of white spaces"
- exit 5
-fi
-diff -q -b -B "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b -B \"$1\" \"$2\" # files match"
- echo -e "diff -c -b \"$1\" \"$2\" # files dont match - see output"
- diff -c -b "$1" "$2"
- echo "Files match with differences in the amount of white spaces and blank lines"
- exit 5
-fi
-diff -q -i -b -B "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -i -b -B \"$1\" \"$2\" # files match"
- echo -e "diff -c -b -B \"$1\" \"$2\" # files dont match - see output"
- diff -c -b -B "$1" "$2"
- echo "Files match if we ignore case and differences in the amount of white spaces and blank lines"
- exit 5
-fi
-diff -q -b -B -w "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b -B -w \"$1\" \"$2\" # files match"
- echo -e "diff -c -i -b -B \"$1\" \"$2\" # files dont match - see output"
- diff -c -i -b -B "$1" "$2"
- echo "Files match if we discard all white spaces"
- exit 5
-fi
-diff -q -i -b -B -w "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -i -b -B -w \"$1\" \"$2\" # files match"
- echo -e "diff -c -b -B -w \"$1\" \"$2\" # files dont match - see output"
- diff -c -b -B -w "$1" "$2"
- echo "Files match if we ignore case and discard all white spaces"
- exit 5
-fi
-wd=`which wdiff`
-if [ "$wd" != "" ]; then
- wdiff \"$1\" \"$2\" >/dev/null 2>/dev/null
- if [ "$?" == "0" ]; then
- echo -e "wdiff \"$1\" \"$2\" # files match"
- echo -e "diff -c -i -b -B -w \"$1\" \"$2\" # files dont match - see output"
- diff -c -i -b -B -w "$1" "$2"
- echo "BUT Files match if we compare word by word, ignoring everything else, using wdiff"
- echo "diff has a bug that, if a line contains a single space, this is not discarded by -w"
- exit 5
- fi
-fi
-echo -e "### files dont match - see output"
-diff -c -i -b -B -w "$1" "$2"
-echo "Differences found"
-exit 6
diff --git a/old/Pascal.run b/old/Pascal.run
deleted file mode 100755
index df98e41..0000000
--- a/old/Pascal.run
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-#Last modified: 25/may/2010 by cassiopc
-#
-# parameters are:
-# $1 base_filename
-# $2 source_file
-# $3 input_file
-# $4 languagename
-# $5 problemname
-# $6 timelimit
-#
-# the output of the submission should be directed to the standard output
-#
-# the return code show what happened:
-# 0 ok
-# 1 compile error
-# 2 runtime error
-# 3 timelimit exceeded
-# other_codes are unknown to boca: in this case BOCA will present the
-# last line of standard output to the judge
-
-umask 0022
-chown nobody.nogroup .
-
-# this script makes use of safeexec to execute the code with less privilegies
-# make sure that directories below are correct.
-grep=`which grep`
-[ -x "$grep" ] || grep=/bin/grep
-sf=`which safeexec`
-[ -x "$sf" ] || sf=/usr/bin/safeexec
-pascal=`which fpc`
-[ -x "$pascal" ] || pascal=/usr/bin/fpc
-
-if [ "$1" == "" -o "$2" == "" -o "$3" == "" ]; then
- echo "parameter problem"
- exit 43
-fi
-if [ ! -r $2 ]; then
- echo "$2 not found or it's not readable"
- exit 44
-fi
-if [ ! -r $3 ]; then
- echo "$3 not found or it's not readable"
- exit 45
-fi
-if [ ! -x $sf ]; then
- echo "$sf not found or it's not executable"
- exit 46
-fi
-if [ ! -x $pascal ]; then
- echo "$pascal not found or it's not executable"
- exit 47
-fi
-
-prefix=$1
-name=$2
-input=$3
-
-# setting up the timelimit according to the problem
-# note that problems should spelling the same as inside BOCA
-if [ "$6" == "" ]; then
-time=5
-else
-time=$6
-fi
-let ttime=$time+30
-
-$pascal -o$prefix $name >compiler.out 2>compiler.out
-$grep -irq linking compiler.out
-ret=$?
-$grep -irq "lines compiled" compiler.out
-ret2=$?
-if [ "$ret" != "0" -o "$ret2" != "0" ]; then
- cat compiler.out
- echo "Compiling Error: $ret"
- exit 1
-else
- $sf -F10 -t$time -T$ttime -i$input -opascal.out -n0 -R. ./$prefix
- ret=$?
- if [ -f pascal.out ]; then
- cat pascal.out
- $grep -irq "runtime error" pascal.out
- ret2=$?
- if [ "$ret2" = "0" ]; then
- echo "Strange output - possible runtime error"
- if [ $ret -lt 4 ]; then
- ret=48
- fi
- fi
- else
- echo "Output file not found - possible runtime error"
- fi
-fi
-exit $ret
diff --git a/old/compare.sh b/old/compare.sh
deleted file mode 100755
index cc4c63b..0000000
--- a/old/compare.sh
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-#Last modified: 31/oct/2011 by cassio@ime.usp.br
-#
-# This script receives:
-# $1 team_output
-# $2 sol_output
-# $3 languagename
-# $4 problemname
-# $5 problem_input
-#
-# BOCA reads the last line of the standard output
-# and pass it to judges
-#
-if [ ! -r "$1" -o ! -r "$2" ]; then
- echo "Parameter problem"
- exit 43
-fi
-
-# if there is an special checker, use it. It can be defined by an sol_output
-# which has .sh extension (which makes it be executed instead of compared to)
-# or by the existence of the file bocachecker.$4 in the execution path (here
-# $4 is in fact the short problename, which has to match with the spec in BOCA)
-schecker=
-if [ ${2: -3} == ".sh" ]; then
- schecker=$2
- chmod 755 "$schecker"
-else
- if [ "$4" != "" ]; then
- schecker=`which "bocachecker.$4"`
- fi
-fi
-if [ -x "$schecker" ]; then
- echo "Calling special checker $schecker"
- "$schecker" "$@"
- ret=$?
- if [ "$ret" == "0" ]; then
- echo "Checker answered YES"
- exit 4
- fi
- if [ "$ret" == "1" ]; then
- echo "Checker answered WRONG ANSWER"
- exit 6
- fi
- if [ "$ret" == "2" ]; then
- echo "Checker answered OUTPUT FORMAT ERROR"
- exit 5
- fi
- echo "special checker returned unknown code"
- exit 43
-fi
-
-# Next lines of this script just compares team_output and sol_output,
-# although it is possible to change them to more complex evaluations.
-
-diff -q "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff \"$1\" \"$2\" # files match"
- echo "Files match exactly"
- exit 4
-fi
-diff -q -b "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b \"$1\" \"$2\" # files match"
- echo -e "diff -c \"$1\" \"$2\" # files dont match - see output"
- diff -c "$1" "$2"
- echo "Files match with differences in the amount of white spaces"
- exit 5
-fi
-diff -q -b -B "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b -B \"$1\" \"$2\" # files match"
- echo -e "diff -c -b \"$1\" \"$2\" # files dont match - see output"
- diff -c -b "$1" "$2"
- echo "Files match with differences in the amount of white spaces and blank lines"
- exit 5
-fi
-diff -q -i -b -B "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -i -b -B \"$1\" \"$2\" # files match"
- echo -e "diff -c -b -B \"$1\" \"$2\" # files dont match - see output"
- diff -c -b -B "$1" "$2"
- echo "Files match if we ignore case and differences in the amount of white spaces and blank lines"
- exit 5
-fi
-diff -q -b -B -w "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b -B -w \"$1\" \"$2\" # files match"
- echo -e "diff -c -i -b -B \"$1\" \"$2\" # files dont match - see output"
- diff -c -i -b -B "$1" "$2"
- echo "Files match if we discard all white spaces"
- exit 5
-fi
-diff -q -i -b -B -w "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -i -b -B -w \"$1\" \"$2\" # files match"
- echo -e "diff -c -b -B -w \"$1\" \"$2\" # files dont match - see output"
- diff -c -b -B -w "$1" "$2"
- echo "Files match if we ignore case and discard all white spaces"
- exit 5
-fi
-wd=`which wdiff`
-if [ "$wd" != "" ]; then
- wdiff \"$1\" \"$2\" >/dev/null 2>/dev/null
- if [ "$?" == "0" ]; then
- echo -e "wdiff \"$1\" \"$2\" # files match"
- echo -e "diff -c -i -b -B -w \"$1\" \"$2\" # files dont match - see output"
- diff -c -i -b -B -w "$1" "$2"
- echo "BUT Files match if we compare word by word, ignoring everything else, using wdiff"
- echo "diff has a bug that, if a line contains a single space, this is not discarded by -w"
- exit 5
- fi
-fi
-echo -e "### files dont match - see output"
-diff -c -i -b -B -w "$1" "$2"
-echo "Differences found"
-exit 6
diff --git a/old/connect.php b/old/connect.php
deleted file mode 100644
index 1ee33da..0000000
--- a/old/connect.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-//////////////////////////////////////////////////////////////////////////////////////////
-//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-//
-//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-///////////////////////////////////////////////////////////////////////////////////////////
-// created 14/June/2011 by cassio@ime.usp.br
-require('header.php');
-
-if(($ct = DBContestInfo($_SESSION["usertable"]["contestnumber"])) == null)
- ForceLoad("../index.php");
-if(($st = DBSiteInfo($_SESSION["usertable"]["contestnumber"],$_SESSION["usertable"]["usersitenumber"])) == null)
- ForceLoad("../index.php");
-
-$fn = tempnam("/tmp","bkp-");
-$fout = fopen($fn,"wb");
-echo $_POST;
-echo $_POST['data'];
-fwrite($fout,base64_decode($_POST['data']));
-fclose($fout);
-$size=filesize($fn);
-$name=$_POST['name'];
-if ($size > $ct["contestmaxfilesize"] || strlen($name)>100 || strlen($name)<1) {
- LOGLevel("User {$_SESSION["usertable"]["username"]} tried to submit file " .
- ":${name}: with $size bytes.", 1);
- MSGError("File size exceeds the limit allowed or invalid name.");
-} else
-
- DBNewBkp ($_SESSION["usertable"]["contestnumber"],
- $_SESSION["usertable"]["usersitenumber"],
- $_SESSION["usertable"]["usernumber"],
- $name,
- $fn, $size);
-@unlink($fn);
-ForceLoad("../index.php");
-?>
diff --git a/old/create-import-file.sh b/old/create-import-file.sh
deleted file mode 100755
index 0d3ca9e..0000000
--- a/old/create-import-file.sh
+++ /dev/null
@@ -1,197 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2007- C. P. de Campos (cassio@ime.usp.br). All rights reserved.
-# Licensed under Q Public License version 1.0. See http://www.opensource.org/licenses/qtpl.php
-
-for i in /usr/bin/cut /bin/cat /bin/date /usr/bin/basename /bin/true /usr/bin/uuencode /usr/bin/wc /usr/bin/tail; do
- if [ ! -x $i ]; then
- echo "$i not found. Aborting"
- exit 1
- fi
-done
-
-if [ "$1" == "" -o "$2" == "" -o ! -d "$2" -o ! -r "$2" ]; then
- echo "Usage $0 <filename> <directory>"
- echo "filename will be overwritten."
- echo "directory must contain the following files:"
- echo " *.run: where * is a language name."
- echo " *.compare: where * is a language name."
- echo " *.in: where * is a problem name."
- echo " *.out: where * is a problem name."
- echo " *.pdf: where * is a problem name."
- echo " For better compatibility, use only letters in filenames (avoid spaces, symbols, etc)."
- exit 1
-fi
-file=$1
-dir=$2
-
-d=`/bin/date +%s`
-endmark=endmark$d
-
-echo -n "Enter the contest name: "
-read name
-
-echo -n "Enter your site name: "
-read site
-
-st=$d
-while /bin/true; do
- echo -n "Enter starting date (format complying with /bin/date. For example, '12/25/2007 13:34'): "
- read data
- st=`/bin/date -d "$data" +%s`
- if [ $? == 0 ]; then
- break
- fi
-done
-
-echo "Creating contest, site and answer sections"
-/bin/cat << EOFEOF > $file
-$endmark
-
-[contest]
-contestname=$name
-scorelevel=4
-sitename=$site
-startdate=$st
-
-[site]
-
-[answer]
-answernumber=1
-answername=NO - Compile error
-answeryes=f
-
-answernumber=2
-answername=NO - Runtime error
-answeryes=f
-
-answernumber=3
-answername=NO - Time limit exceeded
-answeryes=f
-
-answernumber=4
-answername=YES
-answeryes=t
-
-answernumber=5
-answername=NO - Presentation error
-answeryes=f
-
-answernumber=6
-answername=NO - Wrong answer
-answeryes=f
-
-answernumber=7
-answername=NO - Contact staff
-answeryes=f
-
-answernumber=8
-answername=NO - Problem/File name mismatch
-answeryes=f
-
-EOFEOF
-
-echo "Creating language section"
-echo "[language]" >> $file
-
-j=1
-for i in $dir/*.run ; do
- lang=`/usr/bin/basename "$i" .run`
- echo "Creating $lang"
- mds=`/usr/bin/md5sum $i | /usr/bin/cut -d" " -f1`
- mdc=`/usr/bin/md5sum $dir/$lang.compare | /usr/bin/cut -d" " -f1`
-
- echo -n "Enter language name: "
- read name
-
- /usr/bin/uuencode -m x < $dir/$lang.run > $file.tmp
- lin=`/usr/bin/wc -l $file.tmp | /usr/bin/cut -d" " -f1`
- let lin="$lin - 1"
-
- /bin/cat << EOFEOF >> $file
-langnumber=$j
-langname=$name
-langscriptmd5=$mds
-langcompscriptmd5=$mdc
-langscript=base64:$lang.run
-EOFEOF
- /usr/bin/tail -n $lin $file.tmp >> $file
- echo "***${endmark}***" >> $file
-
- /usr/bin/uuencode -m x < $dir/$lang.compare > $file.tmp
- lin=`/usr/bin/wc -l $file.tmp | /usr/bin/cut -d" " -f1`
- let lin="$lin - 1"
- echo "langcompscript=base64:$lang.compare" >> $file
- /usr/bin/tail -n $lin $file.tmp >> $file
- echo "***${endmark}***" >> $file
-
- echo "" >> $file
- let j="$j + 1"
-done
-
-echo "Creating problem section"
-echo "[problem]" >> $file
-letters="A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
-
-j=1
-for i in $dir/*.out ; do
- prob=`/usr/bin/basename "$i" .out`
- letter=`echo $letters | /usr/bin/cut -d" " -f$j`
- echo "Creating problem $letter (basename=$prob)"
-
- echo -n "Enter full name: "
- read full
- echo -n "Enter time limit: "
- read tl
- echo -n "Enter Color name: "
- read cn
- echo -n "Enter Color (html RGB format): "
- read rgb
-
- /bin/cat << EOFEOF >> $file
-probnumber=$j
-probname=$letter
-probfullname=$full
-probbasename=$prob
-probtimelimit=$tl
-probcolorname=$cn
-probcolor=$rgb
-EOFEOF
-
- if [ -r $dir/$prob.in ]; then
- mds=`/usr/bin/md5sum $dir/$prob.in | /usr/bin/cut -d" " -f1`
- echo "probinputfilemd5=$mds" >> $file
- echo "probinputfile=base64:$prob.in" >> $file
- /usr/bin/uuencode -m x < $dir/$prob.in > $file.tmp
- lin=`/usr/bin/wc -l $file.tmp | /usr/bin/cut -d" " -f1`
- let lin="$lin - 1"
- /usr/bin/tail -n $lin $file.tmp >> $file
- echo "***${endmark}***" >> $file
- fi
- if [ -r $dir/$prob.out ]; then
- mds=`/usr/bin/md5sum $dir/$prob.out | /usr/bin/cut -d" " -f1`
- echo "probsolfilemd5=$mds" >> $file
- echo "probsolfile=base64:$prob.out" >> $file
- /usr/bin/uuencode -m x < $dir/$prob.out > $file.tmp
- lin=`/usr/bin/wc -l $file.tmp | /usr/bin/cut -d" " -f1`
- let lin="$lin - 1"
- /usr/bin/tail -n $lin $file.tmp >> $file
- echo "***${endmark}***" >> $file
- fi
- if [ -r $dir/$prob.pdf ]; then
- mds=`/usr/bin/md5sum $dir/$prob.pdf | /usr/bin/cut -d" " -f1`
- echo "probdescfilemd5=$mds" >> $file
- echo "probdescfile=base64:$prob.pdf" >> $file
- /usr/bin/uuencode -m x < $dir/$prob.pdf > $file.tmp
- lin=`/usr/bin/wc -l $file.tmp | /usr/bin/cut -d" " -f1`
- let lin="$lin - 1"
- /usr/bin/tail -n $lin $file.tmp >> $file
- echo "***${endmark}***" >> $file
- fi
-
- echo "" >> $file
- let j="$j + 1"
-done
-
-echo "[end]" >> $file
-rm -f $file.tmp
-echo "Done."
diff --git a/old/getextdata.old b/old/getextdata.old
deleted file mode 100644
index 7c9955d..0000000
--- a/old/getextdata.old
+++ /dev/null
@@ -1,931 +0,0 @@
-<?php
-//////////////////////////////////////////////////////////////////////////////////////////
-//BOCA Online Contest Administrator. Copyright (c) 2003-2004 Cassio Polpo de Campos.
-//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-//
-//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-///////////////////////////////////////////////////////////////////////////////////////////
-
-//retorna ip do cliente
-function getIP() {
- if (getenv("HTTP_CLIENT_IP"))
- $ip = getenv("HTTP_CLIENT_IP");
- else
- if(getenv("HTTP_X_FORWARDED_FOR"))
- $ip = getenv("HTTP_X_FORWARDED_FOR");
- else
- if(getenv("REMOTE_ADDR"))
- $ip = getenv("REMOTE_ADDR");
- else
- $ip = "UNKNOWN";
- $ip = strtok ($ip, ",");
- return $ip;
-}
-//para compatibilidade com versoes velhas e novas do php
-function DB_lo_open($conn, $file, $mode) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_loopen ($conn, $file, $mode);
- else
- return pg_lo_open ($conn, $file, $mode);
-}
-function DB_lo_read_all($id) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_loreadall ($id);
- else
- return pg_lo_read_all ($id);
-}
-function DB_lo_import($conn, $file) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_loimport ($file, $conn);
- else
- return pg_lo_import ($conn, $file);
-}
-function DB_lo_close($id) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_loclose ($id);
- else
- return pg_lo_close ($id);
-}
-function DB_lo_unlink($c,$id) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_lounlink ($id,$c);
- else
- return pg_lo_unlink ($c,$id);
-}
-function DB_lo_create($conn) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_locreate ($conn);
- else
- return pg_lo_create ($conn);
-}
-function DB_lo_write($fp, $data) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_lowrite ($fp, $data);
- else
- return pg_lo_write ($fp, $data);
-}
-function DB_lo_read($fp, $len) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_loread ($fp, $len);
- else
- return pg_lo_read ($fp, $len);
-}
-
-//abrir conexao com o banco de dados
-function DBConnect() {
- $dbconn="host=localhost dbname=bocadb user=bocauser password=boca";
- $conn = pg_connect ($dbconn);
- if (!$conn) {
- echo "Unable to connect to local database\n";
- return null;
- }
- return $conn;
-}
-function DBExtConnect($c, $contest, $site) {
- $r = DBExec($c, "select * from sitetable where sitenumber=$site and contestnumber=$contest");
- if (DBnLines($r)==0) {
- echo "Unable to find the site in the database (site=$site, contest=$contest).\n";
- exit;
- }
- $st = DBRow($r,0);
-
- if(($f = file("sqlpass.php"))===false) $pass="boca";
- else $pass=trim($f[1]);
-
- // gambiarra para testar se a conexao esta de pe
- $fp = fsockopen ($st["siteip"], 5432, $errno, $errstr, 10);
- if (!$fp) {
- echo "$errstr ($errno). Aborting this connection (ip=".$st["siteip"].").\n";
- return null;
- }
- fclose ($fp);
- // se a conexao cair entre o teste acima e o connect abaixo, esse script pode demorar ate
- // dar o timeout (no meu teste foram cerca de 3min para cada timeout)
-
- $conn = pg_connect ("host=" . $st["siteip"] . " dbname=bocadb user=bocauser password=$pass");
- if (!$conn) {
- echo "Unable to connect to site $site (ip=".$st["siteip"].")\n";
- return null;
- }
- echo "Connected to " .$st["siteip"].". Let's exchange data...\n";
- return $conn;
-}
-
-function GetExternalData ($contest) {
- $c = DBConnect();
- if ($c==null) return;
- $r = DBExec($c, "select * from contesttable where contestnumber=$contest");
- if (DBnLines($r)==0) {
- echo "Unable to find the contest $contest in the database.\n";
- exit;
- }
- $ct = DBRow($r,0);
- $localsite = $ct["contestlocalsite"];
- $mainsite = $ct["contestmainsite"];
-
- if ($mainsite!=$localsite) {
- $r = DBExec($c, "select * from sitetable where sitenumber=".$ct["contestmainsite"]." and contestnumber=$contest");
- if (DBnLines($r)==0) {
- echo "Unable to find the main site in the database (site=$site, contest=$contest).\n";
- exit;
- }
- $st = DBRow($r,0);
- if (($t = DBExtConnect($c, $contest, $st["sitenumber"]))!=null) {
- DBExec($c, "begin work");
-
- // sincronizando contest
- $r = DBExec ($t, "select * from contesttable where contestnumber=$contest");
- $n = DBnLines ($r);
- $atual = DBRow($r,0);
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- DBExec ($c, "update contesttable set ".
- "contestduration=".$atual["contestduration"].",".
- "conteststartdate=".$atual["conteststartdate"].",".
- "contestmaxfilesize=".$atual["contestmaxfilesize"].",".
- "contestactive='".$atual["contestactive"]."',".
- //"contestmainsite=".$atual["contestmainsite"].",".
- "contestname='".escape_string($atual["contestname"])."',".
- "contestlastmileanswer=".$atual["contestlastmileanswer"].",".
- "contestlastmilescore=".$atual["contestlastmilescore"].",".
- "contestpenalty=".$atual["contestpenalty"].",".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and updatetime<".$atual["updatetime"]);
-
- // sincronizando answers
- $r = DBExec ($t, "select * from answertable where contestnumber=$contest");
- $rr = DBExec ($c, "select * from answertable where contestnumber=$contest for update");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "answers: external(site=$mainsite, reading=$mainsite)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["answernumber"]==$aqui["answernumber"] && $la["contestnumber"]==$aqui["contestnumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"])
- $situacao[$j]="atualizar";
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $del=0; $upd=0; $ins=0;
- for ($k=0; $k<$nn; $k++) {
- $atual = DBRow($rr, $k);
- if (!$needed[$k]) {
- DBExec($c, "delete from answertable where contestnumber=$contest and answernumber=".$atual["answernumber"]);
- $del++;
- }
- }
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- $upd++;
- DBExec ($c, "update answertable set ".
- "runanswer='".$atual["runanswer"]."',".
- "yes='".$atual["yes"]."',".
- "fake='".$atual["fake"]."',".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and answernumber=".$atual["answernumber"].
- " and updatetime<".$atual["updatetime"]);
- } else if ($situacao[$j]=="inserir") {
- $ins++;
- DBExec($c,"insert into answertable (contestnumber, answernumber, runanswer, yes, fake, updatetime) values (" .
- $contest.",".$atual["answernumber"].",'".$atual["runanswer"]."','".$atual["yes"]."',".
- "'".$atual["fake"]."',".$atual["updatetime"].")");
- }
- }
- echo " deletions=$del, updates=$upd, insertions=$ins\n\n";
-
- // sincronizando languages
- $r = DBExec ($t, "select * from langtable where contestnumber=$contest");
- $rr = DBExec ($c, "select * from langtable where contestnumber=$contest for update");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "languages: external(site=$mainsite, reading=$mainsite)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["langnumber"]==$aqui["langnumber"] && $la["contestnumber"]==$aqui["contestnumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"])
- $situacao[$j]="atualizar";
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $del=0; $upd=0; $ins=0;
- for ($k=0; $k<$nn; $k++) {
- $atual = DBRow($rr, $k);
- if (!$needed[$k]) {
- DBExec($c, "delete from langtable where contestnumber=$contest and langnumber=".$atual["langnumber"]);
- $del++;
- }
- }
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- $upd++;
- DBExec ($c, "update langtable set ".
- "langname='".escape_string($atual["langname"])."',".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and langnumber=".$atual["langnumber"].
- " and updatetime<".$atual["updatetime"]);
- } else if ($situacao[$j]=="inserir") {
- $ins++;
- DBExec($c,"insert into langtable (contestnumber, langnumber, langname, updatetime) values ($contest,".$atual["langnumber"].
- ",'".escape_string($atual["langname"])."',".$atual["updatetime"].")");
- }
- }
- echo " deletions=$del, updates=$upd, insertions=$ins\n\n";
-
- // sincronizando problems
- $r = DBExec ($t, "select * from problemtable where contestnumber=$contest");
- $rr = DBExec ($c, "select * from problemtable where contestnumber=$contest for update");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "problems: external(site=$mainsite, reading=$mainsite)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["problemnumber"]==$aqui["problemnumber"] && $la["contestnumber"]==$aqui["contestnumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"])
- $situacao[$j]="atualizar";
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $del=0; $upd=0; $ins=0;
- for ($k=0; $k<$nn; $k++) {
- $atual = DBRow($rr, $k);
- if (!$needed[$k]) {
- DBExec($c, "delete from problemtable where contestnumber=$contest and problemnumber=".$atual["problemnumber"]);
- $del++;
- }
- }
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="inserir") {
- $ins++; $upd--;
- DBExec($c,"insert into problemtable (contestnumber, problemnumber, problemname, updatetime) values ($contest,".
- $atual["problemnumber"].",'".escape_string($atual["problemname"])."', 0)");
- }
- if ($situacao[$j]=="atualizar" || $situacao[$j]=="inserir") {
- $upd++;
- $p = DBRow($r2, 0);
- if ($p["probleminputfile"]>0) DB_lo_unlink($c, $p["probleminputfile"]);
- if ($p["problemsolfile"]>0) DB_lo_unlink($c, $p["problemsolfile"]);
- DBExec($t, "begin work");
- if ($atual["probleminputfile"]=="") $inputfile="null";
- else {
- $in = DB_lo_open($t, $atual["probleminputfile"], "r");
- if (!$in) $inputfile="null";
- else {
- $inputfile = DB_lo_create ($c);
- $out = DB_lo_open ($c, $inputfile, "w");
- while (($buf = DB_lo_read ($in, 100000)) != false)
- DB_lo_write ($out, $buf);
- DB_lo_close ($out);
- DB_lo_close ($in);
- }
- }
- if ($atual["problemsolfile"]=="") $solfile="null";
- else {
- $in = DB_lo_open($t, $atual["problemsolfile"], "r");
- if (!$in) $solfile="null";
- else {
- $solfile = DB_lo_create ($c);
- $out = DB_lo_open ($c, $solfile, "w");
- while (($buf = DB_lo_read ($in, 100000)) != false)
- DB_lo_write ($out, $buf);
- DB_lo_close ($out);
- DB_lo_close ($in);
- }
- }
- DBExec ($t, "commit work");
-
- DBExec ($c, "update problemtable set ".
- "problemname='".escape_string($atual["problemname"])."',".
- "problemfullname='".escape_string($atual["problemfullname"])."',".
- "problembasefilename='".escape_string($atual["problembasefilename"])."',".
- "probleminputfilename='".escape_string($atual["probleminputfilename"])."',".
- "problemsolfilename='".escape_string($atual["problemsolfilename"])."',".
- "fake='".$atual["fake"]."',".
- "probleminputfile=".$inputfile.",".
- "problemsolfile=".$solfile.",".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and problemnumber=".$atual["problemnumber"].
- " and updatetime<".$atual["updatetime"]);
- }
- }
- echo " deletions=$del, updates=$upd, insertions=$ins\n\n";
- DBExec($c, "commit work");
- }
-
- }
-
- $r = DBExec ($c, "select * from sitetable where contestnumber=$contest");
- $n = DBnlines($r);
- if ($n == 0) {
- echo "Unable to find sites in the database.\n";
- exit;
- }
- $st = array();
- for ($i=0;$i<$n;$i++) {
- $st[$i] = DBRow($r,$i);
- }
-
- for ($i=0; $i<count($st); $i++) {
- $site=$st[$i]["sitenumber"];
- if ($site==$ct["contestlocalsite"]) continue;
- if (($t = DBExtConnect($c, $contest, $site))==null) continue;
- DBExec($c, "begin work");
-
- // sincronizando site
- $r = DBExec ($t, "select * from sitetable where contestnumber=$contest and sitenumber=$site");
- $rr = DBExec ($c, "select * from sitetable where contestnumber=$contest and sitenumber=$site for update");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- $atual = DBRow($r,0);
- $p = DBRow($rr,0);
-// if ($p["updatetime"]<$atual["updatetime"]) {
- if ($atual["sitestartdate"]=="") $atual["sitestartdate"]="null";
- if ($atual["sitelastmilescore"]=="") $atual["sitelastmilescore"]="null";
- if ($atual["sitelastmileanswer"]=="") $atual["sitelastmileanswer"]="null";
- if ($atual["siteenddate"]=="") $atual["siteenddate"]="null";
- if ($atual["siteendeddate"]=="") $atual["siteendeddate"]="null";
- if ($atual["siteautoend"]!="t") $atual["siteautoend"]="f";
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- DBExec ($c, "update sitetable set ".
- //"siteip='".escape_string($atual["siteip"])."',".
- "sitename='".escape_string($atual["sitename"])."',".
- "siteactive='".escape_string($atual["siteactive"])."',".
- "sitepermitlogins='".escape_string($atual["sitepermitlogins"])."',".
- "sitestartdate=".$atual["sitestartdate"].",".
- "sitelastmilescore=".$atual["sitelastmilescore"].",".
- "sitelastmileanswer=".$atual["sitelastmileanswer"].",".
- "siteenddate=".$atual["siteenddate"].",".
- "siteendeddate=".$atual["siteendeddate"].",".
- "siteautoend='".escape_string($atual["siteautoend"])."',".
- "sitejudging='".escape_string($atual["sitejudging"])."',".
- "siteglobalscore='".escape_string($atual["siteglobalscore"])."',".
- "sitescorelevel=".$atual["sitescorelevel"].",".
- "sitenextuser=".$atual["sitenextuser"].",".
- "sitenextclar=".$atual["sitenextclar"].",".
- "sitenextrun=".$atual["sitenextrun"].",".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and sitenumber=".$atual["sitenumber"]);
-// ." and updatetime<".$atual["updatetime"]);
-// }
-
- // sincronizando users
- $r = DBExec ($t, "select * from usertable where contestnumber=$contest and usersitenumber=$site");
- $rr = DBExec ($c, "select * from usertable where contestnumber=$contest and usersitenumber=$site");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "users: external(site=$site, reading=$site)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["usernumber"]==$aqui["usernumber"] && $la["contestnumber"]==$aqui["contestnumber"] &&
- $la["usersitenumber"]==$aqui["usersitenumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"])
- $situacao[$j]="atualizar";
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $del=0;
- for ($k=0; $k<$nn; $k++) {
- $atual = DBRow($rr, $k);
- if (!$needed[$k]) {
- DBExec($c, "delete from usertable where contestnumber=$contest and usersitenumber=$site and usernumber=".
- $atual["usernumber"]);
- $del++;
- }
- }
- $upd=0; $ins=0;
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
- if ($atual["userlastlogin"]=="") $atual["userlastlogin"]="null";
- if ($atual["userlastlogout"]=="") $atual["userlastlogout"]="null";
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- DBExec ($c, "update usertable set ".
- "username='".escape_string($atual["username"])."',".
- "userfullname='".escape_string($atual["userfullname"])."',".
- "userdesc='".escape_string($atual["userdesc"])."',".
- "usertype='".escape_string($atual["usertype"])."',".
- "userenabled='".$atual["userenabled"]."',".
- "usermultilogin='".$atual["usermultilogin"]."',".
- "userpassword='".$atual["userpassword"]."',".
- "userip='".$atual["userip"]."',".
- "userlastlogin=".$atual["userlastlogin"].",".
- "userlastlogout=".$atual["userlastlogout"].",".
- "usersession='".$atual["usersession"]."',".
- "userpermitip='".$atual["userpermitip"]."',".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and usersitenumber=".$atual["usersitenumber"].
- " and usernumber=".$atual["usernumber"]." and updatetime<".$atual["updatetime"]);
- $upd++;
- } else if ($situacao[$j]=="inserir") {
- DBExec ($c, "insert into usertable (username, userfullname, userdesc, usertype, userenabled, usermultilogin, ".
- "userpassword, userip, userlastlogin, userlastlogout, usersession, userpermitip, updatetime, ".
- "contestnumber, usersitenumber, usernumber) values (".
- "'".escape_string($atual["username"])."',".
- "'".escape_string($atual["userfullname"])."',".
- "'".escape_string($atual["userdesc"])."',".
- "'".$atual["usertype"]."',".
- "'".$atual["userenabled"]."',".
- "'".$atual["usermultilogin"]."',".
- "'".$atual["userpassword"]."',".
- "'".$atual["userip"]."',".
- $atual["userlastlogin"].",".
- $atual["userlastlogout"].",".
- "'".$atual["usersession"]."',".
- "'".$atual["userpermitip"]."',".
- $atual["updatetime"].",$contest,".$atual["usersitenumber"].",".$atual["usernumber"].")");
- $ins++;
- }
- }
- echo " deletions=$del, updates=$upd, insertions=$ins\n\n";
-
- // sincronizando clars
- $r = DBExec ($t, "select * from clartable where contestnumber=$contest and clarsitenumber=$site");
- $rr = DBExec ($c, "select * from clartable where contestnumber=$contest and clarsitenumber=$site");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "clars: external(site=$site, reading=$site)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["clarnumber"]==$aqui["clarnumber"] && $la["contestnumber"]==$aqui["contestnumber"] &&
- $la["clarsitenumber"]==$aqui["clarsitenumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"])
- $situacao[$j]="atualizar";
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $del=0;
- for ($k=0; $k<$nn; $k++) {
- $atual = DBRow($rr, $k);
- if (!$needed[$k]) {
- DBExec($c, "delete from clartable where contestnumber=$contest and clarsitenumber=$site and clarnumber=".
- $atual["clarnumber"]);
- $del++;
- }
- }
- $upd=0; $ins=0;
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
- if ($atual["claranswer"]=="") $atual["claranswer"]="null";
- else $atual["claranswer"]="'".escape_string($atual["claranswer"])."'";
- if ($atual["clarjudge"]=="") $atual["clarjudge"]="null";
- if ($atual["clarjudgesite"]=="") $atual["clarjudgesite"]="null";
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- DBExec ($c, "update clartable set ".
- "usernumber=".$atual["usernumber"].",".
- "clardate=".$atual["clardate"].",".
- "clardatediff=".$atual["clardatediff"].",".
- "clardatediffans=".$atual["clardatediffans"].",".
- "clarproblem=".$atual["clarproblem"].",".
- "clardata='".escape_string($atual["clardata"])."',".
- "claranswer=".$atual["claranswer"].",".
- "clarstatus='".escape_string($atual["clarstatus"])."',".
- "clarjudge=".$atual["clarjudge"].",".
- "clarjudgesite=".$atual["clarjudgesite"].",".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and clarsitenumber=".$atual["clarsitenumber"].
- " and clarnumber=".$atual["clarnumber"]." and updatetime<".$atual["updatetime"]);
- $upd++;
- } else if($situacao[$j]=="inserir") {
- DBExec ($c, "insert into clartable (contestnumber, clarsitenumber, clarnumber, usernumber, clardate,".
- "clardatediff, clardatediffans, clarproblem, clardata, claranswer, clarstatus, clarjudge, clarjudgesite, updatetime) ".
- "values (".$contest.",".$atual["clarsitenumber"].",".$atual["clarnumber"].",".$atual["usernumber"].",".
- $atual["clardate"].",".
- $atual["clardatediff"].",".
- $atual["clardatediffans"].",".
- $atual["clarproblem"].",".
- "'".escape_string($atual["clardata"])."',".
- $atual["claranswer"].",".
- "'".escape_string($atual["clarstatus"])."',".
- $atual["clarjudge"].",".
- $atual["clarjudgesite"].",".
- $atual["updatetime"].")");
- $ins++;
- }
- }
- echo " deletions=$del, updates=$upd, insertions=$ins\n\n";
-
- // sincronizando clars
- $r = DBExec ($t, "select * from clartable where contestnumber=$contest and clarsitenumber=$localsite");
- $rr = DBExec ($c, "select * from clartable where contestnumber=$contest and clarsitenumber=$localsite");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "clars: external(site=$site, reading=$localsite)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["clarnumber"]==$aqui["clarnumber"] && $la["contestnumber"]==$aqui["contestnumber"] &&
- $la["clarsitenumber"]==$aqui["clarsitenumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"])
- $situacao[$j]="atualizar";
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $upd=0; $ins=0;
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
- if ($atual["claranswer"]=="") $atual["claranswer"]="null";
- else $atual["claranswer"]="'".escape_string($atual["claranswer"])."'";
- if ($atual["clarjudge"]=="") $atual["clarjudge"]="null";
- if ($atual["clarjudgesite"]=="") $atual["clarjudgesite"]="null";
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- DBExec ($c, "update clartable set ".
- "usernumber=".$atual["usernumber"].",".
- "clardate=".$atual["clardate"].",".
- "clardatediff=".$atual["clardatediff"].",".
- "clardatediffans=".$atual["clardatediffans"].",".
- "clarproblem=".$atual["clarproblem"].",".
- "clardata='".escape_string($atual["clardata"])."',".
- "claranswer=".$atual["claranswer"].",".
- "clarstatus='".escape_string($atual["clarstatus"])."',".
- "clarjudge=".$atual["clarjudge"].",".
- "clarjudgesite=".$atual["clarjudgesite"].",".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and clarsitenumber=".$atual["clarsitenumber"].
- " and clarnumber=".$atual["clarnumber"]." and updatetime<".$atual["updatetime"]);
- $upd++;
- } else if($situacao[$j]=="inserir") {
- $ins++;
- echo "Clar inserts shouldn't exist (clarnumber=".$atual["clarnumber"].")...\n";
- }
- }
- echo " updates=$upd, insertions=$ins\n\n";
-
- // sincronizando runs
- $r = DBExec ($t, "select * from runtable where contestnumber=$contest and runsitenumber=$site");
- $rr = DBExec ($c, "select * from runtable where contestnumber=$contest and runsitenumber=$site");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "runs: external(site=$site, reading=$site)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["runnumber"]==$aqui["runnumber"] && $la["contestnumber"]==$aqui["contestnumber"] &&
- $la["runsitenumber"]==$aqui["runsitenumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"]) {
- $situacao[$j]="atualizar";
- }
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $del=0;
- for ($k=0; $k<$nn; $k++) {
- $atual = DBRow($rr, $k);
- if (!$needed[$k]) {
- $del++;
- DBExec($c, "delete from runtable where contestnumber=$contest and runsitenumber=$site and runnumber=".
- $atual["runnumber"]);
- }
- }
- $upd=0; $ins=0;
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
-/*
- $r2 = DBExec ($c,"select * from runtable where contestnumber=$contest and runsitenumber=".$atual["runsitenumber"].
- " and runnumber=".$atual["runnumber"]." for update");
- if (DBnLines($r2)>0) {
- $p = DBRow($r2, 0);
- DB_lo_unlink($c, $p["rundata"]);
- }
-*/
- if ($atual["runjudge"]=="") $atual["runjudge"]="null";
- if ($atual["runjudgesite"]=="") $atual["runjudgesite"]="null";
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- $upd++;
- DBExec ($c, "update runtable set ".
- "usernumber=".$atual["usernumber"].",".
- "rundate=".$atual["rundate"].",".
- "rundatediff=".$atual["rundatediff"].",".
- "rundatediffans=".$atual["rundatediffans"].",".
- "runproblem=".$atual["runproblem"].",".
- "runlangnumber=".$atual["runlangnumber"].",".
- "runanswer=".$atual["runanswer"].",".
- "runstatus='".escape_string($atual["runstatus"])."',".
- "runjudge=".$atual["runjudge"].",".
- "runjudgesite=".$atual["runjudgesite"].",".
- "runfilename='".escape_string($atual["runfilename"])."',".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and runsitenumber=".$atual["runsitenumber"].
- " and runnumber=".$atual["runnumber"]." and updatetime<".$atual["updatetime"]);
- } else if ($situacao[$j]=="inserir") {
- $ins++;
- DBExec($t, "begin work");
- $in = DB_lo_open($t, $atual["rundata"], "r");
- if (!$in) $o="0";
- else {
- $o = DB_lo_create ($c);
- $out = DB_lo_open ($c, $o, "w");
- while (($buf = DB_lo_read ($in, 1000)) != false)
- DB_lo_write ($out, $buf);
- DB_lo_close ($out);
- DB_lo_close ($in);
-
- $in = DB_lo_open($t, $atual["rundata"], "r");
- if (!$in) {
- $o="0";
- LOGLevel("Run not saved as file (run=".$atual["runnumber"].",site=".$atual["runsitenumber"].
- ",contest=$contest", 1);
- } else {
- $sitess=$atual["runsitenumber"];
- $nss=$atual["runnumber"];
- $user=$atual["usernumber"];
- $problem=$atual["runproblem"];
- $filename=escape_string($atual["runfilename"]);
- $ttimet=$atual["rundate"];
- $fp = fopen("/tmp/boca/contest${contest}.site${sitess}.run${nss}.user${user}.".
- "problem${problem}.time${ttimet}.${filename}", "w");
- if ($fp) {
- while (($buf = DB_lo_read ($in, 1000)) != false)
- fwrite ($fp, $buf);
- fclose ($fp);
- $fp = fopen("/tmp/check/contest${contest}.site${sitess}.run${nss}.user${user}.".
- "problem${problem}.time${ttimet}.${filename}.check", "w");
- if ($fp) {
- fwrite($fp, "1");
- fclose ($fp);
- }
- else
- LOGLevel("Run not saved as check file (run=".$atual["runnumber"].",site=".$atual["runsitenumber"].
- ",contest=$contest", 1);
- } else
- LOGLevel("Run not saved as file (run=".$atual["runnumber"].",site=".$atual["runsitenumber"].
- ",contest=$contest", 1);
- DB_lo_close ($out);
- }
-
- }
- DBExec ($c, "insert into runtable (contestnumber, runsitenumber, runnumber, usernumber, rundate,".
- "rundatediff, rundatediffans, runproblem, runfilename, rundata, runanswer, runstatus, runjudge,".
- "runjudgesite, runlangnumber, updatetime) ".
- "values (".$contest.",".$atual["runsitenumber"].",".$atual["runnumber"].",".$atual["usernumber"].",".
- $atual["rundate"].",".
- $atual["rundatediff"].",".
- $atual["rundatediffans"].",".
- $atual["runproblem"].",".
- "'".escape_string($atual["runfilename"])."',$o,".
- $atual["runanswer"].",".
- "'".escape_string($atual["runstatus"])."',".
- $atual["runjudge"].",".
- $atual["runjudgesite"].",".
- $atual["runlangnumber"].",".
- $atual["updatetime"].")");
- DBExec ($t, "commit work");
- }
- }
- echo " deletions=$del, updates=$upd, insertions=$ins\n\n";
-
- // sincronizando runs
- $r = DBExec ($t, "select * from runtable where contestnumber=$contest and runsitenumber=$localsite");
- $rr = DBExec ($c, "select * from runtable where contestnumber=$contest and runsitenumber=$localsite");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "runs: external(site=$site, reading=$localsite)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["runnumber"]==$aqui["runnumber"] && $la["contestnumber"]==$aqui["contestnumber"] &&
- $la["runsitenumber"]==$aqui["runsitenumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"]) {
- $situacao[$j]="atualizar";
-
-
- if ($la["runanswer"] != "") {
- $rrr = DBExec($c, "select * from answertable where answernumber=".$la["runanswer"].
- " and contestnumber=".$la["contestnumber"]);
- $ans = (DBnLines($rrr)>0)? DBRow($rrr, 0) : null;
- if ($ans == null) {
- echo "Problem with the answer table. Unable to send balloon because the answer was " .
- "not found (run=".$la["runnumber"].", site=".$la["runsite"].", contest=" .
- $la["contestnumber"].", answer=".$la["runanswer"].").";
- $yesla = 'x';
- } else $yesla = $ans["yes"];
- } else $yesla='f';
- if ($aqui["runanswer"] != "") {
- $rrr = DBExec($c, "select * from answertable where answernumber=".$aqui["runanswer"].
- " and contestnumber=".$aqui["contestnumber"]);
- $ans = (DBnLines($rrr)>0)? DBRow($rrr, 0) : null;
- if ($ans == null) {
- echo "Problem with the answer table. Unable to send balloon because the answer was " .
- "not found (run=".$aqui["runnumber"].", site=".$aqui["runsite"].", contest=" .
- $aqui["contestnumber"].", answer=".$aqui["runanswer"].").";
- $yesaqui = 'x';
- } else $yesaqui = $ans["yes"];
- } else $yesaqui='f';
-
- if ($yesla == 't' && $yesaqui == 'f') {
- $rrr = DBExec ($c, "select * from sitetable where contestnumber=".$aqui["contestnumber"].
- " and sitenumber=$localsite");
- if (DBnLines($rrr)<=0)
- echo "Site info not found (contest=${aqui["contestnumber"]}, site=$localsite).";
- else {
- $b = DBRow($rrr,0);
- $ti = $b["sitestartdate"];
- $tempo = time();
- $ta = $tempo - $ti;
- $tf = $b["sitelastmileanswer"];
-// if ($ta < $tf) {
- $rrr = DBExec ($c, "select * from usertable where contestnumber=".
- $aqui["contestnumber"]." and usersitenumber=$localsite and usernumber=".
- $aqui["usernumber"]);
- if (DBnLines($rrr)<=0)
- echo "User info not found (contest=${aqui["contestnumber"]}, ".
- "site=$localsite, user=${aqui["runusernumber"]}).";
- else {
- $u = DBRow ($rrr,0);
- $rrr = DBExec ($c, "select * from problemtable where contestnumber=".
- $aqui["contestnumber"]." and problemnumber=".
- $aqui["runproblem"]);
- if (DBnLines($rrr)<=0)
- echo "Problem info not found (contest=${aqui["contestnumber"]}, ".
- "problem=${aqui["runproblem"]}).";
- else {
- $p = DBRow ($rrr,0);
- mail("balloon@mainserver", "YES: team=" . $u["username"] .
- ", problem=" . $p["problemname"],
- "User ".$u["username"] ." should receive a balloon for ".
- $p["problemfullname"]."\n");
- }
- }
-// }
- }
- } else if ($yesla == 'f' && $yesaqui == 't') {
- $rrr = DBExec ($c, "select * from usertable where contestnumber=".
- $aqui["contestnumber"]." and usersitenumber=$localsite and usernumber=".
- $aqui["usernumber"]);
- if (DBnLines($rrr)<=0)
- echo "User info not found (contest=${aqui["contestnumber"]}, ".
- "site=$localsite, user=${aqui["runusernumber"]}).";
- else {
- $u = DBRow ($rrr,0);
- $rrr = DBExec ($c, "select * from problemtable where contestnumber=".
- $aqui["contestnumber"]." and problemnumber=".
- $aqui["runproblem"]);
- if (DBnLines($rrr)<=0)
- echo "Problem info not found (contest=${aqui["contestnumber"]}, ".
- "problem=${aqui["runproblem"]}).";
- else {
- $p = DBRow ($rrr,0);
- mail("balloon@mainserver", "NO: team=" . $u["username"] .
- ", problem=" . $p["problemname"],
- "Remove the balloon from user ". $u["username"] .
- " for ".$p["problemfullname"]."\n");
- }
- }
- }
-
-
- }
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $upd=0; $ins=0;
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
-
- if ($atual["runjudge"]=="") $atual["runjudge"]="null";
- if ($atual["runjudgesite"]=="") $atual["runjudgesite"]="null";
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- $upd++;
- DBExec ($c, "update runtable set ".
- "usernumber=".$atual["usernumber"].",".
- "rundate=".$atual["rundate"].",".
- "rundatediff=".$atual["rundatediff"].",".
- "rundatediffans=".$atual["rundatediffans"].",".
- "runproblem=".$atual["runproblem"].",".
- "runlangnumber=".$atual["runlangnumber"].",".
- "runanswer=".$atual["runanswer"].",".
- "runstatus='".escape_string($atual["runstatus"])."',".
- "runjudge=".$atual["runjudge"].",".
- "runjudgesite=".$atual["runjudgesite"].",".
- "runfilename='".escape_string($atual["runfilename"])."',".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and runsitenumber=".$atual["runsitenumber"].
- " and runnumber=".$atual["runnumber"]." and updatetime<".$atual["updatetime"]);
- } else if ($situacao[$j]=="inserir") {
- $ins++;
- echo "Run Inserts shouldn't exist (run=".$atual["runnumber"].")...";
- }
- }
- echo " updates=$upd, insertions=$ins\n\n";
-
- DBExec($c, "commit work");
- DBClose($t);
- }
- DBClose($c);
-}
-
-//fecha a conexao com o banco (isso nao eh realmente necessario, ja que o php/apache cuidam do servico)
-function DBClose($c) {
- if ($c) pg_close($c);
-}
-//executar instrucao no banco de dados, parando em caso de erro quando $stop=1
-function DBExec($conn,$sql) {
-// echo $sql . "\n";
- $result = pg_exec ($conn, $sql);
- if (!$result) {
- echo "Unable to exec SQL in the database. SQL=(" . $sql . ")," .
- " Error=(" . pg_errormessage($conn) . ")\n";
- exit;
- }
- return $result;
-}
-//devolve o numero de linhas da consulta
-function DBnlines ($result) {
- return pg_numrows ($result);
-}
-//pega uma linha da consulta no formato de array
-function DBRow ($r, $i) {
- return pg_fetch_array ($r, $i);
-}
-function escape_string($s) {
- return str_replace("'", "''", $s);
-}
-if (getIP()!="UNKNOWN") exit;
-
-$x = DBConnect();
-if ($x==null) exit;
-$y = DBExec($x, "select * from contesttable where contestactive='t'");
-if (DBnLines($y)==0) {
- echo "Unable to find the active contest in the database.\n";
- exit;
-}
-$ct = DBRow($y,0);
-DBClose($x);
-GetExternalData($ct["contestnumber"]);
-
-?>
diff --git a/old/getextdata.php b/old/getextdata.php
deleted file mode 100644
index 7c9955d..0000000
--- a/old/getextdata.php
+++ /dev/null
@@ -1,931 +0,0 @@
-<?php
-//////////////////////////////////////////////////////////////////////////////////////////
-//BOCA Online Contest Administrator. Copyright (c) 2003-2004 Cassio Polpo de Campos.
-//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-//
-//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-///////////////////////////////////////////////////////////////////////////////////////////
-
-//retorna ip do cliente
-function getIP() {
- if (getenv("HTTP_CLIENT_IP"))
- $ip = getenv("HTTP_CLIENT_IP");
- else
- if(getenv("HTTP_X_FORWARDED_FOR"))
- $ip = getenv("HTTP_X_FORWARDED_FOR");
- else
- if(getenv("REMOTE_ADDR"))
- $ip = getenv("REMOTE_ADDR");
- else
- $ip = "UNKNOWN";
- $ip = strtok ($ip, ",");
- return $ip;
-}
-//para compatibilidade com versoes velhas e novas do php
-function DB_lo_open($conn, $file, $mode) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_loopen ($conn, $file, $mode);
- else
- return pg_lo_open ($conn, $file, $mode);
-}
-function DB_lo_read_all($id) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_loreadall ($id);
- else
- return pg_lo_read_all ($id);
-}
-function DB_lo_import($conn, $file) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_loimport ($file, $conn);
- else
- return pg_lo_import ($conn, $file);
-}
-function DB_lo_close($id) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_loclose ($id);
- else
- return pg_lo_close ($id);
-}
-function DB_lo_unlink($c,$id) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_lounlink ($id,$c);
- else
- return pg_lo_unlink ($c,$id);
-}
-function DB_lo_create($conn) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_locreate ($conn);
- else
- return pg_lo_create ($conn);
-}
-function DB_lo_write($fp, $data) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_lowrite ($fp, $data);
- else
- return pg_lo_write ($fp, $data);
-}
-function DB_lo_read($fp, $len) {
- if (strcmp(phpversion(),'4.2.0')<0)
- return pg_loread ($fp, $len);
- else
- return pg_lo_read ($fp, $len);
-}
-
-//abrir conexao com o banco de dados
-function DBConnect() {
- $dbconn="host=localhost dbname=bocadb user=bocauser password=boca";
- $conn = pg_connect ($dbconn);
- if (!$conn) {
- echo "Unable to connect to local database\n";
- return null;
- }
- return $conn;
-}
-function DBExtConnect($c, $contest, $site) {
- $r = DBExec($c, "select * from sitetable where sitenumber=$site and contestnumber=$contest");
- if (DBnLines($r)==0) {
- echo "Unable to find the site in the database (site=$site, contest=$contest).\n";
- exit;
- }
- $st = DBRow($r,0);
-
- if(($f = file("sqlpass.php"))===false) $pass="boca";
- else $pass=trim($f[1]);
-
- // gambiarra para testar se a conexao esta de pe
- $fp = fsockopen ($st["siteip"], 5432, $errno, $errstr, 10);
- if (!$fp) {
- echo "$errstr ($errno). Aborting this connection (ip=".$st["siteip"].").\n";
- return null;
- }
- fclose ($fp);
- // se a conexao cair entre o teste acima e o connect abaixo, esse script pode demorar ate
- // dar o timeout (no meu teste foram cerca de 3min para cada timeout)
-
- $conn = pg_connect ("host=" . $st["siteip"] . " dbname=bocadb user=bocauser password=$pass");
- if (!$conn) {
- echo "Unable to connect to site $site (ip=".$st["siteip"].")\n";
- return null;
- }
- echo "Connected to " .$st["siteip"].". Let's exchange data...\n";
- return $conn;
-}
-
-function GetExternalData ($contest) {
- $c = DBConnect();
- if ($c==null) return;
- $r = DBExec($c, "select * from contesttable where contestnumber=$contest");
- if (DBnLines($r)==0) {
- echo "Unable to find the contest $contest in the database.\n";
- exit;
- }
- $ct = DBRow($r,0);
- $localsite = $ct["contestlocalsite"];
- $mainsite = $ct["contestmainsite"];
-
- if ($mainsite!=$localsite) {
- $r = DBExec($c, "select * from sitetable where sitenumber=".$ct["contestmainsite"]." and contestnumber=$contest");
- if (DBnLines($r)==0) {
- echo "Unable to find the main site in the database (site=$site, contest=$contest).\n";
- exit;
- }
- $st = DBRow($r,0);
- if (($t = DBExtConnect($c, $contest, $st["sitenumber"]))!=null) {
- DBExec($c, "begin work");
-
- // sincronizando contest
- $r = DBExec ($t, "select * from contesttable where contestnumber=$contest");
- $n = DBnLines ($r);
- $atual = DBRow($r,0);
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- DBExec ($c, "update contesttable set ".
- "contestduration=".$atual["contestduration"].",".
- "conteststartdate=".$atual["conteststartdate"].",".
- "contestmaxfilesize=".$atual["contestmaxfilesize"].",".
- "contestactive='".$atual["contestactive"]."',".
- //"contestmainsite=".$atual["contestmainsite"].",".
- "contestname='".escape_string($atual["contestname"])."',".
- "contestlastmileanswer=".$atual["contestlastmileanswer"].",".
- "contestlastmilescore=".$atual["contestlastmilescore"].",".
- "contestpenalty=".$atual["contestpenalty"].",".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and updatetime<".$atual["updatetime"]);
-
- // sincronizando answers
- $r = DBExec ($t, "select * from answertable where contestnumber=$contest");
- $rr = DBExec ($c, "select * from answertable where contestnumber=$contest for update");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "answers: external(site=$mainsite, reading=$mainsite)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["answernumber"]==$aqui["answernumber"] && $la["contestnumber"]==$aqui["contestnumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"])
- $situacao[$j]="atualizar";
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $del=0; $upd=0; $ins=0;
- for ($k=0; $k<$nn; $k++) {
- $atual = DBRow($rr, $k);
- if (!$needed[$k]) {
- DBExec($c, "delete from answertable where contestnumber=$contest and answernumber=".$atual["answernumber"]);
- $del++;
- }
- }
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- $upd++;
- DBExec ($c, "update answertable set ".
- "runanswer='".$atual["runanswer"]."',".
- "yes='".$atual["yes"]."',".
- "fake='".$atual["fake"]."',".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and answernumber=".$atual["answernumber"].
- " and updatetime<".$atual["updatetime"]);
- } else if ($situacao[$j]=="inserir") {
- $ins++;
- DBExec($c,"insert into answertable (contestnumber, answernumber, runanswer, yes, fake, updatetime) values (" .
- $contest.",".$atual["answernumber"].",'".$atual["runanswer"]."','".$atual["yes"]."',".
- "'".$atual["fake"]."',".$atual["updatetime"].")");
- }
- }
- echo " deletions=$del, updates=$upd, insertions=$ins\n\n";
-
- // sincronizando languages
- $r = DBExec ($t, "select * from langtable where contestnumber=$contest");
- $rr = DBExec ($c, "select * from langtable where contestnumber=$contest for update");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "languages: external(site=$mainsite, reading=$mainsite)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["langnumber"]==$aqui["langnumber"] && $la["contestnumber"]==$aqui["contestnumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"])
- $situacao[$j]="atualizar";
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $del=0; $upd=0; $ins=0;
- for ($k=0; $k<$nn; $k++) {
- $atual = DBRow($rr, $k);
- if (!$needed[$k]) {
- DBExec($c, "delete from langtable where contestnumber=$contest and langnumber=".$atual["langnumber"]);
- $del++;
- }
- }
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- $upd++;
- DBExec ($c, "update langtable set ".
- "langname='".escape_string($atual["langname"])."',".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and langnumber=".$atual["langnumber"].
- " and updatetime<".$atual["updatetime"]);
- } else if ($situacao[$j]=="inserir") {
- $ins++;
- DBExec($c,"insert into langtable (contestnumber, langnumber, langname, updatetime) values ($contest,".$atual["langnumber"].
- ",'".escape_string($atual["langname"])."',".$atual["updatetime"].")");
- }
- }
- echo " deletions=$del, updates=$upd, insertions=$ins\n\n";
-
- // sincronizando problems
- $r = DBExec ($t, "select * from problemtable where contestnumber=$contest");
- $rr = DBExec ($c, "select * from problemtable where contestnumber=$contest for update");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "problems: external(site=$mainsite, reading=$mainsite)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["problemnumber"]==$aqui["problemnumber"] && $la["contestnumber"]==$aqui["contestnumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"])
- $situacao[$j]="atualizar";
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $del=0; $upd=0; $ins=0;
- for ($k=0; $k<$nn; $k++) {
- $atual = DBRow($rr, $k);
- if (!$needed[$k]) {
- DBExec($c, "delete from problemtable where contestnumber=$contest and problemnumber=".$atual["problemnumber"]);
- $del++;
- }
- }
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="inserir") {
- $ins++; $upd--;
- DBExec($c,"insert into problemtable (contestnumber, problemnumber, problemname, updatetime) values ($contest,".
- $atual["problemnumber"].",'".escape_string($atual["problemname"])."', 0)");
- }
- if ($situacao[$j]=="atualizar" || $situacao[$j]=="inserir") {
- $upd++;
- $p = DBRow($r2, 0);
- if ($p["probleminputfile"]>0) DB_lo_unlink($c, $p["probleminputfile"]);
- if ($p["problemsolfile"]>0) DB_lo_unlink($c, $p["problemsolfile"]);
- DBExec($t, "begin work");
- if ($atual["probleminputfile"]=="") $inputfile="null";
- else {
- $in = DB_lo_open($t, $atual["probleminputfile"], "r");
- if (!$in) $inputfile="null";
- else {
- $inputfile = DB_lo_create ($c);
- $out = DB_lo_open ($c, $inputfile, "w");
- while (($buf = DB_lo_read ($in, 100000)) != false)
- DB_lo_write ($out, $buf);
- DB_lo_close ($out);
- DB_lo_close ($in);
- }
- }
- if ($atual["problemsolfile"]=="") $solfile="null";
- else {
- $in = DB_lo_open($t, $atual["problemsolfile"], "r");
- if (!$in) $solfile="null";
- else {
- $solfile = DB_lo_create ($c);
- $out = DB_lo_open ($c, $solfile, "w");
- while (($buf = DB_lo_read ($in, 100000)) != false)
- DB_lo_write ($out, $buf);
- DB_lo_close ($out);
- DB_lo_close ($in);
- }
- }
- DBExec ($t, "commit work");
-
- DBExec ($c, "update problemtable set ".
- "problemname='".escape_string($atual["problemname"])."',".
- "problemfullname='".escape_string($atual["problemfullname"])."',".
- "problembasefilename='".escape_string($atual["problembasefilename"])."',".
- "probleminputfilename='".escape_string($atual["probleminputfilename"])."',".
- "problemsolfilename='".escape_string($atual["problemsolfilename"])."',".
- "fake='".$atual["fake"]."',".
- "probleminputfile=".$inputfile.",".
- "problemsolfile=".$solfile.",".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and problemnumber=".$atual["problemnumber"].
- " and updatetime<".$atual["updatetime"]);
- }
- }
- echo " deletions=$del, updates=$upd, insertions=$ins\n\n";
- DBExec($c, "commit work");
- }
-
- }
-
- $r = DBExec ($c, "select * from sitetable where contestnumber=$contest");
- $n = DBnlines($r);
- if ($n == 0) {
- echo "Unable to find sites in the database.\n";
- exit;
- }
- $st = array();
- for ($i=0;$i<$n;$i++) {
- $st[$i] = DBRow($r,$i);
- }
-
- for ($i=0; $i<count($st); $i++) {
- $site=$st[$i]["sitenumber"];
- if ($site==$ct["contestlocalsite"]) continue;
- if (($t = DBExtConnect($c, $contest, $site))==null) continue;
- DBExec($c, "begin work");
-
- // sincronizando site
- $r = DBExec ($t, "select * from sitetable where contestnumber=$contest and sitenumber=$site");
- $rr = DBExec ($c, "select * from sitetable where contestnumber=$contest and sitenumber=$site for update");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- $atual = DBRow($r,0);
- $p = DBRow($rr,0);
-// if ($p["updatetime"]<$atual["updatetime"]) {
- if ($atual["sitestartdate"]=="") $atual["sitestartdate"]="null";
- if ($atual["sitelastmilescore"]=="") $atual["sitelastmilescore"]="null";
- if ($atual["sitelastmileanswer"]=="") $atual["sitelastmileanswer"]="null";
- if ($atual["siteenddate"]=="") $atual["siteenddate"]="null";
- if ($atual["siteendeddate"]=="") $atual["siteendeddate"]="null";
- if ($atual["siteautoend"]!="t") $atual["siteautoend"]="f";
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- DBExec ($c, "update sitetable set ".
- //"siteip='".escape_string($atual["siteip"])."',".
- "sitename='".escape_string($atual["sitename"])."',".
- "siteactive='".escape_string($atual["siteactive"])."',".
- "sitepermitlogins='".escape_string($atual["sitepermitlogins"])."',".
- "sitestartdate=".$atual["sitestartdate"].",".
- "sitelastmilescore=".$atual["sitelastmilescore"].",".
- "sitelastmileanswer=".$atual["sitelastmileanswer"].",".
- "siteenddate=".$atual["siteenddate"].",".
- "siteendeddate=".$atual["siteendeddate"].",".
- "siteautoend='".escape_string($atual["siteautoend"])."',".
- "sitejudging='".escape_string($atual["sitejudging"])."',".
- "siteglobalscore='".escape_string($atual["siteglobalscore"])."',".
- "sitescorelevel=".$atual["sitescorelevel"].",".
- "sitenextuser=".$atual["sitenextuser"].",".
- "sitenextclar=".$atual["sitenextclar"].",".
- "sitenextrun=".$atual["sitenextrun"].",".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and sitenumber=".$atual["sitenumber"]);
-// ." and updatetime<".$atual["updatetime"]);
-// }
-
- // sincronizando users
- $r = DBExec ($t, "select * from usertable where contestnumber=$contest and usersitenumber=$site");
- $rr = DBExec ($c, "select * from usertable where contestnumber=$contest and usersitenumber=$site");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "users: external(site=$site, reading=$site)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["usernumber"]==$aqui["usernumber"] && $la["contestnumber"]==$aqui["contestnumber"] &&
- $la["usersitenumber"]==$aqui["usersitenumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"])
- $situacao[$j]="atualizar";
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $del=0;
- for ($k=0; $k<$nn; $k++) {
- $atual = DBRow($rr, $k);
- if (!$needed[$k]) {
- DBExec($c, "delete from usertable where contestnumber=$contest and usersitenumber=$site and usernumber=".
- $atual["usernumber"]);
- $del++;
- }
- }
- $upd=0; $ins=0;
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
- if ($atual["userlastlogin"]=="") $atual["userlastlogin"]="null";
- if ($atual["userlastlogout"]=="") $atual["userlastlogout"]="null";
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- DBExec ($c, "update usertable set ".
- "username='".escape_string($atual["username"])."',".
- "userfullname='".escape_string($atual["userfullname"])."',".
- "userdesc='".escape_string($atual["userdesc"])."',".
- "usertype='".escape_string($atual["usertype"])."',".
- "userenabled='".$atual["userenabled"]."',".
- "usermultilogin='".$atual["usermultilogin"]."',".
- "userpassword='".$atual["userpassword"]."',".
- "userip='".$atual["userip"]."',".
- "userlastlogin=".$atual["userlastlogin"].",".
- "userlastlogout=".$atual["userlastlogout"].",".
- "usersession='".$atual["usersession"]."',".
- "userpermitip='".$atual["userpermitip"]."',".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and usersitenumber=".$atual["usersitenumber"].
- " and usernumber=".$atual["usernumber"]." and updatetime<".$atual["updatetime"]);
- $upd++;
- } else if ($situacao[$j]=="inserir") {
- DBExec ($c, "insert into usertable (username, userfullname, userdesc, usertype, userenabled, usermultilogin, ".
- "userpassword, userip, userlastlogin, userlastlogout, usersession, userpermitip, updatetime, ".
- "contestnumber, usersitenumber, usernumber) values (".
- "'".escape_string($atual["username"])."',".
- "'".escape_string($atual["userfullname"])."',".
- "'".escape_string($atual["userdesc"])."',".
- "'".$atual["usertype"]."',".
- "'".$atual["userenabled"]."',".
- "'".$atual["usermultilogin"]."',".
- "'".$atual["userpassword"]."',".
- "'".$atual["userip"]."',".
- $atual["userlastlogin"].",".
- $atual["userlastlogout"].",".
- "'".$atual["usersession"]."',".
- "'".$atual["userpermitip"]."',".
- $atual["updatetime"].",$contest,".$atual["usersitenumber"].",".$atual["usernumber"].")");
- $ins++;
- }
- }
- echo " deletions=$del, updates=$upd, insertions=$ins\n\n";
-
- // sincronizando clars
- $r = DBExec ($t, "select * from clartable where contestnumber=$contest and clarsitenumber=$site");
- $rr = DBExec ($c, "select * from clartable where contestnumber=$contest and clarsitenumber=$site");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "clars: external(site=$site, reading=$site)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["clarnumber"]==$aqui["clarnumber"] && $la["contestnumber"]==$aqui["contestnumber"] &&
- $la["clarsitenumber"]==$aqui["clarsitenumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"])
- $situacao[$j]="atualizar";
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $del=0;
- for ($k=0; $k<$nn; $k++) {
- $atual = DBRow($rr, $k);
- if (!$needed[$k]) {
- DBExec($c, "delete from clartable where contestnumber=$contest and clarsitenumber=$site and clarnumber=".
- $atual["clarnumber"]);
- $del++;
- }
- }
- $upd=0; $ins=0;
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
- if ($atual["claranswer"]=="") $atual["claranswer"]="null";
- else $atual["claranswer"]="'".escape_string($atual["claranswer"])."'";
- if ($atual["clarjudge"]=="") $atual["clarjudge"]="null";
- if ($atual["clarjudgesite"]=="") $atual["clarjudgesite"]="null";
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- DBExec ($c, "update clartable set ".
- "usernumber=".$atual["usernumber"].",".
- "clardate=".$atual["clardate"].",".
- "clardatediff=".$atual["clardatediff"].",".
- "clardatediffans=".$atual["clardatediffans"].",".
- "clarproblem=".$atual["clarproblem"].",".
- "clardata='".escape_string($atual["clardata"])."',".
- "claranswer=".$atual["claranswer"].",".
- "clarstatus='".escape_string($atual["clarstatus"])."',".
- "clarjudge=".$atual["clarjudge"].",".
- "clarjudgesite=".$atual["clarjudgesite"].",".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and clarsitenumber=".$atual["clarsitenumber"].
- " and clarnumber=".$atual["clarnumber"]." and updatetime<".$atual["updatetime"]);
- $upd++;
- } else if($situacao[$j]=="inserir") {
- DBExec ($c, "insert into clartable (contestnumber, clarsitenumber, clarnumber, usernumber, clardate,".
- "clardatediff, clardatediffans, clarproblem, clardata, claranswer, clarstatus, clarjudge, clarjudgesite, updatetime) ".
- "values (".$contest.",".$atual["clarsitenumber"].",".$atual["clarnumber"].",".$atual["usernumber"].",".
- $atual["clardate"].",".
- $atual["clardatediff"].",".
- $atual["clardatediffans"].",".
- $atual["clarproblem"].",".
- "'".escape_string($atual["clardata"])."',".
- $atual["claranswer"].",".
- "'".escape_string($atual["clarstatus"])."',".
- $atual["clarjudge"].",".
- $atual["clarjudgesite"].",".
- $atual["updatetime"].")");
- $ins++;
- }
- }
- echo " deletions=$del, updates=$upd, insertions=$ins\n\n";
-
- // sincronizando clars
- $r = DBExec ($t, "select * from clartable where contestnumber=$contest and clarsitenumber=$localsite");
- $rr = DBExec ($c, "select * from clartable where contestnumber=$contest and clarsitenumber=$localsite");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "clars: external(site=$site, reading=$localsite)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["clarnumber"]==$aqui["clarnumber"] && $la["contestnumber"]==$aqui["contestnumber"] &&
- $la["clarsitenumber"]==$aqui["clarsitenumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"])
- $situacao[$j]="atualizar";
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $upd=0; $ins=0;
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
- if ($atual["claranswer"]=="") $atual["claranswer"]="null";
- else $atual["claranswer"]="'".escape_string($atual["claranswer"])."'";
- if ($atual["clarjudge"]=="") $atual["clarjudge"]="null";
- if ($atual["clarjudgesite"]=="") $atual["clarjudgesite"]="null";
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- DBExec ($c, "update clartable set ".
- "usernumber=".$atual["usernumber"].",".
- "clardate=".$atual["clardate"].",".
- "clardatediff=".$atual["clardatediff"].",".
- "clardatediffans=".$atual["clardatediffans"].",".
- "clarproblem=".$atual["clarproblem"].",".
- "clardata='".escape_string($atual["clardata"])."',".
- "claranswer=".$atual["claranswer"].",".
- "clarstatus='".escape_string($atual["clarstatus"])."',".
- "clarjudge=".$atual["clarjudge"].",".
- "clarjudgesite=".$atual["clarjudgesite"].",".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and clarsitenumber=".$atual["clarsitenumber"].
- " and clarnumber=".$atual["clarnumber"]." and updatetime<".$atual["updatetime"]);
- $upd++;
- } else if($situacao[$j]=="inserir") {
- $ins++;
- echo "Clar inserts shouldn't exist (clarnumber=".$atual["clarnumber"].")...\n";
- }
- }
- echo " updates=$upd, insertions=$ins\n\n";
-
- // sincronizando runs
- $r = DBExec ($t, "select * from runtable where contestnumber=$contest and runsitenumber=$site");
- $rr = DBExec ($c, "select * from runtable where contestnumber=$contest and runsitenumber=$site");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "runs: external(site=$site, reading=$site)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["runnumber"]==$aqui["runnumber"] && $la["contestnumber"]==$aqui["contestnumber"] &&
- $la["runsitenumber"]==$aqui["runsitenumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"]) {
- $situacao[$j]="atualizar";
- }
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $del=0;
- for ($k=0; $k<$nn; $k++) {
- $atual = DBRow($rr, $k);
- if (!$needed[$k]) {
- $del++;
- DBExec($c, "delete from runtable where contestnumber=$contest and runsitenumber=$site and runnumber=".
- $atual["runnumber"]);
- }
- }
- $upd=0; $ins=0;
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
-/*
- $r2 = DBExec ($c,"select * from runtable where contestnumber=$contest and runsitenumber=".$atual["runsitenumber"].
- " and runnumber=".$atual["runnumber"]." for update");
- if (DBnLines($r2)>0) {
- $p = DBRow($r2, 0);
- DB_lo_unlink($c, $p["rundata"]);
- }
-*/
- if ($atual["runjudge"]=="") $atual["runjudge"]="null";
- if ($atual["runjudgesite"]=="") $atual["runjudgesite"]="null";
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- $upd++;
- DBExec ($c, "update runtable set ".
- "usernumber=".$atual["usernumber"].",".
- "rundate=".$atual["rundate"].",".
- "rundatediff=".$atual["rundatediff"].",".
- "rundatediffans=".$atual["rundatediffans"].",".
- "runproblem=".$atual["runproblem"].",".
- "runlangnumber=".$atual["runlangnumber"].",".
- "runanswer=".$atual["runanswer"].",".
- "runstatus='".escape_string($atual["runstatus"])."',".
- "runjudge=".$atual["runjudge"].",".
- "runjudgesite=".$atual["runjudgesite"].",".
- "runfilename='".escape_string($atual["runfilename"])."',".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and runsitenumber=".$atual["runsitenumber"].
- " and runnumber=".$atual["runnumber"]." and updatetime<".$atual["updatetime"]);
- } else if ($situacao[$j]=="inserir") {
- $ins++;
- DBExec($t, "begin work");
- $in = DB_lo_open($t, $atual["rundata"], "r");
- if (!$in) $o="0";
- else {
- $o = DB_lo_create ($c);
- $out = DB_lo_open ($c, $o, "w");
- while (($buf = DB_lo_read ($in, 1000)) != false)
- DB_lo_write ($out, $buf);
- DB_lo_close ($out);
- DB_lo_close ($in);
-
- $in = DB_lo_open($t, $atual["rundata"], "r");
- if (!$in) {
- $o="0";
- LOGLevel("Run not saved as file (run=".$atual["runnumber"].",site=".$atual["runsitenumber"].
- ",contest=$contest", 1);
- } else {
- $sitess=$atual["runsitenumber"];
- $nss=$atual["runnumber"];
- $user=$atual["usernumber"];
- $problem=$atual["runproblem"];
- $filename=escape_string($atual["runfilename"]);
- $ttimet=$atual["rundate"];
- $fp = fopen("/tmp/boca/contest${contest}.site${sitess}.run${nss}.user${user}.".
- "problem${problem}.time${ttimet}.${filename}", "w");
- if ($fp) {
- while (($buf = DB_lo_read ($in, 1000)) != false)
- fwrite ($fp, $buf);
- fclose ($fp);
- $fp = fopen("/tmp/check/contest${contest}.site${sitess}.run${nss}.user${user}.".
- "problem${problem}.time${ttimet}.${filename}.check", "w");
- if ($fp) {
- fwrite($fp, "1");
- fclose ($fp);
- }
- else
- LOGLevel("Run not saved as check file (run=".$atual["runnumber"].",site=".$atual["runsitenumber"].
- ",contest=$contest", 1);
- } else
- LOGLevel("Run not saved as file (run=".$atual["runnumber"].",site=".$atual["runsitenumber"].
- ",contest=$contest", 1);
- DB_lo_close ($out);
- }
-
- }
- DBExec ($c, "insert into runtable (contestnumber, runsitenumber, runnumber, usernumber, rundate,".
- "rundatediff, rundatediffans, runproblem, runfilename, rundata, runanswer, runstatus, runjudge,".
- "runjudgesite, runlangnumber, updatetime) ".
- "values (".$contest.",".$atual["runsitenumber"].",".$atual["runnumber"].",".$atual["usernumber"].",".
- $atual["rundate"].",".
- $atual["rundatediff"].",".
- $atual["rundatediffans"].",".
- $atual["runproblem"].",".
- "'".escape_string($atual["runfilename"])."',$o,".
- $atual["runanswer"].",".
- "'".escape_string($atual["runstatus"])."',".
- $atual["runjudge"].",".
- $atual["runjudgesite"].",".
- $atual["runlangnumber"].",".
- $atual["updatetime"].")");
- DBExec ($t, "commit work");
- }
- }
- echo " deletions=$del, updates=$upd, insertions=$ins\n\n";
-
- // sincronizando runs
- $r = DBExec ($t, "select * from runtable where contestnumber=$contest and runsitenumber=$localsite");
- $rr = DBExec ($c, "select * from runtable where contestnumber=$contest and runsitenumber=$localsite");
- $n = DBnLines ($r);
- $nn = DBnLines ($rr);
- echo "runs: external(site=$site, reading=$localsite)=$n, local=$nn\n";
- for ($k=0; $k<$nn; $k++) $needed[$k]=false;
- for ($j=0;$j<$n;$j++) {
- $la = DBRow($r,$j);
- for ($k=0; $k<$nn; $k++) {
- $aqui = DBRow($rr,$k);
- if ($la["runnumber"]==$aqui["runnumber"] && $la["contestnumber"]==$aqui["contestnumber"] &&
- $la["runsitenumber"]==$aqui["runsitenumber"]) {
- $needed[$k]=true;
- if ($la["updatetime"]>$aqui["updatetime"]) {
- $situacao[$j]="atualizar";
-
-
- if ($la["runanswer"] != "") {
- $rrr = DBExec($c, "select * from answertable where answernumber=".$la["runanswer"].
- " and contestnumber=".$la["contestnumber"]);
- $ans = (DBnLines($rrr)>0)? DBRow($rrr, 0) : null;
- if ($ans == null) {
- echo "Problem with the answer table. Unable to send balloon because the answer was " .
- "not found (run=".$la["runnumber"].", site=".$la["runsite"].", contest=" .
- $la["contestnumber"].", answer=".$la["runanswer"].").";
- $yesla = 'x';
- } else $yesla = $ans["yes"];
- } else $yesla='f';
- if ($aqui["runanswer"] != "") {
- $rrr = DBExec($c, "select * from answertable where answernumber=".$aqui["runanswer"].
- " and contestnumber=".$aqui["contestnumber"]);
- $ans = (DBnLines($rrr)>0)? DBRow($rrr, 0) : null;
- if ($ans == null) {
- echo "Problem with the answer table. Unable to send balloon because the answer was " .
- "not found (run=".$aqui["runnumber"].", site=".$aqui["runsite"].", contest=" .
- $aqui["contestnumber"].", answer=".$aqui["runanswer"].").";
- $yesaqui = 'x';
- } else $yesaqui = $ans["yes"];
- } else $yesaqui='f';
-
- if ($yesla == 't' && $yesaqui == 'f') {
- $rrr = DBExec ($c, "select * from sitetable where contestnumber=".$aqui["contestnumber"].
- " and sitenumber=$localsite");
- if (DBnLines($rrr)<=0)
- echo "Site info not found (contest=${aqui["contestnumber"]}, site=$localsite).";
- else {
- $b = DBRow($rrr,0);
- $ti = $b["sitestartdate"];
- $tempo = time();
- $ta = $tempo - $ti;
- $tf = $b["sitelastmileanswer"];
-// if ($ta < $tf) {
- $rrr = DBExec ($c, "select * from usertable where contestnumber=".
- $aqui["contestnumber"]." and usersitenumber=$localsite and usernumber=".
- $aqui["usernumber"]);
- if (DBnLines($rrr)<=0)
- echo "User info not found (contest=${aqui["contestnumber"]}, ".
- "site=$localsite, user=${aqui["runusernumber"]}).";
- else {
- $u = DBRow ($rrr,0);
- $rrr = DBExec ($c, "select * from problemtable where contestnumber=".
- $aqui["contestnumber"]." and problemnumber=".
- $aqui["runproblem"]);
- if (DBnLines($rrr)<=0)
- echo "Problem info not found (contest=${aqui["contestnumber"]}, ".
- "problem=${aqui["runproblem"]}).";
- else {
- $p = DBRow ($rrr,0);
- mail("balloon@mainserver", "YES: team=" . $u["username"] .
- ", problem=" . $p["problemname"],
- "User ".$u["username"] ." should receive a balloon for ".
- $p["problemfullname"]."\n");
- }
- }
-// }
- }
- } else if ($yesla == 'f' && $yesaqui == 't') {
- $rrr = DBExec ($c, "select * from usertable where contestnumber=".
- $aqui["contestnumber"]." and usersitenumber=$localsite and usernumber=".
- $aqui["usernumber"]);
- if (DBnLines($rrr)<=0)
- echo "User info not found (contest=${aqui["contestnumber"]}, ".
- "site=$localsite, user=${aqui["runusernumber"]}).";
- else {
- $u = DBRow ($rrr,0);
- $rrr = DBExec ($c, "select * from problemtable where contestnumber=".
- $aqui["contestnumber"]." and problemnumber=".
- $aqui["runproblem"]);
- if (DBnLines($rrr)<=0)
- echo "Problem info not found (contest=${aqui["contestnumber"]}, ".
- "problem=${aqui["runproblem"]}).";
- else {
- $p = DBRow ($rrr,0);
- mail("balloon@mainserver", "NO: team=" . $u["username"] .
- ", problem=" . $p["problemname"],
- "Remove the balloon from user ". $u["username"] .
- " for ".$p["problemfullname"]."\n");
- }
- }
- }
-
-
- }
- else
- $situacao[$j]="ok";
- break;
- }
- }
- if ($k>=$nn) $situacao[$j]="inserir";
- }
- $upd=0; $ins=0;
- for ($j=0;$j<$n;$j++) {
- $atual = DBRow($r,$j);
-
- if ($atual["runjudge"]=="") $atual["runjudge"]="null";
- if ($atual["runjudgesite"]=="") $atual["runjudgesite"]="null";
- if ($atual["updatetime"]=="") $atual["updatetime"]=time();
- if ($situacao[$j]=="atualizar") {
- $upd++;
- DBExec ($c, "update runtable set ".
- "usernumber=".$atual["usernumber"].",".
- "rundate=".$atual["rundate"].",".
- "rundatediff=".$atual["rundatediff"].",".
- "rundatediffans=".$atual["rundatediffans"].",".
- "runproblem=".$atual["runproblem"].",".
- "runlangnumber=".$atual["runlangnumber"].",".
- "runanswer=".$atual["runanswer"].",".
- "runstatus='".escape_string($atual["runstatus"])."',".
- "runjudge=".$atual["runjudge"].",".
- "runjudgesite=".$atual["runjudgesite"].",".
- "runfilename='".escape_string($atual["runfilename"])."',".
- "updatetime=".$atual["updatetime"].
- " where contestnumber=$contest and runsitenumber=".$atual["runsitenumber"].
- " and runnumber=".$atual["runnumber"]." and updatetime<".$atual["updatetime"]);
- } else if ($situacao[$j]=="inserir") {
- $ins++;
- echo "Run Inserts shouldn't exist (run=".$atual["runnumber"].")...";
- }
- }
- echo " updates=$upd, insertions=$ins\n\n";
-
- DBExec($c, "commit work");
- DBClose($t);
- }
- DBClose($c);
-}
-
-//fecha a conexao com o banco (isso nao eh realmente necessario, ja que o php/apache cuidam do servico)
-function DBClose($c) {
- if ($c) pg_close($c);
-}
-//executar instrucao no banco de dados, parando em caso de erro quando $stop=1
-function DBExec($conn,$sql) {
-// echo $sql . "\n";
- $result = pg_exec ($conn, $sql);
- if (!$result) {
- echo "Unable to exec SQL in the database. SQL=(" . $sql . ")," .
- " Error=(" . pg_errormessage($conn) . ")\n";
- exit;
- }
- return $result;
-}
-//devolve o numero de linhas da consulta
-function DBnlines ($result) {
- return pg_numrows ($result);
-}
-//pega uma linha da consulta no formato de array
-function DBRow ($r, $i) {
- return pg_fetch_array ($r, $i);
-}
-function escape_string($s) {
- return str_replace("'", "''", $s);
-}
-if (getIP()!="UNKNOWN") exit;
-
-$x = DBConnect();
-if ($x==null) exit;
-$y = DBExec($x, "select * from contesttable where contestactive='t'");
-if (DBnLines($y)==0) {
- echo "Unable to find the active contest in the database.\n";
- exit;
-}
-$ct = DBRow($y,0);
-DBClose($x);
-GetExternalData($ct["contestnumber"]);
-
-?>
diff --git a/old/import-system.txt b/old/import-system.txt
deleted file mode 100644
index 7a23479..0000000
--- a/old/import-system.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-import-system.txt
------------------
-Last modified 20/aug/2007 by cassio@ime.usp.br
-
-************************************
-OUTDATED INFORMATION. PLEASE WAIT FOR A NEW VERSION OF THIS FILE.
-FOR MORE DETAILS, SEE THE EXAMPLE FILE: bits/import.txt
-************************************
-
-
-
-It's possible to create a language file
-(or use the same user file for it, putting the
-languages at the end). Following are some language
-examples, but it is recommended to insert the
-languages by the web pages directly. See the files
-run.sh and compare.sh for compiling/running script and
-comparing script respectively.
-
-
-[language]
-langnumber=1
-langname=C
-langscript=runscriptforlang1.sh
-#!/bin/bash
-echo este eh o runscript 1...
-exit 1
-***END***
-langcompscript=compscriptforlang1.sh
-#!/bin/bash
-echo este eh o compscript 1...
-exit 1
-***END***
-
-langnumber=2
-langname=C++
-langscript=runscriptforlang2.sh
-#!/bin/bash
-echo este eh o runscript 2...
-exit 2
-***END***
-langcompscript=compscriptforlang2.sh
-#!/bin/bash
-echo este eh o compscript 2...
-exit 2
-***END***
-
-langnumber=3
-langname=Java
-langscript=runscriptforlang3.sh
-#!/bin/bash
-echo este eh o runscript 3...
-exit 3
-***END***
-langcompscript=compscriptforlang3.sh
-#!/bin/bash
-echo este eh o compscript 3...
-exit 3
-***END***
-
-
-
-Contacts and Copyrights
------------------------
-BOCA Copyright (c) 2003- Cassio Polpo de Campos (cassio@ime.usp.br)
-http://www.ime.usp.br/~cassio/boca
-
-This software may be distributed under the terms of the Q Public
-License version 1.0. A copy of the license can be found with this
-software or at http://www.opensource.org/licenses/qtpl.php
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/old/import.php b/old/import.php
deleted file mode 100644
index 45dd4bd..0000000
--- a/old/import.php
+++ /dev/null
@@ -1,280 +0,0 @@
-<?php
-//////////////////////////////////////////////////////////////////////////////////////////
-//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-//
-//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-///////////////////////////////////////////////////////////////////////////////////////////
-//Change list
-// 17/aug/2007 by cassio@ime.usp.br: created
-// 25/aug/2007 by cassio@ime.usp.br: php initial tag changed to complete form
-
-require 'header.php';
-
-if (isset($_FILES["importfile"]) && isset($_POST["Submit"]) && $_FILES["importfile"]["name"]!="") {
- if ($_POST["confirmation"] == "confirm") {
- $type=myhtmlspecialchars($_FILES["importfile"]["type"]);
- $size=myhtmlspecialchars($_FILES["importfile"]["size"]);
- $name=myhtmlspecialchars($_FILES["importfile"]["name"]);
- $temp=myhtmlspecialchars($_FILES["importfile"]["tmp_name"]);
- if (!is_uploaded_file($temp)) {
- IntrusionNotify("file upload problem.");
- ForceLoad("../index.php");
- }
- if (($ar = file($temp)) === false) {
- IntrusionNotify("Unable to open the uploaded file.");
- ForceLoad("../index.php");
- }
- echo "<br>Starting to create the contest<br>";
- $asep = trim($ar[0]);
- $i=1;
-
- for (; $i<count($ar) && strpos($ar[$i], "[contest]") === false; $i++) ;
- for ($i++; $i<count($ar) && $ar[$i][0] != "["; $i++) {
- $x = trim($ar[$i]);
- //contestname, startdate, duration, lastmileanswer, lastmilescore, penalty, contestactive
- $tmp = explode("=", $x, 2);
- $param[trim($tmp[0])]=trim($tmp[1]);
- }
- $nc = DBNewContest($param);
- echo "<br>Contest $nc created<br>";
-
- for (; $i<count($ar) && strpos($ar[$i], "[site]") === false; $i++) ;
- while(strpos($ar[$i],"[site]") === true) {
- for ($i++; $i<count($ar) && $ar[$i][0] != "["; $i++) {
- $x = trim($ar[$i]);
- // sitenumber, siteip, sitename, scorelevel
- $tmp = explode("=", $x, 2);
- $param[trim($tmp[0])]=trim($tmp[1]);
- }
- DBNewSite($nc, null, $param);
- echo "New site created<br>";
- }
-
- for (; $i<count($ar) && strpos($ar[$i], "[answer]") === false; $i++) ;
- for ($i++; $i<count($ar) && $ar[$i][0] != "["; $i++) {
- echo "<br>Searching for answers<br>\n";
- $x = trim($ar[$i]);
- if (strpos($x, "answ") !== false && strpos($x, "answ") == 0) {
- unset($answnumber);
- unset($answname);
- unset($answyes);
- while (strpos($x, "answ") !== false && strpos($x, "answ") == 0) {
- $tmp = explode ("=", $x, 2);
- switch (trim($tmp[0])) {
- case "answernumber": $answnumber =trim($tmp[1]); break;
- case "answername": $answname =trim($tmp[1]); break;
- case "answeryes": $answyes =trim($tmp[1]); break;
- }
- $i++;
- if ($i>=count($ar)) break;
- $x = trim($ar[$i]);
- }
- if (isset($answnumber) && is_numeric($answnumber) && isset($answname)) {
- DBNewAnswer ($nc, $answnumber, $answname, $answyes);
- echo "Answer $answnumber created<br>";
- }
- }
- }
-
- for (; $i<count($ar) && strpos($ar[$i], "[language]") === false; $i++) ;
- for ($i++; $i<count($ar) && $ar[$i][0] != "["; $i++) {
- echo "<br>Searching for languages<br>\n";
- $x = trim($ar[$i]);
- if (strpos($x, "lang") !== false && strpos($x, "lang") == 0) {
- unset($langnumber);
- unset($langname);
- unset($langproblem);
- unset($script);
- unset($compscript);
- unset($langscript);
- unset($langcompscript);
- unset($langscripthash);
- unset($langcompscripthash);
- while (strpos($x, "lang") !== false && strpos($x, "lang") == 0) {
- $tmp = explode ("=", $x, 2);
- switch (trim($tmp[0])) {
- case "langnumber": $langnumber =trim($tmp[1]); break;
- case "langname": $langname =trim($tmp[1]); break;
- case "langproblem": $langproblem =trim($tmp[1]); break;
- case "langscripthash": $langscripthash =trim($tmp[1]); break;
- case "langscript": $langscript =trim($tmp[1]);
- $i++;
- for ($j=1; trim($ar[$i]) != "***$asep***"; $j++) {
- if(substr($langscript,0,7)!="base64:") $script .= $ar[$i];
- else $script .= trim($ar[$i]);
- $i++;
- }
- if(substr($langscript,0,7)=="base64:") {
- $langscript = substr($langscript,7);
- $script = base64_decode($script);
- }
- if(trim($langscripthash) != "" && myshorthash($script) != trim($langscripthash))
- echo "ERROR: Hash of $langscript does not match $langscripthash, ".myshorthash($script)."<br>\n";
- break;
- case "langcompscripthash": $langcompscripthash=trim($tmp[1]); break;
- case "langcompscript": $langcompscript =trim($tmp[1]);
- $i++;
- for ($j=1; trim($ar[$i]) != "***$asep***"; $j++) {
- if(substr($langcompscript,0,7)!="base64:") $compscript .= $ar[$i];
- else $compscript .= trim($ar[$i]);
- $i++;
- }
- if(substr($langcompscript,0,7)=="base64:") {
- $langcompscript = substr($langcompscript,7);
- $compscript = base64_decode($compscript);
- }
- if(trim($langcompscripthash) != "" && myshorthash($compscript) != trim($langcompscripthash))
- echo "ERROR: Hash of $langcompscript does not match<br>\n";
- break;
- }
- $i++;
- if ($i>=count($ar)) break;
- $x = trim($ar[$i]);
- }
- if (isset($langnumber) && is_numeric($langnumber) && isset($langname)) {
- DBNewLanguage ($nc,
- $langnumber, $langname, $langproblem, '', '',
- $langshowingoutput, $script, $langscript, $compscript, $langcompscript, 1, 1);
- echo "Language $langnumber created<br>";
- }
- }
- }
-
- for (; $i<count($ar) && strpos($ar[$i], "[problem]") === false; $i++) ;
- for ($i++; $i<count($ar) && $ar[$i][0] != "["; $i++) {
- echo "<br>Searching for problems<br>\n";
- $x = trim($ar[$i]);
- if (strpos($x, "prob") !== false && strpos($x, "prob") == 0) {
- unset($probnumber);
- unset($probname);
- unset($probfullname);
- unset($probbasename);
- unset($probinputfile);
- unset($probinputfilehash);
- unset($probinputfilepath);
- unset($probsolfile);
- unset($probsolfilehash);
- unset($probsolfilepath);
- unset($probdescfile);
- unset($probdescfilehash);
- unset($probdescfilepath);
- unset($probtimelimit);
- unset($probcolorname);
- unset($probcolor);
- while (strpos($x, "prob") !== false && strpos($x, "prob") == 0) {
- $tmp = explode ("=", $x, 2);
- switch (trim($tmp[0])) {
- case "probnumber": $probnumber =trim($tmp[1]); break;
- case "probname": $probname =trim($tmp[1]); break;
- case "probfullname": $probfullname =trim($tmp[1]); break;
- case "probbasename": $probbasename =trim($tmp[1]); break;
- case "probtimelimit": $probtimelimit =trim($tmp[1]); break;
- case "probcolorname": $probcolorname =trim($tmp[1]); break;
- case "probcolor": $probcolor =trim($tmp[1]); break;
- case "probinputfilehash": $probinputfilehash =trim($tmp[1]); break;
- case "probinputfile": $probinputfile =trim($tmp[1]);
- $i++;
- for ($j=1; trim($ar[$i]) != "***$asep***"; $j++) {
- if(substr($probinputfile,0,7)!="base64:") $probinputfilepath .= $ar[$i];
- else $probinputfilepath .= trim($ar[$i]);
- $i++;
- }
- if(substr($probinputfile,0,7)=="base64:") {
- $probinputfile = substr($probinputfile,7);
- $probinputfilepath = base64_decode($probinputfilepath);
- }
- if(trim($probinputfilehash) != "" && myshorthash($probinputfilepath) != trim($probinputfilehash))
- echo "ERROR: Hash of $probinputfile does not match<br>\n";
- break;
- case "probsolfilehash": $probsolfilehash =trim($tmp[1]); break;
- case "probsolfile": $probsolfile =trim($tmp[1]);
- $i++;
- for ($j=1; trim($ar[$i]) != "***$asep***"; $j++) {
- if(substr($probsolfile,0,7)!="base64:") $probsolfilepath .= $ar[$i];
- else $probsolfilepath .= trim($ar[$i]);
- $i++;
- }
- if(substr($probsolfile,0,7)=="base64:") {
- $probsolfile = substr($probsolfile,7);
- $probsolfilepath = base64_decode($probsolfilepath);
- }
- if(trim($probsolfilehash) != "" && myshorthash($probsolfilepath) != trim($probsolfilehash))
- echo "ERROR: Hash of $probsolfile does not match<br>\n";
- break;
- case "probdescfilehash": $probdescfilehash=trim($tmp[1]); break;
- case "probdescfile": $probdescfile =trim($tmp[1]);
- $i++;
- for ($j=1; trim($ar[$i]) != "***$asep***"; $j++) {
- if(substr($probdescfile,0,7)!="base64:") $probdescfilepath .= $ar[$i];
- else $probdescfilepath .= trim($ar[$i]);
- $i++;
- }
- if(substr($probdescfile,0,7)=="base64:") {
- $probdescfile = substr($probdescfile,7);
- $probdescfilepath = base64_decode($probdescfilepath);
- }
- if(trim($probdescfilehash) != "" && myshorthash($probdescfilepath) != trim($probdescfilehash))
- echo "ERROR: Hash of $probdescfile does not match<br>\n";
- break;
- }
- $i++;
- if ($i>=count($ar)) break;
- $x = trim($ar[$i]);
- }
- if (isset($probnumber) && is_numeric($probnumber) && isset($probname) &&
- isset($probfullname) && isset($probbasename) &&
- isset($probtimelimit) && isset($probcolorname) && isset($probcolor)) {
- DBNewProblem ($nc,
- $probnumber, $probname, $probfullname, $probbasename, $probinputfile,
- $probinputfilepath, $probsolfile, $probsolfilepath, 'f', $probdescfile, $probdescfilepath,
- $probtimelimit, $probcolorname, $probcolor, 1, 1, 1);
- echo "Problem $probnumber created<br>";
- }
- }
- }
- }
- echo "</body></html>";
- exit;
-}
-?>
-<br>
-<br>
-<center><b>
-To import a pre-defined contest, just fill in the import file field.</b></center>
-<br>
-<form name="form1" enctype="multipart/form-data" method="post" action="import.php">
- <input type=hidden name="confirmation" value="noconfirm" />
- <center>
- <table border="0">
- <tr>
- <td width="25%" align=right>Import file:</td>
- <td width="75%">
- <input type="file" name="importfile" size="40">
- </td>
- </tr>
- </table>
- </center>
- <script language="javascript">
- function conf() {
- if (confirm("Confirm?")) {
- document.form1.confirmation.value='confirm';
- }
- }
- </script>
- <center>
- <input type="submit" name="Submit" value="Import" onClick="conf()">
- <input type="reset" name="Submit2" value="Clear">
- </center>
-</form>
-
-</body>
-</html>
-
diff --git a/old/import.txt b/old/import.txt
deleted file mode 100644
index 7af6b5b..0000000
--- a/old/import.txt
+++ /dev/null
@@ -1,1143 +0,0 @@
-end123
-
-[contest]
-contestname=Fase Regional da Maratona de Programacao 2007
-scorelevel=4
-sitename=Nome do meu site
-startdate=1190480400
-
-[site]
-
-[answer]
-answernumber=1
-answername=NO - Compile error
-answeryes=f
-
-answernumber=2
-answername=NO - Runtime error
-answeryes=f
-
-answernumber=3
-answername=NO - Time limit exceeded
-answeryes=f
-
-answernumber=4
-answername=YES
-answeryes=t
-
-answernumber=5
-answername=NO - Presentation error
-answeryes=f
-
-answernumber=6
-answername=NO - Wrong answer
-answeryes=f
-
-answernumber=7
-answername=NO - Contact staff
-answeryes=f
-
-answernumber=8
-answername=NO - Problem/File name mismatch
-answeryes=f
-
-[language]
-langnumber=1
-langname=C
-langscriptmd5=7da844fdb1408384529484e9010b6b5d
-langscript=run.sh
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-#Last modified: 21/aug/2007 by cassio@ime.usp.br
-#
-# parameters are:
-# $1 base_filename
-# $2 source_file
-# $3 input_file
-# $4 languagename
-# $5 problemname
-# $6 timelimit
-#
-# the output of the submission should be directed to the standard output
-#
-# the return code show what happened:
-# 0 ok
-# 1 compile error
-# 2 runtime error
-# 3 timelimit exceeded
-# other_codes are unknown to boca: in this case BOCA will present the
-# last line of standard output to the judge
-
-umask 0022
-chown nobody.nogroup .
-
-export CLASSPATH=.:$CLASSPATH
-
-# this script makes use of safeexec to execute the code with less privilegies
-# make sure that directories below are correct.
-sf=`which safeexec`
-[ -x "$sf" ] || sf=/usr/bin/safeexec
-gcc=`which gcc`
-[ -x "$gcc" ] || gcc=/usr/bin/gcc
-gpp=`which g++`
-[ -x "$gpp" ] || gpp=/usr/bin/g++
-java=`which java`
-[ -x "$java" ] || java=/usr/java/bin/java
-javac=`which javac`
-[ -x "$javac" ] || javac=/usr/java/bin/javac
-pascal=`which fpc`
-[ -x "$pascal" ] || pascal=/usr/bin/fpc
-grep=`which grep`
-[ -x "$grep" ] || grep=/bin/grep
-
-if [ "$1" == "" -o "$2" == "" -o "$3" == "" ]; then
- echo "parameter problem"
- exit 43
-fi
-if [ ! -r "$2" ]; then
- echo "$2 not found or it's not readable"
- exit 44
-fi
-if [ ! -r "$3" ]; then
- echo "$3 not found or it's not readable"
- exit 45
-fi
-if [ ! -x "$sf" ]; then
- echo "$sf not found or it's not executable"
- exit 46
-fi
-
-prefix=$1
-name=$2
-input=$3
-
-# setting up the timelimit according to the problem
-# note that problems should spelling the same as inside BOCA
-if [ "$6" == "" ]; then
-time=5
-else
-time=$6
-fi
-let ttime=$time+30
-
-# choose the compiler according to the language
-# note that languages should spelling the same as inside BOCA
-case "$4" in
-C)
- $gcc -lm -o "$prefix" "$name"
- ret=$?
- if [ "$ret" != "0" ]; then
- echo "Compiling Error: $ret"
- exit 1
- else
- $sf -F10 -t$time -T$ttime -i$input -n0 -R. "./$prefix"
- ret=$?
- if [ $ret -gt 3 ]; then
- ret=0
- fi
- fi
- ;;
-C++)
- $gpp -lm -o "$prefix" "$name"
- ret=$?
- if [ "$ret" != "0" ]; then
- echo "Compiling Error: $ret"
- exit 1
- else
- $sf -F10 -t$time -T$ttime -i$input -n0 -R. "./$prefix"
- ret=$?
- if [ $ret -gt 3 ]; then
- ret=0
- fi
- fi
- ;;
-Pascal)
- $pascal -o"$prefix" "$name" >compiler.out 2>compiler.out
- $grep -irq linking compiler.out
- ret=$?
- $grep -irq "lines compiled" compiler.out
- ret2=$?
- if [ "$ret" != "0" -o "$ret2" != "0" ]; then
- cat compiler.out
- echo "Compiling Error: $ret"
- exit 1
- else
- $sf -F10 -t$time -T$ttime -i$input -opascal.out -n0 -R. "./$prefix"
- ret=$?
- if [ -f pascal.out ]; then
- cat pascal.out
- $grep -irq "runtime error" pascal.out
- ret2=$?
- if [ "$ret2" = "0" ]; then
- echo "Strange output - possible runtime error"
- if [ $ret -lt 4 ]; then
- ret=48
- fi
- fi
- fi
- fi
- ;;
-Java)
- $javac "$name"
- ret=$?
- if [ "$ret" != "0" ]; then
- echo "Compiling Error: $ret"
- exit 1
- else
- $sf -u10 -F30 -t$time -T$ttime -i$input -n0 -R. $java "$prefix"
- ret=$?
- if [ $ret -gt 3 ]; then
- echo "Nonzero return code - possible runtime error"
- ret=47
- fi
- fi
- ;;
-*)
- echo "Language not recognized"
- exit 42
- ;;
-esac
-exit $ret
-***end123***
-langcompscriptmd5=bde30aa6d558a0b1596ce7bf8daa75f3
-langcompscript=compare.sh
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-#Last modified: 21/aug/2007 by cassio@ime.usp.br
-#
-# This script receives:
-# $1 team_output
-# $2 sol_output
-# $3 languagename
-# $4 problemname
-# $5 problem_input
-#
-# BOCA reads the last line of the standard output
-# and pass it to judges
-#
-# Next lines of this script just compares team_output and sol_output,
-# although it is possible to change them to more complex evaluations.
-
-if [ ! -r "$1" -o ! -r "$2" ]; then
- echo "Parameter problem"
- exit 43
-fi
-diff -q "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff \"$1\" \"$2\" # files match"
- echo "Files match exactly"
- exit 4
-fi
-diff -q -b "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b \"$1\" \"$2\" # files match"
- echo -e "diff -c \"$1\" \"$2\" # files dont match - see output"
- diff -c "$1" "$2"
- echo "Files match with differences in the amount of white spaces"
- exit 5
-fi
-diff -q -b -B "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b -B \"$1\" \"$2\" # files match"
- echo -e "diff -c -b \"$1\" \"$2\" # files dont match - see output"
- diff -c -b "$1" "$2"
- echo "Files match with differences in the amount of white spaces and blank lines"
- exit 5
-fi
-diff -q -i -b -B "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -i -b -B \"$1\" \"$2\" # files match"
- echo -e "diff -c -b -B \"$1\" \"$2\" # files dont match - see output"
- diff -c -b -B "$1" "$2"
- echo "Files match if we ignore case and differences in the amount of white spaces and blank lines"
- exit 5
-fi
-diff -q -b -B -w "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -b -B -w \"$1\" \"$2\" # files match"
- echo -e "diff -c -i -b -B \"$1\" \"$2\" # files dont match - see output"
- diff -c -i -b -B "$1" "$2"
- echo "Files match if we discard all white spaces"
- exit 5
-fi
-diff -q -i -b -B -w "$1" "$2" >/dev/null 2>/dev/null
-if [ "$?" == "0" ]; then
- echo -e "diff -c -i -b -B -w \"$1\" \"$2\" # files match"
- echo -e "diff -c -b -B -w \"$1\" \"$2\" # files dont match - see output"
- diff -c -b -B -w "$1" "$2"
- echo "Files match if we ignore case and discard all white spaces"
- exit 5
-fi
-echo -e "diff -c -i -b -B -w \"$1\" \"$2\" # files dont match - see output"
-diff -c -i -b -B -w "$1" "$2"
-echo "Differences found"
-exit 6
-***end123***
-
-[problem]
-probnumber=1
-probname=A
-probfullname=Bits
-probbasename=bits
-probtimelimit=2
-probcolorname=Branco
-probcolor=ffffff
-probinputfilemd5=3d80104620532811bddcb6ee7ae45ff1
-probinputfile=base64:bits.in
-MSA3CjQgMSAxMCAyMCAzMAoyIDIwMDAgOTk5CjMgMCAwIDAKMiAxIDEwMDAK
-MTAwMCAxMDczNzQxODI0IDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAw
-IDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAg
-MCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAw
-IDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAg
-MCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAw
-IDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAw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AwIDAgMCAw
-IDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAg
-MCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAw
-IDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAg
-MCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAw
-IDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAg
-MCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwCjEgMAoxIDgKMAo=
-====
-***end123***
-probsolfilemd5=01cb6992846e7c6d7e77ca91fd1c401a
-probsolfile=bits.sol
-Instancia 1
-3
-
-Instancia 2
-20
-
-Instancia 3
-22
-
-Instancia 4
-3
-
-Instancia 5
-20
-
-Instancia 6
-31000
-
-Instancia 7
-1
-
-Instancia 8
-4
-
-***end123***
-probdescfile=base64:warmup07.pdf
-JVBERi0xLjQKMyAwIG9iaiA8PAovTGVuZ3RoIDIwMTYgICAgICAKL0ZpbHRl
-ciAvRmxhdGVEZWNvZGUKPj4Kc3RyZWFtCnjajRjZjtzG8V1fMfITCXgY9sHL
-yEssbAAFSCRACySA1wZaHO6qlSE54rEQAsPfnrqaw5nhSt6H7WZdXVVdV8/P
-96/+8neV75RKqizTu/vHndZ5kqoq2xVpkSidqd394ZfoP2/jvSmy6J9ucFMf
-71XUOYYcGl7fDwR+GvC/i1XU0uYhNWmcpWlUx2X0R5xlNnI9c+x5+XdcAYzY
-2tioaD7Fv97/g9WyibE5qbWvdALKqN3e6KSyWUlq3Y0TndLS2SMKtNHYdAc6
-Io98hxKf49xE7uCR5tCPIr7aVUmV6xylp7u9Vkmp2di/DV9m/9z/5LtnN7o+
-+aX+vT6dfv/snt2vzFxe8aaJzSpmfhfvdYWm6CKawQ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Aw
-MDAwMCBuIAowMDAwMDMxNTQxIDAwMDAwIG4gCjAwMDAwMDUwNDkgMDAwMDAg
-biAKMDAwMDAwNDkyMiAwMDAwMCBuIAowMDAwMDE2OTEwIDAwMDAwIG4gCjAw
-MDAwMTY1NTMgMDAwMDAgbiAKMDAwMDAyNDE0NiAwMDAwMCBuIAowMDAwMDIz
-OTE1IDAwMDAwIG4gCjAwMDAwMzExMjcgMDAwMDAgbiAKMDAwMDAzMDgyNiAw
-MDAwMCBuIAowMDAwMDMxNTk5IDAwMDAwIG4gCjAwMDAwMzE2NTAgMDAwMDAg
-biAKdHJhaWxlcgo8PAovU2l6ZSAyNwovUm9vdCAyNSAwIFIKL0luZm8gMjYg
-MCBSCi9JRCBbPDk2RUQxNUYwNEE5MDE3QkQxQTVDOEY0NDAxQTFDNDEwPiA8
-OTZFRDE1RjA0QTkwMTdCRDFBNUM4RjQ0MDFBMUM0MTA+XQo+PgpzdGFydHhy
-ZWYKMzE4NTMKJSVFT0YK
-====
-***end123***
-
-probnumber=2
-probname=B
-probfullname=CCA A 1
-probbasename=cc
-probtimelimit=3
-probcolorname=cccaaa
-probcolor=333333
-probinputfilemd5=41545cd5f6a54ab28996d8e0109ba756
-probinputfile=c.in
-ac
-ac
-ac
-
-ac
-ac
-
-ac
-***end123***
-probsolfilemd5=696fd0c1a38fa96d213ae34469540cc6
-probsolfile=c.sol
-caa
-aca
-aac
-
-caa
-aca
-aac
-***end123***
-
-[end]
diff --git a/old/run.sh b/old/run.sh
deleted file mode 100755
index 7f4740e..0000000
--- a/old/run.sh
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-#Last modified: 10/aug/2009 by cassio@ime.usp.br
-#
-# parameters are:
-# $1 base_filename
-# $2 source_file
-# $3 input_file
-# $4 languagename
-# $5 problemname
-# $6 timelimit
-#
-# the output of the submission should be directed to the standard output
-#
-# the return code show what happened:
-# 0 ok
-# 1 compile error
-# 2 runtime error
-# 3 timelimit exceeded
-# other_codes are unknown to boca: in this case BOCA will present the
-# last line of standard output to the judge
-
-umask 0022
-chown nobody.nogroup .
-
-export CLASSPATH=.:$CLASSPATH
-
-# this script makes use of safeexec to execute the code with less privilegies
-# make sure that directories below are correct.
-sf=`which safeexec`
-[ -x "$sf" ] || sf=/usr/bin/safeexec
-gcc=`which gcc`
-[ -x "$gcc" ] || gcc=/usr/bin/gcc
-gpp=`which g++`
-[ -x "$gpp" ] || gpp=/usr/bin/g++
-java=`which java`
-[ -x "$java" ] || java=/usr/java/bin/java
-javac=`which javac`
-[ -x "$javac" ] || javac=/usr/java/bin/javac
-pascal=`which fpc`
-[ -x "$pascal" ] || pascal=/usr/bin/fpc
-grep=`which grep`
-[ -x "$grep" ] || grep=/bin/grep
-
-if [ "$1" == "" -o "$2" == "" -o "$3" == "" ]; then
- echo "parameter problem"
- exit 43
-fi
-if [ ! -r "$2" ]; then
- echo "$2 not found or it's not readable"
- exit 44
-fi
-if [ ! -r "$3" ]; then
- echo "$3 not found or it's not readable"
- exit 45
-fi
-if [ ! -x "$sf" ]; then
- echo "$sf not found or it's not executable"
- exit 46
-fi
-
-prefix=$1
-name=$2
-input=$3
-
-# setting up the timelimit according to the problem
-# note that problems should spelling the same as inside BOCA
-if [ "$6" == "" ]; then
-time=5
-else
-time=$6
-fi
-let ttime=$time+30
-
-# choose the compiler according to the language
-# note that languages should spelling the same as inside BOCA
-case "$4" in
-C)
- $gcc -lm -o "$prefix" "$name"
- ret=$?
- if [ "$ret" != "0" ]; then
- echo "Compiling Error: $ret"
- exit 1
- else
- $sf -F10 -t$time -T$ttime -i$input -n0 -R. "./$prefix"
- ret=$?
- if [ $ret -gt 3 ]; then
- ret=0
- fi
- fi
- ;;
-C++)
- $gpp -lm -o "$prefix" "$name"
- ret=$?
- if [ "$ret" != "0" ]; then
- echo "Compiling Error: $ret"
- exit 1
- else
- $sf -F10 -t$time -T$ttime -i$input -n0 -R. "./$prefix"
- ret=$?
- if [ $ret -gt 3 ]; then
- ret=0
- fi
- fi
- ;;
-Pascal)
- $pascal -o"$prefix" "$name" >compiler.out 2>compiler.out
- $grep -irq linking compiler.out
- ret=$?
- $grep -irq "lines compiled" compiler.out
- ret2=$?
- if [ "$ret" != "0" -o "$ret2" != "0" ]; then
- cat compiler.out
- echo "Compiling Error: $ret"
- exit 1
- else
- $sf -F10 -t$time -T$ttime -i$input -opascal.out -n0 -R. "./$prefix"
- ret=$?
- if [ -f pascal.out ]; then
- cat pascal.out
- $grep -irq "runtime error" pascal.out
- ret2=$?
- if [ "$ret2" = "0" ]; then
- echo "Strange output - possible runtime error"
- if [ $ret -lt 4 ]; then
- ret=48
- fi
- fi
- fi
- fi
- ;;
-Java)
- $javac "$name"
- ret=$?
- if [ "$ret" != "0" ]; then
- echo "Compiling Error: $ret"
- exit 1
- else
- $sf -u10 -F30 -t$time -T$ttime -i$input -n0 -R. $java "$prefix"
- ret=$?
- if [ $ret -gt 3 ]; then
- echo "Nonzero return code - possible runtime error"
- ret=47
- fi
- fi
- ;;
-*)
- echo "Language not recognized"
- exit 42
- ;;
-esac
-exit $ret
diff --git a/old/updatescore.sh b/old/updatescore.sh
deleted file mode 100755
index a9c05b7..0000000
--- a/old/updatescore.sh
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/bin/bash
-#//////////////////////////////////////////////////////////////////////////////////////////
-#//BOCA Online Contest Administrator. Copyright (c) 2003- Cassio Polpo de Campos.
-#//It may be distributed under the terms of the Q Public License version 1.0. A copy of the
-#//license can be found with this software or at http://www.opensource.org/licenses/qtpl.php
-#//
-#//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-#//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-#//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
-#//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
-#//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-#//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-#//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#///////////////////////////////////////////////////////////////////////////////////////////
-# last updated 26/oct/2011 by cassio@ime.usp.br
-for i in id chown chmod md5sum wget tr cut awk tail head grep cat sed sleep; do
- p=`which $i`
- if [ -x "$p" ]; then
- echo -n ""
- else
- echo command "$i" not found
- exit 1
- fi
-done
-if [ "`id -u`" != "0" ]; then
- echo "Script must run as root"
-fi
-
-privatedir=/var/www/boca/private
-if [ ! -d $privatedir ]; then
- echo "Could not find directory $privatedir"
- exit 1
-fi
-httpbocadir=boca
-tempdir=/tmp
-others=/var/www/boca/private/otherservers
-secs=120
-apacheuser=
-[ -r /etc/icpc/apacheuser ] && apacheuser=`cat /etc/icpc/apacheuser | sed 's/ \t\n//g'`
-[ "$apacheuser" == "" ] && apacheuser=www-data
-id -u $apacheuser > /dev/null 2>/dev/null
-[ $? != 0 ] && echo "User $apacheuser not found -- error to set permissions with chown/chmod"
-
-#hash="shasum -a 256 -"
-hash="md5sum -"
-
-#rm -f $privatedir/score_*.dat
-#rm -f $privatedir/thissitescore.dat
-chown $apacheuser.root $privatedir/score_*.dat
-chown $apacheuser.root $privatedir/thissitescore.dat
-
-BOCASERVER=
-[ -x /etc/icpc/bocaserver.sh ] && . /etc/icpc/bocaserver.sh
-LOCALSERVER=$BOCASERVER
-if [ "$LOCALSERVER" == "" -o "$LOCALSERVER" == "0/0" ]; then
- LOCALSERVER=http://127.0.0.1/$httpbocadir
-else
- LOCALSERVER=http://$LOCALSERVER/$httpbocadir
-fi
-
-if [ ! -r $others ]; then
- echo "External server list in $others not found"
- exit 1
-fi
-echo "Starting loop to get scores from servers defined in $others"
-while /bin/true; do
-echo "Getting scores..."
-
-qtd=1
-for BOCASERVER in `grep -v "^[ \t]*\#" $others | awk '{ print $1; }'`; do
-if [ "$BOCASERVER" == "" ]; then
- continue
-fi
-echo $BOCASERVER | grep -q "http"
-[ $? == 0 ] || BOCASERVER=http://$BOCASERVER/boca
-
-user=`grep -v "^[ \t]*\#" $others | head -n$qtd | tail -n1 | awk '{ print $2; }'`
-[ "$user" == "" ] && user=score
-pass=`grep -v "^[ \t]*\#" $others | head -n$qtd | tail -n1 | awk '{ print $2; }'`
-[ "$pass" == "" ] && pass=score
-let "qtd = $qtd + 1"
-
-wget -t3 -T3 "$LOCALSERVER/scoretable.php?clock=1" -O $tempdir/.temp.txt 2>/dev/null >/dev/null
-if [ $? != 0 ]; then
- echo "Error getting contest clock from $LOCALSERVER"
-else
- tempo=`cat $tempdir/.temp.txt`
- echo -n "Asking server $BOCASERVER at time $tempo. Authenticating with user '$user'..."
- md=`wget -t3 -T3 -S $BOCASERVER/index.php -O /dev/null --save-cookies $tempdir/.cookie.txt --keep-session-cookies 2>&1 | grep PHPSESS | tail -n1 | cut -f2 -d'=' | cut -f1 -d';'`
- res=`echo -n $pass | $hash | cut -f1 -d' '`
- res=`echo -n "${res}${md}" | $hash | cut -f1 -d' '`
- echo -n "sending password..."
- wget -t3 -T3 "$BOCASERVER/index.php?name=${user}&password=${res}" --load-cookies $tempdir/.cookie.txt --keep-session-cookies --save-cookies $tempdir/.cookie.txt -O $tempdir/.temp.txt 2>/dev/null >/dev/null
- grep -qi incorrect $tempdir/.temp.txt
- if [ $? != 0 ]; then
- fname=`echo $BOCASERVER | tr './:' '_'`
- echo "downloading scoretable..."
- wget -t3 -T3 "$BOCASERVER/scoretable.php?remote=$tempo" --load-cookies $tempdir/.cookie.txt --keep-session-cookies --save-cookies $tempdir/.cookie.txt -O $privatedir/score_${fname}.tmp 2>$tempdir/.bocascore.tmp >$tempdir/.bocascore.tmp
- if [ $? == 0 ]; then
- chown $apacheuser.root $privatedir/score_$fname.tmp
- chmod 660 $privatedir/score_$fname.tmp
- mv $privatedir/score_$fname.tmp $privatedir/score_$fname.dat
- echo "Score downloaded successfully into $privatedir/score_$fname.dat"
- else
- echo "Error getting scoretable from $BOCASERVER: `cat $tempdir/.bocascore.tmp`"
- fi
- else
- echo "Error authenticating to server $BOCASERVER"
- fi
-fi
-rm -f $tempdir/.temp.txt
-rm -f $tempdir/.cookie.txt
-done
-
-echo -n "Waiting $secs secs..."
-sleep $secs
-echo ""
-done
diff --git a/old/webcast/config.php b/old/webcast/config.php
deleted file mode 100644
index b16deb6..0000000
--- a/old/webcast/config.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-$loc = $locr = "..";
-require_once("$locr/globals.php");
-require_once("$locr/db.php");
-if(!ValidSession()) {
- InvalidSession("webcast/index.php");
- ForceLoad("$loc/index.php");
-}
-if($_SESSION["usertable"]["usertype"] != "admin") {
- IntrusionNotify("webcast/index.php");
- ForceLoad("$loc/index.php");
-}
-
-$contest = $_SESSION["usertable"]["contestnumber"];
-$site = $_SESSION["usertable"]["usersitenumber"];
-
-if(($ct = DBSiteInfo($contest, $site)) == null)
- ForceLoad("../index.php");
-
-if(isset($_GET['full']) && $_GET['full'] > 0)
- $freezeTime = $ct['siteduration'];
-else
- $freezeTime = $ct['sitelastmilescore'];
-
-?>
diff --git a/old/webcast/contest/index.php b/old/webcast/contest/index.php
deleted file mode 100644
index 3efc719..0000000
--- a/old/webcast/contest/index.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-
-require '../../db.php';
-require '../config.php';
-
-header('Content-type: text/plain; encoding=utf-8');
-
-$ct = DBContestInfo($contest);
-
-echo
- $ct['contestname'] . "\n";
-
-echo
- $ct['contestduration']/60 . '' .
- $ct['contestlastmileanswer']/60 . '' .
- $ct['contestlastmilescore']/60 . '' .
- $ct['contestpenalty']/60 . "\n";
-
-$c = DBConnect();
-
-$r = DBExec($c,
- 'SELECT problemnumber FROM problemtable' .
- ' WHERE contestnumber = ' . $contest .
- ' AND problemnumber > 0');
-
-$numProblems = DBnlines($r);
-
-$r = DBExec($c,
- 'SELECT username, userfullname FROM usertable' .
- ' WHERE contestnumber = ' . $contest .
- ' AND userenabled = \'t\' AND usersitenumber = ' . $site .
- ' AND usertype = \'team\'');
-
-$numTeams = DBnlines($r);
-
-echo
- $numTeams . '' .
- $numProblems . "\n";
-
-for ($i = 0; $i < $numTeams; $i++) {
- $a = DBRow($r, $i);
- $teamID = $a['username'];
- if(isset($a['usershortname']))
- $teamName = $a['usershortname'];
- else
- $teamName = $a['userfullname'];
- if(isset($a['usershortinstitution']))
- $teamUni = $a['usershortinstitution'];
- else
- $teamUni = $teamName;
-
- echo
- $teamID . '' .
- $teamUni . '' .
- $teamName . "\n";
-}
-
-echo '1' . '' . '1' . "\n";
-echo $numProblems . '' . 'Y' . "\n";
-
-?>
diff --git a/old/webcast/index.php b/old/webcast/index.php
deleted file mode 120000
index 4e9b47a..0000000
--- a/old/webcast/index.php
+++ /dev/null
@@ -1 +0,0 @@
-config.php \ No newline at end of file
diff --git a/old/webcast/runs/index.php b/old/webcast/runs/index.php
deleted file mode 100644
index e28567e..0000000
--- a/old/webcast/runs/index.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-require '../../db.php';
-require '../config.php';
-
-header('Content-type: text/plain; encoding=utf-8');
-
-$s = DBSiteInfo($contest, $site);
-
-$run = DBAllRunsInSites($contest, $site, 'run');
-
-$numRuns = count($run);
-
-for ($i = 0; $i < $numRuns; $i++) {
- $u = DBUserInfo($contest, $site, $run[$i]['user']);
-
- $runID = $run[$i]['number'];
- $runTime = dateconvminutes($run[$i]['timestamp']);
- $runTeam = $u['username'];
- $runProblem = $run[$i]['problem'];
-
- if ($runTime > $freezeTime) {
- continue;
- }
-
- echo
- $runID . '' .
- $runTime . '' .
- $runTeam . '' .
- $runProblem . '';
-
- if ($run[$i]['yes']=='t') {
- echo 'Y' . "\n";
- } else if ($run[$i]['answer'] == 'Not answered yet') {
- echo '?' . "\n";
- } else {
- echo 'N' . "\n";
- };
-}
-
-?>
diff --git a/old/webcast/time/index.php b/old/webcast/time/index.php
deleted file mode 100644
index 061c81f..0000000
--- a/old/webcast/time/index.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
-require '../../db.php';
-require '../config.php';
-
-header('Content-type: text/plain; encoding=utf-8');
-
-$s = DBSiteInfo($contest, $site);
-
-echo $s['currenttime'];
-
-?>
diff --git a/old/webcast/version/index.php b/old/webcast/version/index.php
deleted file mode 100644
index 4d474a2..0000000
--- a/old/webcast/version/index.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-require '../../db.php';
-require '../config.php';
-
-header('Content-type: text/plain; encoding=utf-8');
-
-echo '1.0' . "\n";
-
-?>
diff --git a/src/fextdata.php b/src/fextdata.php
index 4158dda..430fc04 100644
--- a/src/fextdata.php
+++ b/src/fextdata.php
@@ -15,7 +15,17 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////////////
-// Last modified 25/jul/2017 by cassio@ime.usp.br
+// Last modified 10/aug/2017 by cassio@ime.usp.br
+
+function makeurlhttps($siteurl) {
+ if(substr($siteurl,0,7) == 'http://')
+ $siteurl = substr($siteurl,7);
+ if(substr($siteurl,0,8) != 'https://')
+ $siteurl = 'https://' . $siteurl;
+ if(substr($siteurl,strlen($siteurl)-1,1) != '/')
+ $siteurl .= '/';
+ return $siterul;
+}
function scoretransfer($putname, $localsite) {
$ds = DIRECTORY_SEPARATOR;
@@ -57,20 +67,16 @@ $superlfile = $privatedir . $ds . "score_localsite_" . $localsite . "_x.dat";
$siteurl = $sitedata[0];
if(strpos($siteurl,'#') !== false) continue;
LOGError("scoretransfer: found site $siteurl");
- if(substr($siteurl,0,7) != 'http://')
- $siteurl = 'http://' . $siteurl;
- $urldiv='/';
- if(substr($siteurl,strlen($siteurl)-1,1) == '/')
- $urldiv = '';
-// LOGError("url=" .$siteurl . $urldiv . "index.php?getsessionid=1");
+ $siteurl = makeurlhttps($siteurl);
+// LOGError("url=" .$siteurl . "index.php?getsessionid=1");
$opts = array();
$opts['http']['timeout'] = 5;
$context = stream_context_create($opts);
- $sess = @file_get_contents($siteurl . $urldiv . "index.php?getsessionid=1", 0, $context);
+ $sess = @file_get_contents($siteurl . "index.php?getsessionid=1", 0, $context);
// LOGError("sess=$sess pass=" . trim($sitedata[2]) . " hash=" . myhash(trim($sitedata[2])));
$user = trim($sitedata[1]);
$res = myhash( myhash (trim($sitedata[2])) . $sess);
-// LOGError("url=" . $siteurl . $urldiv . "index.php?name=${user}&password=${res}&action=transfer");
+// LOGError("url=" . $siteurl . "index.php?name=${user}&password=${res}&action=transfer");
$opts = array(
'http' => array(
'method' => 'GET',
@@ -85,10 +91,10 @@ $superlfile = $privatedir . $ds . "score_localsite_" . $localsite . "_x.dat";
$opts['http']['timeout'] = 5;
$context = stream_context_create($opts);
- $ok = @file_get_contents($siteurl . $urldiv . "index.php?name=${user}&password=${res}&action=transfer", 0, $context);
+ $ok = @file_get_contents($siteurl . "index.php?name=${user}&password=${res}&action=transfer", 0, $context);
// LOGError("ok=" . $ok);
if(substr($ok,strlen($ok)-strlen('TRANSFER OK'),strlen('TRANSFER OK')) == 'TRANSFER OK') {
- $res = @file_get_contents($siteurl . $urldiv . "scoretable.php?remote=-42", 0, $context);
+ $res = @file_get_contents($siteurl . "scoretable.php?remote=-42", 0, $context);
@file_put_contents($privatedir . $ds . 'remotescores' . $ds . 'tmp.zip', $res);
if(is_readable($privatedir . $ds . 'remotescores' . $ds . 'tmp.zip')) {
$zip = new ZipArchive;
@@ -138,7 +144,7 @@ $superlfile = $privatedir . $ds . "score_localsite_" . $localsite . "_x.dat";
$opts['http']['header'] .= "\r\nProxy-Authorization: Basic " . $bocaproxypass;
$opts['http']['timeout'] = 5;
$context = stream_context_create($opts);
- $s = @file_get_contents($siteurl . $urldiv . "site/putfile.php", 0, $context);
+ $s = @file_get_contents($siteurl . "site/putfile.php", 0, $context);
if(strpos($s,'SCORE UPLOADED OK') !== false)
LOGError("scoretransfer: upload OK");
else
@@ -163,7 +169,7 @@ $superlfile = $privatedir . $ds . "score_localsite_" . $localsite . "_x.dat";
$opts['http']['header'] .= "\r\nProxy-Authorization: Basic " . $bocaproxypass;
$opts['http']['timeout'] = 5;
$context = stream_context_create($opts);
- $s = @file_get_contents($siteurl . $urldiv . "site/putfilesuper.php", 0, $context);
+ $s = @file_get_contents($siteurl . "site/putfilesuper.php", 0, $context);
if(strpos($s,'SCORE UPLOADED OK') !== false)
LOGError("scoretransfer: upload full OK");
else
@@ -221,16 +227,12 @@ function getMainXML() {
$siteurl = $sitedata[0];
LOGInfo("getMainXML: site $siteurl");
- if(substr($siteurl,0,7) != 'http://')
- $siteurl = 'http://' . $siteurl;
- $urldiv='/';
- if(substr($siteurl,strlen($siteurl)-1,1) == '/')
- $urldiv = '';
- // LOGError("url=" .$siteurl . $urldiv . "index.php?getsessionid=1");
+ $siteurl = makeurlhttps($siteurl);
+ // LOGError("url=" .$siteurl . "index.php?getsessionid=1");
$opts = array();
$opts['http']['timeout'] = 5;
$context = stream_context_create($opts);
- $sess = @file_get_contents($siteurl . $urldiv . "index.php?getsessionid=1", 0, $context);
+ $sess = @file_get_contents($siteurl . "index.php?getsessionid=1", 0, $context);
// LOGError("sess=$sess pass=" . trim($sitedata[2]) . " hash=" . myhash(trim($sitedata[2])));
$user = trim($sitedata[1]);
$res = myhash( myhash (trim($sitedata[2])) . $sess);
@@ -247,7 +249,7 @@ function getMainXML() {
$opts['http']['header'] .= "\r\nProxy-Authorization: Basic " . $bocaproxypass;
$opts['http']['timeout'] = 5;
$context = stream_context_create($opts);
- $ok = @file_get_contents($siteurl . $urldiv . "index.php?name=${user}&password=${res}&action=transfer", 0, $context);
+ $ok = @file_get_contents($siteurl . "index.php?name=${user}&password=${res}&action=transfer", 0, $context);
$ti = mytime();
// LOGError("ok=" . $ok);
if(substr($ok,strlen($ok)-strlen('TRANSFER OK'),strlen('TRANSFER OK')) == 'TRANSFER OK') {
@@ -271,7 +273,7 @@ function getMainXML() {
$opts['http']['header'] .= "\r\nProxy-Authorization: Basic " . $bocaproxypass;
$opts['http']['timeout'] = 5;
$context = stream_context_create($opts);
- $s = @file_get_contents($siteurl . $urldiv . "site/getsite.php", 0, $context);
+ $s = @file_get_contents($siteurl . "site/getsite.php", 0, $context);
if(strpos($s,'<OK>') !== false)
LOGInfo("xmltransfer: OK");
else
diff --git a/src/private/remotescores/otherservers b/src/private/remotescores/otherservers
index 1fa415c..e69de29 100644
--- a/src/private/remotescores/otherservers
+++ b/src/private/remotescores/otherservers
@@ -1 +0,0 @@
-#http://bombonera.org/boca siteX password
diff --git a/tools/boca-auth-runs b/tools/boca-auth-runs
index c03fc4f..565bbd1 100755
--- a/tools/boca-auth-runs
+++ b/tools/boca-auth-runs
@@ -26,13 +26,13 @@ for i in wget sha256sum cut; do
done
temp=/tmp/.temp.`date +%s%N`.txt
-md=`wget -t 2 -T 5 -S http://$BOCASERVER/boca/getcode.php -O /dev/null --save-cookies ${temp}.cookie.txt --keep-session-cookies 2>&1 | grep PHPSESS | tail -n1`
+md=`wget -t 2 -T 5 -S https://$BOCASERVER/boca/getcode.php -O /dev/null --save-cookies ${temp}.cookie.txt --keep-session-cookies 2>&1 | grep PHPSESS | tail -n1`
echo "$md" | grep -q PHPSESS
if [ "$?" == "0" ]; then
md=`echo $md | cut -f2 -d'=' | cut -f1 -d';'`
ress=`echo -n $pass | sha256sum - | cut -f1 -d' '`
res=`echo -n "${ress}${md}" | sha256sum - | cut -f1 -d' '`
- wget -t 2 -T 5 "http://$BOCASERVER/boca/getcode.php?name=${user}&password=${res}" --load-cookies ${temp}.cookie.txt --keep-session-cookies --save-cookies ${temp}.cookie.txt -O $temp 2>/dev/null >/dev/null
+ wget -t 2 -T 5 "https://$BOCASERVER/boca/getcode.php?name=${user}&password=${res}" --load-cookies ${temp}.cookie.txt --keep-session-cookies --save-cookies ${temp}.cookie.txt -O $temp 2>/dev/null >/dev/null
grep -qi incorrect $temp
if [ $? == 0 ]; then
echo ""
diff --git a/tools/boca-submit-run-aux b/tools/boca-submit-run-aux
index 1398899..eec370e 100755
--- a/tools/boca-submit-run-aux
+++ b/tools/boca-submit-run-aux
@@ -23,13 +23,13 @@ for i in uuencode wget tr perl sha256sum cut; do
done
temp=/tmp/.temp.`date +%s%N`.txt
-md=`wget -t 2 -T 5 -S http://$BOCASERVER/boca/index.php -O /dev/null --save-cookies ${temp}.cookie.txt --keep-session-cookies 2>&1 | grep PHPSESS | tail -n1`
+md=`wget -t 2 -T 5 -S https://$BOCASERVER/boca/index.php -O /dev/null --save-cookies ${temp}.cookie.txt --keep-session-cookies 2>&1 | grep PHPSESS | tail -n1`
echo "$md" | grep -q PHPSESS
if [ "$?" == "0" ]; then
md=`echo $md | cut -f2 -d'=' | cut -f1 -d';'`
res=`echo -n $pass | sha256sum - | cut -f1 -d' '`
res=`echo -n "${res}${md}" | sha256sum - | cut -f1 -d' '`
- wget -t 2 -T 5 "http://$BOCASERVER/boca/index.php?name=${user}&password=${res}" --load-cookies ${temp}.cookie.txt --keep-session-cookies --save-cookies ${temp}.cookie.txt -O $temp 2>/dev/null >/dev/null
+ wget -t 2 -T 5 "https://$BOCASERVER/boca/index.php?name=${user}&password=${res}" --load-cookies ${temp}.cookie.txt --keep-session-cookies --save-cookies ${temp}.cookie.txt -O $temp 2>/dev/null >/dev/null
grep -qi incorrect $temp
if [ $? == 0 ]; then
echo "$BOCASERVER: User or password incorrect"
@@ -62,7 +62,7 @@ if [ "$?" == "0" ]; then
echo -n "&problem=`echo -n $problem | perl -MURI::Escape -lne 'print uri_escape($_)'`" >> $temp
echo -n "&language=`echo -n $language | perl -MURI::Escape -lne 'print uri_escape($_)'`" >> $temp
echo -n "&data=`echo -n $data | tr -d ' ' | perl -MURI::Escape -lne 'print uri_escape($_)'`" >> $temp
- wget -t 2 -T 5 "http://$BOCASERVER/boca/team/run.php" --load-cookies ${temp}.cookie.txt --keep-session-cookies -O ${temp}.out --post-file=$temp >/dev/null 2>/dev/null
+ wget -t 2 -T 5 "https://$BOCASERVER/boca/team/run.php" --load-cookies ${temp}.cookie.txt --keep-session-cookies -O ${temp}.out --post-file=$temp >/dev/null 2>/dev/null
res=`tail -n1 ${temp}.out`
echo $res | grep -q "RESULT:"
diff --git a/tools/etc/apache2/conf.d/boca b/tools/etc/apache2/conf.d/boca
deleted file mode 100644
index 66c62fe..0000000
--- a/tools/etc/apache2/conf.d/boca
+++ /dev/null
@@ -1,15 +0,0 @@
-<Directory /var/www/boca/src>
- AllowOverride Options AuthConfig Limit
- Order Allow,Deny
- Allow from all
- AddDefaultCharset utf-8
-</Directory>
-<Directory /var/www/boca/src/private>
- AllowOverride Options AuthConfig Limit
- Deny from all
-</Directory>
-<Directory /var/www/boca>
- AllowOverride Options AuthConfig Limit
- Deny from all
-</Directory>
-Alias /boca /var/www/boca/src
diff --git a/tools/etc/cron.hourly/.placeholder b/tools/etc/cron.hourly/.placeholder
deleted file mode 100644
index 76cb8d0..0000000
--- a/tools/etc/cron.hourly/.placeholder
+++ /dev/null
@@ -1,2 +0,0 @@
-# DO NOT EDIT OR REMOVE
-# This file is a simple placeholder to keep dpkg from removing this directory
diff --git a/tools/etc/cron.hourly/ntp b/tools/etc/cron.hourly/ntp
deleted file mode 100755
index 8f1cda9..0000000
--- a/tools/etc/cron.hourly/ntp
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-ntpdate -u 198.60.22.240
diff --git a/tools/etc/icpc/becomeserver.sh b/tools/etc/icpc/becomeserver.sh
deleted file mode 100755
index 7f1cf1b..0000000
--- a/tools/etc/icpc/becomeserver.sh
+++ /dev/null
@@ -1,273 +0,0 @@
-#!/bin/bash
-# ////////////////////////////////////////////////////////////////////////////////
-# //BOCA Online Contest Administrator
-# // Copyright (C) 2003-2014 by BOCA Development Team (bocasystem@gmail.com)
-# //
-# // This program is free software: you can redistribute it and/or modify
-# // it under the terms of the GNU General Public License as published by
-# // the Free Software Foundation, either version 3 of the License, or
-# // (at your option) any later version.
-# //
-# // This program is distributed in the hope that it will be useful,
-# // but WITHOUT ANY WARRANTY; without even the implied warranty of
-# // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# // GNU General Public License for more details.
-# // You should have received a copy of the GNU General Public License
-# // along with this program. If not, see <http://www.gnu.org/licenses/>.
-# ////////////////////////////////////////////////////////////////////////////////
-# // Last modified 15/aug/2014 by cassio@ime.usp.br
-for i in id chown chmod cut awk grep cat sed makepasswd ifconfig iptables php touch mkdir update-rc.d su rm mv; do
- p=`which $i`
- if [ -x "$p" ]; then
- echo -n ""
- else
- echo command "$i" not found
- exit 1
- fi
-done
-bkpserver=0
-if [ "$1" == "bkp" ]; then
- if [ "$2" == "" ]; then
- echo "Usage $0 bkp <IP-number-of-main-server>"
- exit 1
- else
- bkpserver=$2
- fi
-fi
-
-if [ "`id -u`" != "0" ]; then
- echo "Must be run as root"
- exit 1
-fi
-bocadir=/var/www/boca
-[ -r /etc/boca.conf ] && . /etc/boca.conf
-
-privatedir=$bocadir/src/private
-if [ ! -d $privatedir ]; then
- echo "Could not find directory $privatedir"
- exit 1
-fi
-
-apacheuser=
-[ -r /etc/icpc/apacheuser ] && apacheuser=`cat /etc/icpc/apacheuser | sed 's/ \t\n//g'`
-[ "$apacheuser" == "" ] && apacheuser=www-data
-id -u $apacheuser >/dev/null 2>/dev/null
-if [ $? != 0 ]; then
- echo "User $apacheuser not found -- error to set permissions with chown/chmod"
- apacheuser=root
-fi
-
-postgresuser=postgres
-id -u $postgresuser >/dev/null 2>/dev/null
-if [ $? != 0 ]; then
- echo "User $postgresuser not found -- maybe you use another name (then update this script) or postgres is not installed"
- exit 1
-fi
-
-grep -iq "iface.*eth0.*inet.*static" /etc/network/interfaces
-if [ $? != 0 ]; then
- echo "*****************************************"
- echo "IMPORTANT NOTICE ************************"
- echo "Network interface eth0 has to be set with"
- echo "a static IP address for this computer to "
- echo "be a proper server -- DO IT ASAP ********"
- echo "*****************************************"
- sleep 2
-fi
-
-BOCASERVER=localhost
-if [ -f /etc/icpc/postgresql.version ]; then
- . /etc/icpc/postgresql.version
-else
-POSTGRESV=""
-if [ ! -f /etc/init.d/postgresql ]; then
- POSTGRESV="-8.4"
-fi
-fi
-if [ ! -f /etc/init.d/postgresql$POSTGRESV ]; then
- echo "I did not find the correct version of postgres -- please check it and update this script"
- exit 1
-fi
-
-for i in `ls /etc/postgresql/*/main/pg_hba.conf`; do
- grep -q "host.*bocadb.*bocauser" $i
- if [ $? != 0 ]; then
- echo "############"
- echo "I AM GIVING ACCESS TO THE DATABASE FROM ANY IP (AS LONG AS THE PASSWORD IS OK)"
- echo "In order to improve security, it is possible to alter the file $i"
- echo "and perform a finer tune. Nevertheless, if the password of the DB is safe, there is no big threat"
- echo "For doing that, I am using the line:"
- echo ""
- echo -e "echo \"host bocadb bocauser 0/0 md5\" >> $i"
- echo -e "echo \"host postgres replication 0/0 md5\" >> $i"
- echo ""
- echo "==> IDEALLY FOR IMPROVED SECURITY, REPLACE THE FIRST 0/0 ABOVE (IN THAT FILE) WITH THE IP ADDRESS OF THE AUTOJUDGE MACHINE <=="
- echo "==> IF YOU HAVE MULTIPLE AUTOJUDGE MACHINES, WRITE ONE LINE FOR EACH IP ADDRESS THERE IN THE FILE <=="
- echo "==> IDEALLY FOR IMPROVED SECURITY, REPLACE THE SECOND 0/0 ABOVE (FOR REPLICATION) WITH THE IP ADDRESS OF THE REPLICATION MACHINE <=="
- echo "############"
- echo "host bocadb bocauser 0/0 md5" >> $i
- echo "host postgres replication 0/0 md5" >> $i
- else
- echo "############"
- echo "IT SEEMS YOU ALREADY HAVE MODIFIED THE FILE $i WITH BOCA'S INFORMATION"
- echo "I WOULD USE THE LINE:"
- echo ""
- echo -e "echo \"host bocadb bocauser 0/0 md5\" >> $i"
- echo -e "echo \"host postgres replication 0/0 md5\" >> $i"
- echo ""
- echo "to give access to the database to other computers, but"
- echo ">>> I'M NOT DOING IT -- PLEASE CHECK IT <<<"
- echo "############"
- fi
-done
-
-for i in `ls /etc/postgresql/*/main/postgresql.conf`; do
-grep -q "^[^\#]*listen_addresses" $i
-if [ $? != 0 ]; then
- echo "listen_addresses = '*'" >> $i
-fi
-done
-for i in `ls /etc/postgresql/*/main/postgresql.conf`; do
-grep -q "^[^\#]*max_connections" $i
-if [ $? != 0 ]; then
- echo "max_connections = 100" >> $i
-fi
-done
-for i in `ls /etc/postgresql/*/main/postgresql.conf`; do
-grep -q "^[^\#]*maintenance_work_mem" $i
-if [ $? != 0 ]; then
- echo "maintenance_work_mem = 64MB" >> $i
-fi
-done
-for i in `ls /etc/postgresql/*/main/postgresql.conf`; do
-grep -q "^[^\#]*shared_buffers" $i
-if [ $? != 0 ]; then
- echo "shared_buffers = 128MB" >> $i
-fi
-done
-for i in `ls /etc/postgresql/*/main/postgresql.conf`; do
-grep -q "^[^\#]*work_mem" $i
-if [ $? != 0 ]; then
- echo "work_mem = 4MB" >> $i
-fi
-done
-for i in `ls /etc/postgresql/*/main/postgresql.conf`; do
-grep -q "^[^\#]*max_wal_senders" $i
-if [ $? != 0 ]; then
- echo "max_wal_senders = 3" >> $i
-fi
-done
-for i in `ls /etc/postgresql/*/main/postgresql.conf`; do
-grep -q "^[^\#]*wal_level" $i
-if [ $? != 0 ]; then
- echo "wal_level = hot_standby" >> $i
-fi
-done
-for i in `ls /etc/postgresql/*/main/postgresql.conf`; do
-grep -q "^[^\#]*wal_keep_segments" $i
-if [ $? != 0 ]; then
- echo "wal_keep_segments = 100" >> $i
-fi
-done
-
-# for i in `ls /etc/postgresql/*/main/postgresql.conf`; do
-# grep -q "^[^\#]*archive_mode" $i
-# if [ $? != 0 ]; then
-# echo "archive_mode = on" >> $i
-# fi
-# done
-# for i in `ls /etc/postgresql/*/main/postgresql.conf`; do
-# grep -q "^[^\#]*archive_command" $i
-# if [ $? != 0 ]; then
-# echo "archive_command = 'test ! -f /var/www/pg_archive/%f.gz && gzip < %p > /var/www/pg_archive/%f.gz && chmod 640 /var/www/pg_archive/%f.gz''" >> $i
-# fi
-# done
-# mkdir -p /var/www/pg_archive
-# chown postgres:icpcadmin /var/www/pg_archive
-# chmod 6770 /var/www/pg_archive
-
-echo "You need to define a password to be used in the database."
-echo "IF THIS IS A BKP SERVER, PLEASE USE THE SAME AS IN THE MAIN SERVER."
-echo -n "It is possible generate a random one. Want a random password "
-read -p "[Y/n]? " OK
-if [ "$OK" = "n" ]; then
- read -p "Enter DB password: " -s PASS
-else
- PASS=`makepasswd --char 10`
- echo "The DB password is $PASS"
-fi
-echo "Keep the DB password safe!"
-echo "The IP address that is computer is using is"
-echo "(check using the command ifconfig, if desired. Use this address to configure other computers)"
-ifconfig eth0 | grep -i "inet addr"
-
-PASSK=`makepasswd --chars 20`
-awk -v boca="$BOCASERVER" -v pass="$PASS" -v passk="$PASSK" '{ if(index($0,"[\"dbpass\"]")>0) \
- print "$conf[\"dbpass\"]=\"" pass "\";"; \
- else if(index($0,"[\"dbhost\"]")>0) print "$conf[\"dbhost\"]=\"" boca "\";"; \
- else if(index($0,"[\"dbsuperpass\"]")>0) print "$conf[\"dbsuperpass\"]=\"" pass "\";"; \
- else if(index($0,"[\"key\"]")>0) print "$conf[\"key\"]=\"" passk "\";"; else print $0; }' \
- < $privatedir/conf.php > $privatedir/conf.php1
-mv -f $privatedir/conf.php1 $privatedir/conf.php
-echo "Deny from all" > $privatedir/.htaccess
-chown -R $apacheuser.root $privatedir
-chmod -R u+rw,g+rw,o-rw $privatedir
-iptables -F
-echo "BOCASERVER=0/0" > /etc/icpc/bocaserver.sh
-
-
-grep -iq "^[^\#]*ServerName" /etc/apache2/apache2.conf
-if [ $? != 0 ]; then
- echo "ServerName boca" >> /etc/apache2/apache2.conf
-fi
-
-/etc/init.d/apache2 restart
-mkdir -p /var/run/postgresql
-chown $postgresuser.$postgresuser /var/run/postgresql
-/etc/init.d/postgresql$POSTGRESV restart
-update-rc.d apache2 defaults
-update-rc.d postgresql$POSTGRESV defaults
-
-rm -f /tmp/.boca.tmp
-su - $postgresuser -c "echo select contestnumber from contesttable | psql -d bocadb | grep contestnumber >/tmp/.boca.tmp 2>/tmp/.boca.tmp"
-su - $postgresuser -c "echo drop user bocauser | psql -d template1 >/dev/null 2>/dev/null"
-su - $postgresuser -c "echo create user bocauser createdb password \'$PASS\' | psql -d template1"
-su - $postgresuser -c "echo alter user bocauser createdb password \'$PASS\' | psql -d template1"
-
-OK=y
-grep -qi contestnumber /tmp/.boca.tmp
-if [ $? == 0 ]; then
- OK=x
- while [ "$OK" != "y" -a "$OK" != "n" ]; do
- echo "====== An old database seems to exist. I can keep it, but it might not work with the version"
- echo -n "of BOCA being installed. May I erase all the content of the bocadb database [y/n]"
- OK=x
- read -p "?" OK
- done
-fi
-if [ "$OK" == "y" ]; then
-cd $bocadir/src
-php private/createdb.php
-cd - >/dev/null 2>/dev/null
- echo "database renewed. Data on bocadb has been lost"
-else
- echo "*** database not erased. Check if BOCA is compatible. You can always erase the database and"
- echo "*** fix the problem by running (as root) cd $bocadir/src; php private/createdb.php"
- echo "*** still, all data regarding BOCA in the database will be lost"
-fi
-touch /etc/icpc/.isserver
-
-if [ "$bkpserver" != "0" ]; then
- echo "Connecting to main server at $bkpserver to initialize the database -- pay attention in the following messages"
- for i in `ls -d /var/lib/postgresql/*/main`; do
- echo "standby_mode = \'on\'" > $i/recovery.conf
- chmod 600 $i/recovery.conf
- echo "primary_conninfo = \'host=$bkpserver port=5432 user=postgres password=$PASS\'" >> $i/recovery.conf
- chown $postgresuser $i/recovery.conf
- su - $postgresuser -c "pg_basebackup -D $i -w -R --xlog-method=stream --dbname=\'host=$bkpserver user=postgres port=5432 password=$PASS\'"
- done
- echo "=-=-=-= CHECK IF THE PREVIOUS MESSAGES HAVE NO ERRORS =-=-=-="
-fi
-
-echo "configuration finished. Boca should be available at http://localhost/boca/"
-echo "reboot might not be required, but is advised."
diff --git a/tools/etc/icpc/cleandisk.sh b/tools/etc/icpc/cleandisk.sh
deleted file mode 100755
index 0d177de..0000000
--- a/tools/etc/icpc/cleandisk.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-mkdir -p /home/icpc
-/usr/bin/touch /home/icpc/.cleandisk.sh
diff --git a/tools/etc/icpc/createbocajail.sh b/tools/etc/icpc/createbocajail.sh
deleted file mode 100755
index a74d001..0000000
--- a/tools/etc/icpc/createbocajail.sh
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/bin/bash
-homejail=/home/bocajail
-[ "$1" != "" ] && homejail=$1
-echo "================================================================================="
-echo "============= CREATING $homejail (this might take some time) ==============="
-echo "================================================================================="
-for i in setquota ln id chown chmod dirname useradd mkdir cp rm mv apt-get dpkg uname debootstrap schroot; do
- p=`which $i`
- if [ -x "$p" ]; then
- echo -n ""
- else
- echo command "$i" not found
- exit 1
- fi
-done
-if [ "`id -u`" != "0" ]; then
- echo "Must be run as root"
- exit 1
-fi
-if [ ! -r /etc/lsb-release ]; then
- echo "File /etc/lsb-release not found. Is this a ubuntu or debian-like distro?"
- echo "If so, execute the command"
- echo ""
- echo "DISTRIB_CODENAME=WXYZ > /etc/lsb-release"
- echo ""
- echo "to save the release name to that file (replace WXYZ with your distro codename)"
- exit 1
-fi
-. /etc/lsb-release
-if [ -d /bocajail/ ]; then
- echo "You seem to have already a /bocajail installed"
- echo "If you want to reinstall, remove it first (e.g. rm /bocajail) and then run /etc/icpc/createbocajail.sh"
- exit 1
-fi
-
-if [ -f $homejail/proc/cpuinfo ]; then
- echo "You seem to have already installed /bocajail and the /bocajail/proc seems to be mounted"
- chroot $homejail umount /sys >/dev/nul 2>/dev/null
- chroot $homejail umount /proc >/dev/nul 2>/dev/null
- echo "Please reboot the system to remove such mounted point"
- exit 1
-fi
-
-id -u bocajail >/dev/null 2>/dev/null
-if [ $? != 0 ]; then
- useradd -m -s /bin/bash -d $homejail -g users bocajail
- cat <<EOF > /var/lib/AccountsService/users/bocajail
-[User]
-SystemAccount=true
-EOF
- sleep 1
-else
- echo "user bocajail already exists"
- echo "if you want to proceed, first remove it (e.g. userdel bocajail) and then run /etc/icpc/createbocajail.sh"
- exit 1
-fi
-setquota -u bocajail 0 500000 0 10000 -a
-
-rm -rf /bocajail
-mkdir -p $homejail/tmp
-chmod 1777 $homejail/tmp
-ln -s $homejail /bocajail
-#for i in usr lib var bin sbin etc dev; do
-# [ -d $homejail/$i ] && rm -rf $homejail/$i
-# cp -ar /$i $homejail
-#done
-#rm -rf $homejail/var/lib/postgres*
-#rm -rf $homejail/var/www/*
-#mkdir -p $homejail/proc
-#mkdir -p $homejail/sys
-uname -m | grep -q 64
-if [ $? == 0 ]; then
- archt=amd64
-else
- archt=i386
-fi
-
-cat <<FIM > /etc/schroot/chroot.d/bocajail.conf
-[bocajail]
-description=Jail
-directory=$homejail
-root-users=root
-type=directory
-users=bocajail,nobody,root
-FIM
-
-#debootstrap --arch $archt $DISTRIB_CODENAME $homejail
-debootstrap $DISTRIB_CODENAME $homejail
-if [ $? != 0 ]; then
- echo "bocajail failed to debootstrap"
- exit 1
-else
-schroot -l | grep -q bocajail
-if [ $? == 0 ]; then
- echo "bocajail successfully installed at $homejail"
-else
- echo "*** some error has caused bocajail not to install properly -- I will try it again with different parameters"
- echo "location=$homejail" >> /etc/schroot/chroot.d/bocajail.conf
- debootstrap $DISTRIB_CODENAME $homejail
- schroot -l | grep -q bocajail
- if [ $? == 0 ]; then
- echo "*** bocajail successfully installed at $homejail"
- else
- echo "*** bocajail failed to install"
- exit 1
- fi
-fi
-fi
-
-echo "*** Populating $homejail"
-cat <<EOF > /home/bocajail/tmp/populate.sh
-#!/bin/bash
-mount -t proc proc /proc
-
-echo "LC_ALL=en_US.UTF-8" > /etc/default/locale
-echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
-/usr/sbin/locale-gen
-/usr/sbin/update-locale
-apt-get -y update
-apt-get -y install python-software-properties software-properties-common
-add-apt-repository -y ppa:brunoribas/ppa-maratona
-apt-get -y update
-apt-get -y upgrade
-apt-get -y install maratona-linguagens --no-install-recommends --allow-unauthenticated
-apt-get -y clean
-
-umount /proc
-EOF
-mkdir -p /bocajail/usr/bin
-[ -x /usr/bin/safeexec ] && cp -a /usr/bin/safeexec /bocajail/usr/bin/
-cp -f /etc/apt/sources.list $homejail/etc/apt/
-chmod 755 /home/bocajail/tmp/populate.sh
-
-export LC_ALL=en_US.UTF-8
-cd / ; chroot $homejail /tmp/populate.sh
-
-
diff --git a/tools/etc/icpc/doclean.sh b/tools/etc/icpc/doclean.sh
deleted file mode 100755
index 40b49c1..0000000
--- a/tools/etc/icpc/doclean.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-cd /home
-if [ -f /home/icpc/.cleandisk.sh ]; then
-rm -rf /home/icpc
-find /home -user icpc -delete
-if [ -x /usr/bin/makepasswd ]; then
- pass=`echo -n icpc | /usr/bin/makepasswd --clearfrom - --crypt-md5 | cut -d'$' -f2-`
- pass=\$`echo $pass`
- id -u icpc >/dev/null 2>/dev/null
- if [ $? != 0 ]; then
- useradd -d /home/icpc -k /etc/skel -m -p "$pass" -s /bin/bash -g users icpc
- else
- usermod -d /home/icpc -p "$pass" -s /bin/bash -g users icpc
- fi
-fi
-for i in media mnt var opt tmp usr; do
- find /$i -user icpc -delete
-done
-if [ ! -d /home/icpc ]; then
- rm -rf /home/icpc
- rm -rf /home/skel
- cp -ar /etc/skel/ /home
- mv /home/skel /home/icpc
-fi
-chown -R icpc.users /home/icpc
-chmod -R u+rwx /home/icpc
-fi
-cd - >/dev/null
-exit 0
diff --git a/tools/etc/icpc/installboca.sh b/tools/etc/icpc/installboca.sh
deleted file mode 100755
index d796c04..0000000
--- a/tools/etc/icpc/installboca.sh
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/bin/bash
-if [ "`id -u`" != "0" ]; then
- echo "Script must run as root"
-fi
-
-di=`date +%s`
-local=0
-if [ "$1" == "local" ]; then
- local=1
- echo "==========USING LOCAL FILE $2==========="
- if [ ! -r "$2" ]; then
- echo "======NOT FOUND: $2==========="
- exit 1
- else
- echo "USING LOCAL FILE: $2"
- basedir=`dirname "$2"`
- echo $basedir | grep -q '^/' 2> /dev/null
- if [ $? == 0 ]; then
- basenam=`basename "$2" .tgz`
- bocaver=`echo $basenam | cut -d'-' -f2-`
- echo "INSTALLING ON $basedir"
- echo "INSTALLING VERSION $bocaver"
- echo "=========="
- else
- echo "======YOU MUST PROVIDE FULL PATH OF FILE $2====="
- exit 1
- fi
- fi
-else
- echo "==================================================="
- echo "=================== obtaining BOCA ==============="
- echo "==================================================="
-
- wget -O /tmp/.boca.tmp "http://www.ime.usp.br/~cassio/boca/boca.date.txt"
- echo ">>>>>>>>>>"
- echo ">>>>>>>>>> Downloading boca release `cat /tmp/.boca.tmp`"
- echo ">>>>>>>>>>"
-
- if [ "$1" == "" ]; then
- wget -O /tmp/.boca.tmp "http://www.ime.usp.br/~cassio/boca/bocaver.txt"
- bocaver=`cat /tmp/.boca.tmp`
- else
- bocaver=$1
- fi
- basedir=$2
-fi
-
-if [ "$basedir" == "" ]; then
- basedir=/var/www
-fi
-if [ ! -d "$basedir" ]; then
- echo "Directory $2 does not exist"
- exit 1
-fi
-
-OK=y
-read -p "I will install boca at $basedir is it correct (otherwise, run this script as: $0 $bocaver <installdir> to choose the place) [y/n]? " OK
-if [ "$OK" == "y" -o "$OK" == "Y" ]; then
- echo "Install directory is $basedir"
-else
- echo "Aborted"
- exit 1
-fi
-
-if [ "$local" == "0" ]; then
- echo "Looking for BOCA version $bocaver from http://www.ime.usp.br/~cassio/boca/"
- cd $basedir
- rm -f boca-$bocaver.tgz
- wget -O boca-$bocaver.tgz "http://www.ime.usp.br/~cassio/boca/download.php?filename=boca-$bocaver.tgz"
- if [ "$?" != "0" -o ! -f boca-$bocaver.tgz ]; then
- echo "ERROR downloading BOCA package version $bocaver. Aborting *****************"
- exit 1
- fi
- grep -qi "bad parameters" boca-$bocaver.tgz
- if [ "$?" == "0" ]; then
- echo "ERROR downloading BOCA package version $bocaver. Aborting *****************"
- exit 1
- fi
-fi
-
-echo "==========================================================="
-echo "====================== BACKUPING OLD BOCA ==============="
-echo "==========================================================="
-if [ -d boca-$bocaver ]; then
- mv boca-$bocaver boca-$bocaver.$di
- echo "OLD BOCA FOLDER for version $bocaver saved as boca-$bocaver.$di"
-fi
-
-echo "bocadir=$basedir/boca" > /etc/boca.conf
-chmod 644 /etc/boca.conf
-
-echo "====================================================="
-echo "=================== EXTRACTING BOCA ==============="
-echo "====================================================="
-
-OK=x
-conffile=boca/src/private/conf.php
-if [ ! -f $conffile ]; then
-conffile=boca-$bocaver.$di/src/private/conf.php
-fi
-if [ -f $conffile ]; then
- echo "OLD CONFIG FILE EXISTS"
- OK=x
- while [ "$OK" != "y" -a "$OK" != "n" ]; do
- OK=x
- read -p "Do you want to keep the old private/conf.php file [y/n] (note that the old file might be incompatible with this version)? " OK
- done
- if [ "$OK" == "n" ]; then
- echo "You probably need to update the new file boca-$bocaver/src/private/conf.php with the correct passwords - PLEASE CHECK IT - NOT DONE AUTOMATICALLY"
- fi
-else
- echo "OLD Config file not found -- you must set up the new private/conf.php file properly"
-fi
-
-apacheuser=
-[ -r /etc/icpc/apacheuser ] && apacheuser=`cat /etc/icpc/apacheuser | sed 's/ \t\n//g'`
-[ "$apacheuser" == "" ] && apacheuser=www-data
-id -u $apacheuser >/dev/null 2>/dev/null
-if [ $? != 0 ]; then
- echo "User $apacheuser not found -- error to set permissions with chown/chmod"
- apacheuser=root
-fi
-
-tar xzf boca-$bocaver.tgz
-chown -R root.$apacheuser boca-$bocaver/
-chmod -R g+rx,u+rwx boca-$bocaver/
-
-chmod 600 boca-$bocaver/src/private/*.php
-[ -f boca-$bocaver.$di/src/private/remotescores/otherservers ] && cp -f boca-$bocaver.$di/src/private/remotescores/otherservers boca-$bocaver/src/private/remotescores/otherservers
-if [ "$OK" == "y" ]; then
- cp -f $conffile boca-$bocaver/src/private/conf.php
- [ -f boca-$bocaver.$di/src/private/run-using-command.config ] && cp -f boca-$bocaver.$di/src/private/run-using-command.config boca-$bocaver/src/private/run-using-command.config
-fi
-chmod 700 boca-$bocaver/tools/*.sh
-
-if [ -f boca-$bocaver.$di/src/private/run-past.config ]; then
- cp -f boca-$bocaver.$di/src/private/run-past.config boca-$bocaver/src/private/run-past.config
-else
- echo "`date +%sN`-sha256sum-`date +%sN`" | sha256sum - | cut -d' ' -f1 > boca-$bocaver/src/private/run-past.config
-fi
-chmod 550 boca-$bocaver/src/private/run-past.config
-chown www-data.www-data boca-$bocaver/src/private/run-past.config
-
-cp boca-$bocaver/tools/boca-submit-run* /usr/bin/
-chmod 755 /usr/bin/boca-submit-run*
-chmod 700 /usr/bin/boca-submit-run-cron
-
-cat > /tmp/boca-submit-run-root-wrapper.c <<EOF
-#include<stdlib.h>
-#include<stdio.h>
-#include<sys/types.h>
-#include<unistd.h>
-char str[10000];
-int main(int argc, char **argv) {
- if(argc != 8) return 1;
- sprintf(str,"/usr/bin/boca-submit-run-root %1000s %1000s %1000s %1000s %1000s %1000s %1000s",argv[1],argv[2],argv[3],argv[4],argv[5],argv[6],argv[7]);
- setuid(0);
- system(str);
- return 0;
-}
-EOF
-gcc -o /usr/bin/boca-submit-run-root-wrapper /tmp/boca-submit-run-root-wrapper.c
-rm -f /tmp/boca-submit-run-root-wrapper.c
-chown root.root /usr/bin/boca-submit-run-root-wrapper
-chmod 4555 /usr/bin/boca-submit-run-root-wrapper
-echo "*/2 * * * * root /usr/bin/boca-submit-run-cron >>/var/log/bocacron.out 2>>/var/log/bocacron.err" > /etc/cron.d/boca
-
-cat > boca-$bocaver/src/.htaccess <<EOF
-php_flag output_buffering on
-php_value memory_limit 256M
-php_value post_max_size 128M
-php_flag magic_quotes_gpc off
-php_value upload_max_filesize 128M
-EOF
-chmod 755 boca-$bocaver/src/.htaccess
-cat > boca-$bocaver/tools/.htaccess <<EOF
-Deny from all
-EOF
-chmod 755 boca-$bocaver/tools/.htaccess
-cp boca-$bocaver/tools/.htaccess boca-$bocaver/doc/.htaccess
-cp boca-$bocaver/tools/.htaccess boca-$bocaver/old/.htaccess
-cp boca-$bocaver/tools/.htaccess boca-$bocaver/src/private/.htaccess
-
-chmod -R 770 boca-$bocaver/src/private
-chmod -R 775 boca-$bocaver/src/balloons
-
-echo "=========================================================================================="
-echo "=========== SETTING UP SOME LINKS (main apache server index.html updated) ==============="
-echo "=========================================================================================="
-
-rm -f $basedir/boca /usr/bin/makebkp.sh
-ln -s $basedir/boca-$bocaver $basedir/boca
-ln -s $basedir/boca/tools/makebkp.sh /usr/bin/makebkp.sh
-chmod 755 $basedir/boca/tools/makebkp.sh
-chmod 755 $basedir/boca/tools/singlefilebkp.sh
-
-echo "=============================================================="
-echo "================== COMPILING safeexec utility ==============="
-echo "=============================================================="
-
-cd $basedir/boca/tools
-gcc -static -O2 -Wall safeexec.c -o safeexec
-if [ $? == 0 ]; then
- echo "COMPILATION OK"
-fi
-strip safeexec
-cp -f safeexec /usr/bin
-chmod 4555 /usr/bin/safeexec
-[ -d /bocajail/usr/bin ] && cp -a /usr/bin/safeexec /bocajail/usr/bin/
-
-if [ -f /etc/icpc/installboca.sh ]; then
- cp $basedir/boca/tools/etc/icpc/installboca.sh /etc/icpc/installboca.sh
- chmod 700 /etc/icpc/installboca.sh
-fi
-
-echo "=================================================="
-echo "=================== SERVER SETUP ==============="
-echo "=================================================="
-ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini 2>/dev/null
-ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/cli/conf.d/20-mcrypt.ini 2>/dev/null
-
-OK=n
-echo "You can run at anytime later the script /etc/icpc/becomeserver.sh to prepare the computer to be the BOCA server"
-read -p "Do you want me to call the script to make this computer the server (don't do it if this install is for a team or autojudge) [y/N]? " OK
-if [ "$OK" == "y" -o "$OK" == "Y" ]; then
- OK=n
- read -p "Do you really want to make this computer the server? (DONT DO IT if you are only upgrading BOCA) [y/N]? " OK
- if [ "$OK" == "y" -o "$OK" == "Y" ]; then
- /etc/icpc/becomeserver.sh
- fi
-fi
-
-cat > /etc/apache2/conf.d/boca <<EOF
-<Directory $basedir/boca/src>
- AllowOverride Options AuthConfig Limit
- Order Allow,Deny
- Allow from all
- AddDefaultCharset utf-8
-</Directory>
-<Directory $basedir/boca/src/private>
- AllowOverride Options AuthConfig Limit
- Deny from all
-</Directory>
-<Directory $basedir/boca>
- AllowOverride Options AuthConfig Limit
- Deny from all
-</Directory>
-Alias /boca $basedir/boca/src
-EOF
-
-ln -s /etc/apache2/conf.d/boca /etc/apache2/conf-enabled/boca.conf 2>/dev/null
diff --git a/tools/etc/icpc/restart.sh b/tools/etc/icpc/restart.sh
deleted file mode 100755
index 8c6c98c..0000000
--- a/tools/etc/icpc/restart.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-uid=`id -u`
-if [ "$uid" != "0" ]; then
- echo "Must be root to run this script. Use sudo /bin/bash first"
- exit 1
-fi
-
-apt-get clean
-if [ -f /etc/icpc/postgresql.version ]; then
- . /etc/icpc/postgresql.version
-else
-POSTGRESV=""
-if [ ! -f /etc/init.d/postgresql ]; then
- POSTGRESV="-8.4"
-fi
-fi
-
-pass=\$`echo -n icpc | makepasswd --clearfrom - --crypt-md5 | cut -d'$' -f2-`
-usermod -p "$pass" icpc
-
-rm -f /etc/icpc/.isserver
-rm -f /etc/icpc/.firsttimedone
-rm -f /etc/icpc/bocaserver.sh
-/etc/icpc/cleandisk.sh
-/etc/init.d/apache2 stop
-/etc/init.d/postgresql$POSTGRESV stop
-rm -f /var/log/apache2/*
-rm -f /var/log/postgresql/*
-update-rc.d -f apache2 remove
-update-rc.d -f postgresql$POSTGRESV remove
-
diff --git a/tools/etc/icpc/setup.sh b/tools/etc/icpc/setup.sh
deleted file mode 100755
index 62563e1..0000000
--- a/tools/etc/icpc/setup.sh
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/bash
-
-if [ ! -x /etc/icpc/bocaserver.sh ]; then
- OK=1
- while [ "$OK" != "0" ]; do
- IP=`zenity --title="Setting up the BOCA server IP number" --text="Enter the IP address of the server (format x.y.w.z)\n\
-If this is supposed to be the server, then leave it empty\nIf there are multiple servers, separate IPs by a semi-colon ;" --entry`
- [ "$IP" == "" ] && IP=LOCAL
- zenity --title="IP confirmation" --text="The chosen IP is $IP\nDo you confirm?" --question
- OK=$?
- done
- if [ "$IP" = "local" -o "$IP" = "LOCAL" ]; then
- IP=127.0.0.1
- BOCASERVER=0/0
- fi
- FIRSTBOCA=`echo $IP | cut -d';' -f1`
- echo "BOCASERVER=$FIRSTBOCA" > /etc/icpc/bocaserver.sh
- echo $IP | grep -q ';'
- if [ "$?" == "0" ]; then
- echo "BOCASERVERS=`echo $IP | cut -d';' -f2-`" >> /etc/icpc/bocaserver.sh
- fi
- echo "$FIRSTBOCA boca boca" >> /etc/hosts
- chmod 755 /etc/icpc/bocaserver.sh
-fi
-. /etc/icpc/bocaserver.sh
-
-if [ ! -f /etc/icpc/.firsttimedone ]; then
-
- zenity --title="PAY ATTENTION TO THE FOLLOWING:" \
- --text="It is HIGHLY recommended that you set up a super-user password NOW. Set up the super-user password now?" --question
- OK=$?
- if [ "$OK" == "0" ]; then
- id -u icpcadmin 2>\dev\null >\dev\null
- if [ "$?" == "0" ]; then
- OK=1
- while [ $OK != 0 ]; do
- pass=`zenity --title="Setting up a icpcadmin password" --text="Take care \
- to keep it safe. icpcadmin is the user that \n\
- can become root using the command sudo, e.g. \n\
- sudo /bin/bash \n\
- TEAMS WILL USE THE ACCOUNT icpc, WITH PASSWORD\n\
- icpc. THEY MUST NOT KNOW THE PASSWORD YOU\n\
- ARE SETTING UP HERE, WHICH IS A PRIVILEGIED USER.\n\
- If you need to change the password later, you \n\
- must know the current password and use the \n\
- command-line passwd to change it. Do not forget it" --entry --hide-text`
- pass2=`zenity --title="Setting up a icpcadmin password" --text="Re-type it" --entry --hide-text`
- if [ "$pass" == "$pass2" -a "$pass" != "" ]; then
- OK=0
- else
- zenity --info --title="Error" --text="Passwords do not match"
- fi
- done
- pass=\$`/bin/echo -n "$pass2" | /usr/bin/makepasswd --clearfrom - --crypt-md5 | /usr/bin/cut -d'$' -f2-`
- pass2=""
- /usr/sbin/usermod -p "$pass" icpcadmin
- pass=`echo -n icpc | makepasswd --clearfrom - --crypt-md5 | cut -d'$' -f2-`
- pass=\$`echo $pass`
- /usr/sbin/usermod -p "$pass" icpc
- zenity --info --title="Updated" --text="Password of icpcadmin should be updated\nIf not, login in and change it to something safe"
- else
- zenity --info --title="Update error" --text="User icpcadmin not found -- update your password by yourself."
- fi
- fi
-
- if [ "$BOCASERVER" != "0/0" ]; then
- OK=1
- while [ $OK != 0 ]; do
- pass=`zenity --title="Setting up password of BOCA database" --text="Enter the password of the BOCA database IF AND ONLY IF \n\
-this is NOT a team machine. The password must be entered \n\
-in case this machine will be used for autojudging. \n\
-If you do not enter a password now, it is possible to do \n\
-it later using the command-line /etc/icpc/updatedbpass.sh \n\
-IF THIS IS GOING TO BE USED BY A TEAM, THEN JUST \n\
-PRESS ENTER WITHOUT TYPING ANY PASSWORD\n\
-If this is a server, you may also leave this field empty" --entry --hide-text`
- if [ "$pass" == "" ]; then
- break
- fi
- pass2=`zenity --title="Setting up password of BOCA database" --text="Re-type it" --entry --hide-text`
- if [ "$pass" == "$pass2" -a "$pass" != "" ]; then
- OK=0
- /etc/icpc/updatedbpass.sh "$pass"
- else
- zenity --info --title="Error" --text="Passwords do not match"
- fi
- done
- fi
- touch /etc/icpc/.firsttimedone
- zenity --info --title="Setup completed" --text="The setup is completed. If you want to do it again, you might \n\
-run the command-line /etc/icpc/restart.sh\nbut some files in this computer (e.g. from the icpc user) might be lost."
-fi
-
-if [ -x /etc/network/if-pre-up.d/boca ]; then
- . /etc/network/if-pre-up.d/boca
-fi
-
-exit 0
diff --git a/tools/etc/icpc/update.sh b/tools/etc/icpc/update.sh
deleted file mode 100755
index 78a87bb..0000000
--- a/tools/etc/icpc/update.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-if [ "`id -u`" != "0" ]; then
- echo "Script must run as root"
-fi
-if [ "$1" == "" ]; then
- wget -O /tmp/update.sh "http://www.ime.usp.br/~cassio/boca/download.php?filename=update.sh"
-else
- wget -O /tmp/update.sh "http://www.ime.usp.br/~cassio/boca/download.php?filename=update.$1.sh"
-fi
-chmod 700 /tmp/update.sh 2>/dev/null
-if [ $? != 0 ]; then
- echo "ERROR DOWNLOADING UPDATE"
- exit 1
-fi
-echo ">>>>>>>>>>"
-echo ">>>>>>>>>> Running update script"
-echo ">>>>>>>>>>"
-/tmp/update.sh
-rm -f /tmp/update.sh
-exit $?
diff --git a/tools/etc/icpc/updatedbpass.sh b/tools/etc/icpc/updatedbpass.sh
deleted file mode 100755
index a33be16..0000000
--- a/tools/etc/icpc/updatedbpass.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-# ////////////////////////////////////////////////////////////////////////////////
-# //BOCA Online Contest Administrator
-# // Copyright (C) 2003-2012 by BOCA Development Team (bocasystem@gmail.com)
-# //
-# // This program is free software: you can redistribute it and/or modify
-# // it under the terms of the GNU General Public License as published by
-# // the Free Software Foundation, either version 3 of the License, or
-# // (at your option) any later version.
-# //
-# // This program is distributed in the hope that it will be useful,
-# // but WITHOUT ANY WARRANTY; without even the implied warranty of
-# // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# // GNU General Public License for more details.
-# // You should have received a copy of the GNU General Public License
-# // along with this program. If not, see <http://www.gnu.org/licenses/>.
-# ////////////////////////////////////////////////////////////////////////////////
-# // Last modified 05/aug/2012 by cassio@ime.usp.br
-privatedir=/var/www/boca/src/private
-
-if [ ! -d $privatedir ]; then
- echo "Could not find directory $privatedir"
- exit 1
-fi
-for i in id chown chmod awk grep cat sed mv; do
- p=`which $i`
- if [ -x "$p" ]; then
- echo -n ""
- else
- echo command "$i" not found
- exit 1
- fi
-done
-if [ "`id -u`" != "0" ]; then
- echo "Script must run as root"
-fi
-
-apacheuser=
-[ -r /etc/icpc/apacheuser ] && apacheuser=`cat /etc/icpc/apacheuser | sed 's/ \t\n//g'`
-[ "$apacheuser" == "" ] && apacheuser=www-data
-id -u $apacheuser >/dev/null 2>/dev/null
-[ $? != 0 ] && echo "User $apacheuser not found -- error to set permissions with chown/chmod"
-
-BOCASERVER=localhost
-[ -x /etc/icpc/bocaserver.sh ] && . /etc/icpc/bocaserver.sh
-if [ "$BOCASERVER" = "0/0" -o "$BOCASERVER" = "" ]; then
- BOCASERVER=localhost
-fi
-echo "BOCA server is configured to be $BOCASERVER"
-if [ "$1" == "" ]; then
- read -p "DB password: " -s PASS
-else
- zenity --info --title="Server info" --text="BOCA server is configured to be $BOCASERVER"
- PASS=$1
-fi
-PASSK=`makepasswd --chars 20`
-awk -v boca="$BOCASERVER" -v pass="$PASS" -v passk="$PASSK" '{ if(index($0,"[\"dbpass\"]")>0) \
- print "$conf[\"dbpass\"]=\"" pass "\";"; \
- else if(index($0,"[\"dbhost\"]")>0) print "$conf[\"dbhost\"]=\"" boca "\";"; \
- else if(index($0,"[\"dbsuperpass\"]")>0) print "$conf[\"dbsuperpass\"]=\"" pass "\";"; \
- else if(index($0,"[\"key\"]")>0) print "$conf[\"key\"]=\"" passk "\";"; else print $0; }' \
- < $privatedir/conf.php > $privatedir/conf.php1
-mv -f $privatedir/conf.php1 $privatedir/conf.php
-echo "Deny from all" > $privatedir/.htaccess
-chown -R $apacheuser.root $privatedir
-chmod -R u+rw,g+rw,o-rw $privatedir
-echo "passwords updated in $privatedir/conf.php"
-
-postgresuser=postgres
-id -u $postgresuser >/dev/null 2>/dev/null
-if [ $? == 0 -a "$BOCASERVER" == "localhost" ]; then
- echo "trying to update password for user bocauser in the database";
- rm -f /tmp/.boca.tmp
- su - $postgresuser -c "echo select contestnumber from contesttable | psql -d bocadb | grep contestnumber >/tmp/.boca.tmp 2>/tmp/.boca.tmp"
- su - $postgresuser -c "echo drop user bocauser | psql -d template1 >/dev/null 2>/dev/null"
- su - $postgresuser -c "echo create user bocauser createdb password \'$PASS\' | psql -d template1 2>/dev/null"
- su - $postgresuser -c "echo alter user bocauser createdb password \'$PASS\' | psql -d template1"
- su - $postgresuser -c "echo alter user postgres password \'$PASS\' | psql -d template1"
- rm -f /tmp/.boca.tmp
-fi
-
-
-if [ "$1" != "" ]; then
- zenity --info --title="Updated" --text="Password updated in $privatedir/conf.php file"
-fi
diff --git a/tools/etc/network/if-pre-up.d/boca b/tools/etc/network/if-pre-up.d/boca
deleted file mode 100644
index 20ff38f..0000000
--- a/tools/etc/network/if-pre-up.d/boca
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-if [ ! -f /etc/icpc/.isserver ]; then
-if [ -x /etc/icpc/bocaserver.sh ]; then
- . /etc/icpc/bocaserver.sh
-fi
-/sbin/iptables -F INPUT
-/sbin/iptables -A INPUT -i lo -j ACCEPT
-/sbin/iptables -A INPUT -s 143.107.255.15 -j ACCEPT
-
-# just to make things easier, let's allow communication to/from BOCA servers
-/sbin/iptables -A INPUT -s 45.33.30.235 -j ACCEPT
-/sbin/iptables -A INPUT -s 50.116.19.221 -j ACCEPT
-
-if [ "$BOCASERVER" != "" ]; then
- /sbin/iptables -A INPUT -s $BOCASERVER -j ACCEPT
-fi
-if [ "$BOCASERVERS" != "" ]; then
- for i in `echo $BOCASERVERS | tr ';' ' '`; do
- /sbin/iptables -A INPUT -s $i -j ACCEPT
- done
-fi
-/sbin/iptables -A INPUT -m udp -p udp -s 0/0 --sport 67:68 --dport 67:68 -j ACCEPT
-/sbin/iptables -A INPUT -m udp -p udp -s 0/0 --sport 53 --dport 53 -j ACCEPT
-/sbin/iptables -A INPUT -m tcp -p tcp -s 0/0 --sport 53 --dport 53 -j ACCEPT
-/sbin/iptables -A INPUT -j REJECT
-else
- if [ -x /etc/icpc/bocaserver.iptables ]; then
- . /etc/icpc/bocaserver.iptables
- fi
-fi
diff --git a/tools/etc/network/if-up.d/boca b/tools/etc/network/if-up.d/boca
deleted file mode 100644
index 20ff38f..0000000
--- a/tools/etc/network/if-up.d/boca
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-if [ ! -f /etc/icpc/.isserver ]; then
-if [ -x /etc/icpc/bocaserver.sh ]; then
- . /etc/icpc/bocaserver.sh
-fi
-/sbin/iptables -F INPUT
-/sbin/iptables -A INPUT -i lo -j ACCEPT
-/sbin/iptables -A INPUT -s 143.107.255.15 -j ACCEPT
-
-# just to make things easier, let's allow communication to/from BOCA servers
-/sbin/iptables -A INPUT -s 45.33.30.235 -j ACCEPT
-/sbin/iptables -A INPUT -s 50.116.19.221 -j ACCEPT
-
-if [ "$BOCASERVER" != "" ]; then
- /sbin/iptables -A INPUT -s $BOCASERVER -j ACCEPT
-fi
-if [ "$BOCASERVERS" != "" ]; then
- for i in `echo $BOCASERVERS | tr ';' ' '`; do
- /sbin/iptables -A INPUT -s $i -j ACCEPT
- done
-fi
-/sbin/iptables -A INPUT -m udp -p udp -s 0/0 --sport 67:68 --dport 67:68 -j ACCEPT
-/sbin/iptables -A INPUT -m udp -p udp -s 0/0 --sport 53 --dport 53 -j ACCEPT
-/sbin/iptables -A INPUT -m tcp -p tcp -s 0/0 --sport 53 --dport 53 -j ACCEPT
-/sbin/iptables -A INPUT -j REJECT
-else
- if [ -x /etc/icpc/bocaserver.iptables ]; then
- . /etc/icpc/bocaserver.iptables
- fi
-fi
diff --git a/tools/etc/rc.local b/tools/etc/rc.local
deleted file mode 100755
index d6e943b..0000000
--- a/tools/etc/rc.local
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-#
-# rc.local
-#
-# This script is executed at the end of each multiuser runlevel.
-# Make sure that the script will "exit 0" on success or any other
-# value on error.
-#
-# In order to enable or disable this script just change the execution
-# bits.
-#
-# By default this script does nothing.
-
-if [ -x /etc/icpc/doclean.sh ]; then
- /etc/icpc/doclean.sh
-fi
-
-grep -iq "iface.*eth0" /etc/network/interfaces
-if [ $? != 0 ]; then
- echo "auto eth0" >> /etc/network/interfaces
- echo "iface eth0 inet dhcp" >> /etc/network/interfaces
-fi
-
-grep -q "50.116.19.221.*www.bombonera.org.*www.bombonera.org" /etc/hosts
-if [ $? != 0 ]; then
- echo "50.116.19.221 www.bombonera.org www.bombonera.org" >> /etc/hosts
-fi
-grep -q "143.107.45.22.*www.ime.usp.br.*www.ime.usp.br" /etc/hosts
-if [ $? != 0 ]; then
- echo "143.107.45.22 www.ime.usp.br www.ime.usp.br" >> /etc/hosts
-fi
-
-ntpdate -u 198.60.22.240
-ntpdate -u 104.232.3.3
-exit 0
diff --git a/tools/etc/sysctl.d/10-shmmax.conf b/tools/etc/sysctl.d/10-shmmax.conf
deleted file mode 100644
index b645ff6..0000000
--- a/tools/etc/sysctl.d/10-shmmax.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-kernel.shmmax = 805416960
-kernel.shmall = 196635
diff --git a/tools/etc/sysctl.d/10-vm-swappiness.conf b/tools/etc/sysctl.d/10-vm-swappiness.conf
deleted file mode 100644
index c062945..0000000
--- a/tools/etc/sysctl.d/10-vm-swappiness.conf
+++ /dev/null
@@ -1 +0,0 @@
-vm.swappiness=20
diff --git a/tools/genpackage.sh b/tools/genpackage.sh
deleted file mode 100755
index dd4932f..0000000
--- a/tools/genpackage.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/bash
-# ////////////////////////////////////////////////////////////////////////////////
-# //BOCA Online Contest Administrator
-# // Copyright (C) 2003- by BOCA Development Team (bocasystem@gmail.com)
-# //
-# // This program is free software: you can redistribute it and/or modify
-# // it under the terms of the GNU General Public License as published by
-# // the Free Software Foundation, either version 3 of the License, or
-# // (at your option) any later version.
-# //
-# // This program is distributed in the hope that it will be useful,
-# // but WITHOUT ANY WARRANTY; without even the implied warranty of
-# // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# // GNU General Public License for more details.
-# // You should have received a copy of the GNU General Public License
-# // along with this program. If not, see <http://www.gnu.org/licenses/>.
-# ////////////////////////////////////////////////////////////////////////////////
-# // Last modified 03/sep/2014 by cassio@ime.usp.br
-cdir=`pwd`
-bocadir=$(dirname $cdir)
-basen=`basename $cdir`
-if [ ! -f "$cdir/genpackage.sh" -o "$basen" != "tools" ]; then
- echo "Please run this script from its own directory in tools/ of the BOCA directory"
-else
-if [ "$1" == "" ]; then
- ver=$(basename $(dirname $cdir) | cut -d'-' -f2-)
-else
- ver=$1
-fi
-echo "*** Processing version $ver"
-cd /tmp
-cp -a $bocadir boca-$ver
-rm -rf /tmp/boca-$ver/.git
-rm -f /tmp/boca-$ver/tools/boca-*.tgz
-if [ "$ver" != "" -a -d "boca-$ver" ]; then
-echo "boca-$ver" > boca-$ver/src/version
-echo -e "<?php\n\$BOCAVERSION='boca-$ver';\n\$YEAR='2015';\n?>\n" > boca-$ver/src/versionnum.php
-touch boca-$ver/src/private/runtmp/run0.php boca-$ver/src/private/scoretmp/0.php boca-$ver/src/private/remotescores/0.dat \
- boca-$ver/src/private/remotescores/0.tmp boca-$ver/src/private/problemtmp/problem0.tmp
-rm -f boca-$ver/src/balloons/*.png
-rm -f boca-$ver/src/private/runtmp/run*.php boca-$ver/src/private/scoretmp/*.php boca-$ver/src/private/remotescores/*.dat \
- boca-$ver/src/private/remotescores/*.tmp
-rm -rf boca-$ver/src/private/problemtmp/problem*
-touch boca-$ver/.temp
-rm boca-$ver/.temp `find boca-$ver/ -name "*.orig"`
-touch boca-$ver/.temp
-rm boca-$ver/.temp `find boca-$ver/ -name "*~"`
-touch boca-$ver/.temp
-rm boca-$ver/.temp `find boca-$ver/ -name ".\#*"`
-touch boca-$ver/.temp
-rm boca-$ver/.temp `find boca-$ver/ -name ".DS*"`
-touch boca-$ver/.temp
-rm boca-$ver/.temp `find boca-$ver/ -name "._*"`
-cd boca-$ver/tools/etc
-tar czf ../icpc.etc.tgz *
-cd ../../..
-COPYFILE_DISABLE=1 tar czf $cdir/boca-$ver.tgz boca-$ver/
-rm -rf /tmp/boca-$ver
-echo "*** file generated: $cdir/boca-$ver.tgz"
-else
- echo "*** boca-$ver not found"
-fi
-fi
-cd $cdir
diff --git a/tools/getrunlist.sh b/tools/getrunlist.sh
deleted file mode 100644
index 0592321..0000000
--- a/tools/getrunlist.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/bash
-
-if [ "$2" == "" ]; then
- echo "Usage: getrunlist.sh USER PASSWORD DIR"
- exit 1
-fi
-BOCASERVER=45.33.30.235
-user=$1
-pass=$2
-dir=$3
-if [ "$dir" == "" ]; then
- dir=/root
-fi
-
-for i in uuencode wget tr sha256sum cut; do
- p=`which $i`
- if [ -x "$p" ]; then
- echo -n ""
- else
- echo "$i" not found
- exit 1
- fi
-done
-
-while /bin/true; do
- tt=`date +%s-%N`
-temp=/tmp/.temp.$tt.txt
-md=`wget -t 2 -T 5 -S http://$BOCASERVER/boca/index.php -O /dev/null --save-cookies ${temp}.cookie.txt --keep-session-cookies 2>&1 | grep PHPSESS | tail -n1`
-echo "$md" | grep -q PHPSESS
-if [ "$?" == "0" ]; then
- md=`echo $md | cut -f2 -d'=' | cut -f1 -d';'`
- res=`echo -n $pass | sha256sum - | cut -f1 -d' '`
- res=`echo -n "${res}${md}" | sha256sum - | cut -f1 -d' '`
- wget -t 2 -T 5 "http://$BOCASERVER/boca/index.php?name=${user}&password=${res}" --load-cookies ${temp}.cookie.txt --keep-session-cookies --save-cookies ${temp}.cookie.txt -O $temp 2>/dev/null >/dev/null
- grep -qi incorrect $temp
- if [ $? == 0 ]; then
- echo "$BOCASERVER: User or password incorrect"
- rm -f $temp
- rm -f ${temp}.cookie.txt
- exit 3
- else
- wget -t 2 -T 5 "http://$BOCASERVER/boca/staff/run.php" --load-cookies ${temp}.cookie.txt --keep-session-cookies -O $dir/runlist.$tt.html >/dev/null 2>/dev/null
- rm -f ${temp}.out
- grep -q "Run List" $dir/runlist.$tt.html
- if [ "$?" == "0" ]; then
- echo "FILE $dir/runlist.$tt.html DOWNLOADED"
- else
- echo "ERROR TO DOWNLOAD $dir/runlist.$tt.html"
- fi
- fi
- [ -f "$temp" ] && rm -f "$temp"
- rm -f ${temp}.cookie.txt 2>/dev/null
-else
- echo "COULD NOT REACH THE GLOBAL SERVER"
-fi
-sleep 60
-done
diff --git a/tools/icpc.etc.tgz b/tools/icpc.etc.tgz
deleted file mode 100644
index e58e2b1..0000000
--- a/tools/icpc.etc.tgz
+++ /dev/null
Binary files differ
diff --git a/tools/install_12_04.sh b/tools/install_12_04.sh
deleted file mode 100755
index e7a7474..0000000
--- a/tools/install_12_04.sh
+++ /dev/null
@@ -1,405 +0,0 @@
-#!/bin/bash
-# ////////////////////////////////////////////////////////////////////////////////
-# //BOCA Online Contest Administrator
-# // Copyright (C) 2003-2014 by BOCA Development Team (bocasystem@gmail.com)
-# //
-# // This program is free software: you can redistribute it and/or modify
-# // it under the terms of the GNU General Public License as published by
-# // the Free Software Foundation, either version 3 of the License, or
-# // (at your option) any later version.
-# //
-# // This program is distributed in the hope that it will be useful,
-# // but WITHOUT ANY WARRANTY; without even the implied warranty of
-# // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# // GNU General Public License for more details.
-# // You should have received a copy of the GNU General Public License
-# // along with this program. If not, see <http://www.gnu.org/licenses/>.
-# ////////////////////////////////////////////////////////////////////////////////
-# // modified 30/Oct/2014 by cassio@ime.usp.br
-# // inclusion of extra warning about losing your own files
-# // modified 27/Oct/2014 by cassio@ime.usp.br
-# // inclusion of gcc-4.8 and update to Java 7
-#///////////////////////////////////////////////////////////////////////////////////////////
-echo "#############################################################"
-echo "### installv2.sh of 30/Oct/2014 (A) by cassio@ime.usp.br ###"
-echo "#############################################################"
-
-echo "###"
-echo "####"
-echo "##### NEVER RUN installv2.sh in a computer that is not a FRESH ubuntu (you might lose stuff)"
-echo "####"
-echo "### press control-C to stop now or enter to proceed"
-read lin
-
-if [ "`id -u`" != "0" ]; then
- echo "Must be run as root"
- exit 1
-fi
-
-apt-get -y install python-software-properties 2>/dev/null
-apt-get -y install software-properties-common 2>/dev/null
-#apt-get -y install virtualbox-guest-utils virtualbox-guest-dkms 2>/dev/null
-#apt-get -y install virtualbox-guest-x11 2>/dev/null
-
-for i in id chown chmod cut awk tail grep cat sed mkdir rm mv sleep apt-get add-apt-repository update-alternatives; do
- p=`which $i`
- if [ -x "$p" ]; then
- echo -n ""
- else
- echo command "$i" not found
- exit 1
- fi
-done
-sleep 2
-
-echo "$0" | grep -q "install.*sh"
-if [ $? != 0 ]; then
- echo "Make the install script executable (using chmod) and run it directly, like ./installv2.sh"
-else
-
-if [ "$1" != "alreadydone" ]; then
- echo "It is recommended that you run the commands"
- echo " apt-get update; apt-get upgrade"
- echo "by your own before running this script. If you have already done it,"
- echo "please run the script as"
- echo " ./install.sh alreadydone"
- exit 1
-fi
-
-if [ ! -r /etc/lsb-release ]; then
- echo "File /etc/lsb-release not found. Is this a ubuntu or debian-like distro?"
- exit 1
-fi
-. /etc/lsb-release
-
-echo "============================================================="
-echo "============== DISABLING AUTO-UPDATE POP-UPS ==============="
-echo "============================================================="
-gconftool -s --type bool /apps/update-notifier/auto_launch false
-gsettings set com.ubuntu.update-notifier no-show-notifications true
-sed -i 's/X-GNOME-Autostart-Delay=60/X-GNOME-Autostart-enabled=false/' /etc/xdg/autostart/update-notifier.desktop
-
-echo "============================================================="
-echo "========= UNINSTALLING SOME UNNECESSARY PACKAGES ==========="
-echo "============================================================="
-apt-get -y purge libreoffice-common libreoffice-base-core
-apt-get -y purge bluez thunderbird
-apt-get -y purge unity-lens-shopping
-apt-get -y purge unity-webapps-common
-apt-get -y purge ubuntuone-client python-ubuntuone-client ubuntuone-installer python-ubuntuone-storageprotocol
-
-echo "========= INSTALLING SYSVINIT-UTILS ==========="
-apt-get -y install sysvinit-utils
-if [ $? != 0 ]; then
- apt-get -y install sysvutils
- if [ $? != 0 ]; then
- echo ""
- echo "ERROR running the apt-get -- must check if all needed packages are available"
- exit 1
- fi
-fi
-
-echo "=============================================================="
-echo "============== CHECKING FOR OTHER APT SERVERS ==============="
-echo "=============================================================="
-echo "============== CHECKING FOR canonical.com APT SERVER ========"
-cd
-grep -q "^[^\#]*deb http://archive.canonical.com.* $DISTRIB_CODENAME .*partner" /etc/apt/sources.list
-if [ $? != 0 ]; then
- add-apt-repository "deb http://archive.canonical.com/ubuntu $DISTRIB_CODENAME partner"
-fi
-echo "=============================================================="
-echo "============== ADDING extra rep for C++11 ===================="
-add-apt-repository ppa:ubuntu-toolchain-r/test
-
-apt-get -y update
-apt-get -y upgrade
-
-libCppdev=`apt-cache search libstdc++ | grep "libstdc++6-.*-dev " | sort | tail -n1 | cut -d' ' -f1`
-if [ "$libCppdev" == "" ]; then
- echo "libstdc++6-*-dev not found"
- exit 1
-fi
-libCppdbg=`apt-cache search libstdc++ | grep "libstdc++6-.*-dbg " | sort | tail -n1 | cut -d' ' -f1`
-if [ "$libCppdbg" == "" ]; then
- echo "libstdc++6-*-dbg not found"
- exit 1
-fi
-libCppdoc=`apt-cache search libstdc++ | grep "libstdc++6-.*-doc " | sort | tail -n1 | cut -d' ' -f1`
-if [ "$libCppdoc" == "" ]; then
- echo "libstdc++6-*-doc not found"
- exit 1
-fi
-geanydeb=`apt-cache search geany-plugin-gdb`
-if [ "$geanydeb" == "" ]; then
- geanydeb=debugger
-else
- geanydeb=gdb
-fi
-
-echo "====================================================================="
-echo "================= installing packages needed by BOCA ==============="
-echo "====================================================================="
-
-apt-get -y install zenity apache2 eclipse-pde eclipse-rcp eclipse-platform eclipse-jdt eclipse-cdt eclipse emacs \
- evince g++ gcc gedit scite libstdc++6 makepasswd manpages-dev php5-cli php5-mcrypt openjdk-7-dbg openjdk-7-jdk \
- php5 php5-pgsql postgresql postgresql-client postgresql-contrib quota sharutils default-jdk openjdk-7-doc \
- vim-gnome geany geany-plugin-addons geany-plugins geany-plugin-${geanydeb} default-jre sysstat \
- vim xfce4 $libCppdev $libCppdoc $libCppdbg php5-gd stl-manual gcc-doc debootstrap schroot c++-annotations
-if [ $? != 0 ]; then
- echo ""
- echo "ERROR running the apt-get -- must check if all needed packages are available"
- exit 1
-fi
-apt-get -y install gcc-4.8 g++-4.8
-if [ $? != 0 ]; then
- echo ""
- echo "ERROR running the apt-get for gcc 4.8 -- must check if all needed packages are available"
- exit 1
-fi
-update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
-update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
-
-update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-6-openjdk-*/jre/bin/java 10
-update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-6-openjdk-*/bin/javac 10
-update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/java-6-openjdk-*/bin/javadoc 10
-update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/java-6-openjdk-*/bin/javap 10
-update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/java-6-openjdk-*/bin/javah 10
-
-apt-get -y autoremove
-apt-get -y clean
-
-for i in makepasswd useradd update-rc.d; do
- p=`which $i`
- if [ -x "$p" ]; then
- echo -n ""
- else
- echo command "$i" not found
- exit 1
- fi
-done
-
-
-echo "=================================================================="
-echo "============= creating user icpc with password icpc ============="
-echo "=================================================================="
-
-mkdir -p /etc/skel/Desktop/
-cat <<EOF > /etc/skel/Desktop/javadoc.desktop
-[Desktop Entry]
-Version=1.5.1
-Name=Java API
-Comment=Java API
-Exec=firefox /usr/share/doc/openjdk-7-jre-headless/api/index.html
-Terminal=false
-Type=Application
-EOF
-cat <<EOF > /etc/skel/Desktop/stldoc.desktop
-[Desktop Entry]
-Version=1.5.1
-Name=C++ STL
-Comment=C++ STL
-Exec=firefox /usr/share/doc/stl-manual/html/index.html
-Terminal=false
-Type=Application
-EOF
-cat <<EOF > /etc/skel/Desktop/cppannotations.desktop
-[Desktop Entry]
-Version=1.5.1
-Name=C++ Annotations
-Comment=C++ Annotations
-Exec=firefox /usr/share/doc/c++-annotations/html/index.html
-Terminal=false
-Type=Application
-EOF
-[ -f /usr/share/applications/eclipse.desktop ] && cp /usr/share/applications/eclipse.desktop /etc/skel/Desktop/
-[ -f /usr/share/applications/gedit.desktop ] && cp /usr/share/applications/gedit.desktop /etc/skel/Desktop/
-[ -f /usr/share/applications/emacs23.desktop ] && cp /usr/share/applications/emacs23.desktop /etc/skel/Desktop/
-[ -f /usr/share/applications/emacs24.desktop ] && cp /usr/share/applications/emacs24.desktop /etc/skel/Desktop/
-cp /usr/share/applications/gnome-terminal.desktop /etc/skel/Desktop/
-chmod 755 /etc/skel/Desktop/*.desktop
-
-pass=`echo -n icpc | makepasswd --clearfrom - --crypt-md5 | cut -d'$' -f2-`
-pass=\$`echo $pass`
-id -u icpc >/dev/null 2>/dev/null
-if [ $? != 0 ]; then
- useradd -d /home/icpc -k /etc/skel -m -p "$pass" -s /bin/bash -g users icpc
-else
- usermod -d /home/icpc -p "$pass" -s /bin/bash -g users icpc
- echo "user icpc already exists"
-fi
-
-if [ -f /etc/lightdm/lightdm.conf ]; then
- echo "=============================================================="
- echo "============ disabling guest account on lightdm.conf ========"
- echo "=============================================================="
- grep -q "^[^\#]*allow-guest" /etc/lightdm/lightdm.conf
- if [ $? != 0 ]; then
- echo "allow-guest=false" >> /etc/lightdm/lightdm.conf
- fi
- grep -q "^[^\#]*greeter-hide-users" /etc/lightdm/lightdm.conf
- if [ $? != 0 ]; then
- echo "greeter-hide-users=true" >> /etc/lightdm/lightdm.conf
- fi
-fi
-
-echo "====================================================================================="
-echo "============ updating grub boot loader to make it password protected ==============="
-echo "====================================================================================="
-
-grep -q "^[^\#]*password" /etc/grub.d/40_custom
-if [ $? != 0 ]; then
- echo "updated with new password (if needed, see the password at /etc/grub.d/40_custom)"
- echo -e "set superusers=\"root\"" >> /etc/grub.d/40_custom
- echo -e "password root `makepasswd`" >> /etc/grub.d/40_custom
- chmod go-rw /etc/grub.d/40_custom
- grub-mkconfig > /boot/grub/grub.cfg
- chmod go-rw /boot/grub/grub.cfg
-fi
-echo "grub loader configured with password (if needed, see the password at /etc/grub.d/40_custom)"
-
-echo "=============================================================="
-echo "============= INSTALLING SCRIPTS at /etc/icpc ==============="
-echo "=============================================================="
-mkdir -p /etc/icpc
-chown root.root /etc/icpc
-chmod 755 /etc/icpc
-cat <<EOF > /etc/icpc/installscripts.sh
-#!/bin/bash
-echo "================================================================================"
-echo "========== downloading config files from www.ime.usp.br/~cassio/boca =========="
-echo "================================================================================"
-iptables -F
-wget -O /tmp/.boca.tmp "http://www.ime.usp.br/~cassio/boca/icpc.etc.date.txt"
-echo ">>>>>>>>>>"
-echo ">>>>>>>>>> Downloading scripts release \`cat /tmp/.boca.tmp\`"
-echo ">>>>>>>>>>"
-
-if [ "\$1" == "" ]; then
-wget -O /tmp/.boca.tmp "http://www.ime.usp.br/~cassio/boca/icpc.etc.ver.txt"
-icpcver=\`cat /tmp/.boca.tmp\`
-else
-icpcver=\$1
-fi
-echo "Looking for version \$icpcver from http://www.ime.usp.br/~cassio/boca/"
-
-rm -f /tmp/icpc.etc.tgz
-wget -O /tmp/icpc.etc.tgz "http://www.ime.usp.br/~cassio/boca/download.php?filename=icpc-\$icpcver.etc.tgz"
-if [ "\$?" != "0" -o ! -f /tmp/icpc.etc.tgz ]; then
- echo "ERROR downloading file icpc-\$icpcver.etc.tgz. Aborting *****************"
- exit 1
-fi
-grep -qi "bad parameters" /tmp/icpc.etc.tgz
-if [ "\$?" == "0" ]; then
- echo "ERROR downloading file icpc-\$icpcver.etc.tgz. Aborting *****************"
- exit 1
-fi
-
-cd /etc
-di=\`date +%s\`
-
-echo "=============================================================="
-echo "====================== BACKUPING CONFIG FILES ==============="
-
-for i in \`tar tvzf /tmp/icpc.etc.tgz | awk '{ print \$6; }'\`; do
- if [ -f "\$i" ]; then
- bn=\`basename \$i\`
- dn=\`dirname \$i\`
- mv \$i \$dn/.\$bn.bkp.\$di
- chmod 600 \$dn/.\$bn.bkp.\$di
- fi
-done
-
-echo "=============================================================="
-echo "====================== EXTRACTING CONFIG FILES ==============="
-tar -xkvzf /tmp/icpc.etc.tgz
-for i in \`tar tvzf /tmp/icpc.etc.tgz | awk '{ print \$6; }'\`; do
- chown root.root \$i
- chmod o-w,u+rx \$i
-done
-EOF
-chmod 750 /etc/icpc/installscripts.sh
-/etc/icpc/installscripts.sh $3
-
-service procps start
-
-grep -q "quota" /etc/fstab
-if [ $? != 0 ]; then
- cp -f /etc/fstab /etc/fstab.bkp.$di
- sed "s/relatime/quota,relatime/" < /etc/fstab.bkp.$di > /etc/fstab.bkp.$di.1
- sed "s/errors=remount-ro/quota,errors=remount-ro/" < /etc/fstab.bkp.$di.1 > /etc/fstab
-fi
-
-echo "============================================================"
-echo "===================== SETTING UP USER QUOTA ==============="
-echo "============================================================"
-
-for i in `mount | grep gvfs | cut -d' ' -f3`; do
- umount $i
-done
-
-mount / -o remount
-quotaoff -a 2>/dev/null
-quotacheck -M -a
-quotaon -a
-setquota -u postgres 0 3000000 0 10000 -a
-setquota -u icpc 0 500000 0 10000 -a
-setquota -u nobody 0 500000 0 10000 -a
-setquota -u www-data 0 1500000 0 10000 -a
-
-echo "=============================================================="
-echo "================= UPDATING rc.local symlinks ==============="
-echo "=============================================================="
-
-update-rc.d rc.local defaults
-update-rc.d -f cups remove
-apt-get -y clean
-
-#echo "=============================================================="
-#echo "====================== SETTING UP IPs and PASSWORDs (server config follows) ==============="
-#
-/etc/icpc/restart.sh
-#/etc/icpc/setup.sh
-
-startscript="NOTOK"
-if [ -f /etc/lightdm/lightdm.conf ]; then
- startscript="OK"
- grep -q "^[^\#]*display-setup-script=/etc/icpc/setup.sh" /etc/lightdm/lightdm.conf
- if [ $? != 0 ]; then
- echo "display-setup-script=/etc/icpc/setup.sh" >> /etc/lightdm/lightdm.conf
- fi
-fi
-if [ -d /etc/gdm/Init ]; then
- startscript="OK"
- echo "======================================================================================"
- echo "========== UPDATING /etc/gdm/Init/Default TO PROVIDE CONFIG AT STARTUP ==============="
- echo "======================================================================================"
- echo -e "#!/bin/bash\n[ -x /etc/icpc/setup.sh ] && /etc/icpc/setup.sh\n\n" > /tmp/.boca.tmp
- cat /etc/gdm/Init/Default >> /tmp/.boca.tmp
- mv /tmp/.boca.tmp /etc/gdm/Init/Default
- chmod 755 /etc/gdm/Init/Default
-fi
-if [ "$startscript" != "OK" ]; then
- echo "************ STARTUP CALL OF SCRIPTS NOT CONFIGURED **************"
- echo "****** neither /etc/gdm/Init nor /etc/lightdm/lightdm.conf were found ************"
-fi
-
-if [ -f /etc/icpc/createbocajail.sh ]; then
- chmod 750 /etc/icpc/createbocajail.sh
- if [ "$2" != "notbuildjail" ]; then
- /etc/icpc/createbocajail.sh
- fi
-else
- echo "************** SCRIPT TO CREATE BOCAJAIL NOT FOUND -- SOMETHING LOOKS WRONG ***************"
-fi
-
-# BOCA CONFIG
-if [ -f /etc/icpc/installboca.sh ]; then
- chmod 750 /etc/icpc/installboca.sh
- /sbin/iptables -F
- /etc/icpc/installboca.sh "$3" "$4"
-else
- echo "************* SCRIPT TO INSTALL BOCA NOT FOUND -- SOMETHING IS WRONG -- I CANT INSTALL BOCA **************"
-fi
-
-fi
diff --git a/tools/installv2.sh b/tools/installv2.sh
deleted file mode 100755
index 5b756da..0000000
--- a/tools/installv2.sh
+++ /dev/null
@@ -1,373 +0,0 @@
-#!/bin/bash
-# ////////////////////////////////////////////////////////////////////////////////
-# //BOCA Online Contest Administrator
-# // Copyright (C) 2003-2014 by BOCA Development Team (bocasystem@gmail.com)
-# //
-# // This program is free software: you can redistribute it and/or modify
-# // it under the terms of the GNU General Public License as published by
-# // the Free Software Foundation, either version 3 of the License, or
-# // (at your option) any later version.
-# //
-# // This program is distributed in the hope that it will be useful,
-# // but WITHOUT ANY WARRANTY; without even the implied warranty of
-# // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# // GNU General Public License for more details.
-# // You should have received a copy of the GNU General Public License
-# // along with this program. If not, see <http://www.gnu.org/licenses/>.
-# ////////////////////////////////////////////////////////////////////////////////
-# // Last modified 26/Aug/2015 by cassio@ime.usp.br
-#///////////////////////////////////////////////////////////////////////////////////////////
-echo "#############################################################"
-echo "### $0 by cassio@ime.usp.br for Ubuntu 14.04.3 ###"
-echo "#############################################################"
-
-if [ "`id -u`" != "0" ]; then
- echo "Must be run as root"
- exit 1
-fi
-
-## REMOVE NOTIFICATIONS
-# killall update-notifier
-# if [ ! -f /usr/bin/update-notifier.orig ]; then
-# mv /usr/bin/update-notifier /usr/bin/update-notifier.orig
-# fi
-# echo "#!/bin/bash" >/usr/bin/update-notifier
-# find /usr/lib -name notify-osd | xargs chmod -x
-# killall notify-osd 2>/dev/null
-apt-get -y install python-software-properties 2>/dev/null
-
-for i in id chown chmod cut awk tail grep cat sed mkdir rm mv sleep apt-get add-apt-repository update-alternatives; do
- p=`which $i`
- if [ -x "$p" ]; then
- echo -n ""
- else
- echo command "$i" not found
- exit 1
- fi
-done
-sleep 2
-
-echo "$0" | grep -q "install.*sh"
-if [ $? != 0 ]; then
- echo "Make the install script executable (using chmod) and run it directly, like ./install.sh"
-else
-
-if [ "$1" != "alreadydone" ]; then
- echo "It is recommended that you run the commands"
- echo " apt-get update; apt-get upgrade"
- echo "by your own before running this script. If you have already done it,"
- echo "please run the script as"
- echo " ./install.sh alreadydone"
- exit 1
-fi
-
-if [ ! -r /etc/lsb-release ]; then
- echo "File /etc/lsb-release not found. Is this a ubuntu or debian-like distro?"
- exit 1
-fi
-. /etc/lsb-release
-
-echo "============================================================="
-echo "========= UNINSTALLING SOME UNNECESSARY PACKAGES ==========="
-echo "============================================================="
-apt-get -y purge libreoffice-common libreoffice-base-core
-apt-get -y purge thunderbird
-apt-get -y purge unity-lens-shopping
-apt-get -y purge unity-webapps-common
-apt-get -y install sysvinit-utils
-gsettings set com.canonical.Unity.Lenses disabled-scopes "['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope', 'more_suggestions-populartracks.scope', 'music-musicstore.scope', 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope', 'more_suggestions-skimlinks.scope']" >/dev/null 2>&1
-apt-get -y autoremove
-
-echo "=============================================================="
-echo "============== CHECKING FOR OTHER APT SERVERS ==============="
-echo "=============================================================="
-echo "============== CHECKING FOR canonical.com APT SERVER ========"
-cd
-grep -q "^[^\#]*deb http://archive.canonical.com.* $DISTRIB_CODENAME .*partner" /etc/apt/sources.list
-if [ $? != 0 ]; then
- add-apt-repository "deb http://archive.canonical.com/ubuntu $DISTRIB_CODENAME partner"
-fi
-apt-add-repository -y ppa:webupd8team/sublime-text-3
-
-apt-get -y update
-apt-get -y upgrade
-
-libCppdev=`apt-cache search libstdc++ | grep "libstdc++6-.*-dev " | sort | tail -n1 | cut -d' ' -f1`
-if [ "$libCppdev" == "" ]; then
- echo "libstdc++6-*-dev not found"
- exit 1
-fi
-libCppdbg=`apt-cache search libstdc++ | grep "libstdc++6-.*-dbg " | sort | tail -n1 | cut -d' ' -f1`
-if [ "$libCppdbg" == "" ]; then
- echo "libstdc++6-*-dbg not found"
- exit 1
-fi
-libCppdoc=`apt-cache search libstdc++ | grep "libstdc++6-.*-doc " | sort | tail -n1 | cut -d' ' -f1`
-if [ "$libCppdoc" == "" ]; then
- echo "libstdc++6-*-doc not found"
- exit 1
-fi
-
-echo "====================================================================="
-echo "================= installing packages needed by BOCA ==============="
-echo "====================================================================="
-
-apt-get -y install zenity apache2 eclipse-pde eclipse-rcp eclipse-platform eclipse-jdt eclipse-cdt eclipse emacs \
- evince g++ gcc gedit scite libstdc++6 makepasswd manpages-dev php5-cli php5-mcrypt openjdk-7-dbg openjdk-7-jdk \
- php5 php5-pgsql postgresql postgresql-client postgresql-contrib quota sharutils default-jdk openjdk-7-doc \
- vim-gnome geany geany-plugin-addons geany-plugins geany-plugin-debugger default-jre sysstat \
- vim xfce4 $libCppdev $libCppdoc $libCppdbg php5-gd stl-manual gcc-doc debootstrap schroot c++-annotations \
- sublime-text-installer libgnomekbd-common
-if [ $? != 0 ]; then
- echo ""
- echo "ERROR running the apt-get -- must check if all needed packages are available"
- exit 1
-fi
-apt-get -y autoremove
-apt-get -y clean
-
-for i in makepasswd useradd update-rc.d; do
- p=`which $i`
- if [ -x "$p" ]; then
- echo -n ""
- else
- echo command "$i" not found
- exit 1
- fi
-done
-
-
-echo "=================================================================="
-echo "============= creating user icpc with password icpc ============="
-echo "=================================================================="
-
-mkdir -p /etc/skel/Desktop/
-cat <<EOF > /etc/skel/Desktop/javadoc.desktop
-[Desktop Entry]
-Version=1
-Name=Java API
-Comment=Java API
-Exec=firefox /usr/share/doc/openjdk-7-jre-headless/api/index.html
-Terminal=false
-Type=Application
-EOF
-cat <<EOF > /etc/skel/Desktop/stldoc.desktop
-[Desktop Entry]
-Version=1
-Name=C++ STL
-Comment=C++ STL
-Exec=firefox /usr/share/doc/stl-manual/html/index.html
-Terminal=false
-Type=Application
-EOF
-cat <<EOF > /etc/skel/Desktop/cppannotations.desktop
-[Desktop Entry]
-Version=1
-Name=C++ Annotations
-Comment=C++ Annotations
-Exec=firefox /usr/share/doc/c++-annotations/html/index.html
-Terminal=false
-Type=Application
-EOF
-[ -f /usr/share/applications/eclipse.desktop ] && cp /usr/share/applications/eclipse.desktop /etc/skel/Desktop/
-[ -f /usr/share/applications/gedit.desktop ] && cp /usr/share/applications/gedit.desktop /etc/skel/Desktop/
-[ -f /usr/share/applications/emacs23.desktop ] && cp /usr/share/applications/emacs23.desktop /etc/skel/Desktop/
-[ -f /usr/share/applications/emacs24.desktop ] && cp /usr/share/applications/emacs24.desktop /etc/skel/Desktop/
-cp /usr/share/applications/gnome-terminal.desktop /etc/skel/Desktop/
-chmod 755 /etc/skel/Desktop/*.desktop
-
-if [ "`which gconftool`" != "" ]; then
- su - icpcadmin -c "gconftool -s -t bool /apps/update-notifier/auto_launch false"
- su - icpc -c "gconftool -s -t bool /apps/update-notifier/auto_launch false"
-fi
-
-grep -q icpcadmin /etc/ssh/sshd_config
-if [ "$?" != "0" ]; then
- echo "DenyUsers icpc icpcadmin" >> /etc/ssh/sshd_config
- ps auxw |grep sshd|grep -vq grep
- if [ "$?" == "0" ]; then
- service ssh reload
- fi
-fi
-
-pass=`echo -n icpc | makepasswd --clearfrom - --crypt-md5 | cut -d'$' -f2-`
-pass=\$`echo $pass`
-id -u icpc >/dev/null 2>/dev/null
-if [ $? != 0 ]; then
- useradd -d /home/icpc -k /etc/skel -m -p "$pass" -s /bin/bash -g users icpc
-else
- usermod -d /home/icpc -p "$pass" -s /bin/bash -g users icpc
- echo "user icpc already exists"
-fi
-
-lightdmfile=/etc/lightdm/lightdm.conf
-if [ -d "`dirname $lightdmfile`" ]; then
- echo "=============================================================="
- echo "====== disabling guest account on lightdm ========"
- echo "=============================================================="
- echo -e "[SeatDefaults]\n" > $lightdmfile
- echo -e "allow-guest=false\ngreeter-hide-users=true\ngreeter-show-remote-login=false\ngreeter-show-manual-login=true\n" >> $lightdmfile
-fi
-
-# echo "====================================================================================="
-# echo "============ updating grub boot loader to make it password protected ==============="
-# echo "====================================================================================="
-
-# grep -q "^[^\#]*password" /etc/grub.d/40_custom
-# if [ $? != 0 ]; then
-# echo "updated with new password (if needed, see the password at /etc/grub.d/40_custom)"
-# echo -e "set superusers=\"root\"" >> /etc/grub.d/40_custom
-# echo -e "password root `makepasswd`" >> /etc/grub.d/40_custom
-# chmod go-rw /etc/grub.d/40_custom
-# grub-mkconfig > /boot/grub/grub.cfg
-# chmod go-rw /boot/grub/grub.cfg
-# fi
-# echo "grub loader configured with password (if needed, see the password at /etc/grub.d/40_custom)"
-
-
-
-echo "=============================================================="
-echo "============= INSTALLING SCRIPTS at /etc/icpc ==============="
-echo "=============================================================="
-mkdir -p /etc/icpc
-chown root.root /etc/icpc
-chmod 755 /etc/icpc
-cat <<EOF > /etc/icpc/installscripts.sh
-#!/bin/bash
-echo "================================================================================"
-echo "========== downloading config files from www.ime.usp.br/~cassio/boca =========="
-echo "================================================================================"
-iptables -F
-wget -O /tmp/.boca.tmp "http://www.ime.usp.br/~cassio/boca/icpc.etc.date.txt"
-echo ">>>>>>>>>>"
-echo ">>>>>>>>>> Downloading scripts release \`cat /tmp/.boca.tmp\`"
-echo ">>>>>>>>>>"
-
-if [ "\$1" == "" ]; then
-wget -O /tmp/.boca.tmp "http://www.ime.usp.br/~cassio/boca/icpc.etc.ver.txt"
-icpcver=\`cat /tmp/.boca.tmp\`
-else
-icpcver=\$1
-fi
-echo "Looking for version \$icpcver from http://www.ime.usp.br/~cassio/boca/"
-
-rm -f /tmp/icpc.etc.tgz
-wget -O /tmp/icpc.etc.tgz "http://www.ime.usp.br/~cassio/boca/download.php?filename=icpc-\$icpcver.etc.tgz"
-if [ "\$?" != "0" -o ! -f /tmp/icpc.etc.tgz ]; then
- echo "ERROR downloading file icpc-\$icpcver.etc.tgz. Aborting *****************"
- exit 1
-fi
-grep -qi "bad parameters" /tmp/icpc.etc.tgz
-if [ "\$?" == "0" ]; then
- echo "ERROR downloading file icpc-\$icpcver.etc.tgz. Aborting *****************"
- exit 1
-fi
-
-cd /etc
-di=\`date +%s\`
-
-echo "=============================================================="
-echo "====================== BACKUPING CONFIG FILES ==============="
-
-for i in \`tar tvzf /tmp/icpc.etc.tgz | awk '{ print \$6; }'\`; do
- if [ -f "\$i" ]; then
- bn=\`basename \$i\`
- dn=\`dirname \$i\`
- mv \$i \$dn/.\$bn.bkp.\$di
- chmod 600 \$dn/.\$bn.bkp.\$di
- fi
-done
-
-echo "=============================================================="
-echo "====================== EXTRACTING CONFIG FILES ==============="
-tar -xkvzf /tmp/icpc.etc.tgz
-for i in \`tar tvzf /tmp/icpc.etc.tgz | awk '{ print \$6; }'\`; do
- chown root.root \$i
- chmod o-w,u+rx \$i
-done
-EOF
-chmod 750 /etc/icpc/installscripts.sh
-/etc/icpc/installscripts.sh $3
-
-service procps start
-
-grep -q "quota" /etc/fstab
-if [ $? != 0 ]; then
- cp -f /etc/fstab /etc/fstab.bkp.$di
- sed "s/relatime/quota,relatime/" < /etc/fstab.bkp.$di > /etc/fstab.bkp.$di.1
- sed "s/errors=remount-ro/quota,errors=remount-ro/" < /etc/fstab.bkp.$di.1 > /etc/fstab
-fi
-
-echo "============================================================"
-echo "===================== SETTING UP USER QUOTA ==============="
-echo "============================================================"
-
-for i in `mount | grep gvfs | cut -d' ' -f3`; do
- umount $i
-done
-
-mount / -o remount
-quotaoff -a 2>/dev/null
-quotacheck -M -a
-quotaon -a
-setquota -u postgres 0 3000000 0 10000 -a
-setquota -u icpc 0 500000 0 10000 -a
-setquota -u nobody 0 500000 0 10000 -a
-setquota -u www-data 0 1500000 0 10000 -a
-
-echo "=============================================================="
-echo "================= UPDATING rc.local symlinks ==============="
-echo "=============================================================="
-
-#update-rc.d rc.local defaults
-update-rc.d -f cups remove
-apt-get -y clean
-
-#echo "=============================================================="
-#echo "====================== SETTING UP IPs and PASSWORDs (server config follows) ==============="
-#
-/etc/icpc/restart.sh
-#/etc/icpc/setup.sh
-
-startscript="NOTOK"
-if [ -d "`dirname $lightdmfile`" ]; then
- startscript="OK"
- [ -f $lightdmfile ] && grep -q "^[^\#]*greeter-setup-script=/etc/icpc/setup.sh" $lightdmfile
- if [ $? != 0 ]; then
- echo "greeter-setup-script=/etc/icpc/setup.sh" >> $lightdmfile
- fi
-fi
-if [ -d /etc/gdm/Init ]; then
- startscript="OK"
- echo "======================================================================================"
- echo "========== UPDATING /etc/gdm/Init/Default TO PROVIDE CONFIG AT STARTUP ==============="
- echo "======================================================================================"
- echo -e "#!/bin/bash\n[ -x /etc/icpc/setup.sh ] && /etc/icpc/setup.sh\n\n" > /tmp/.boca.tmp
- cat /etc/gdm/Init/Default >> /tmp/.boca.tmp
- mv /tmp/.boca.tmp /etc/gdm/Init/Default
- chmod 755 /etc/gdm/Init/Default
-fi
-if [ "$startscript" != "OK" ]; then
- echo "************ STARTUP CALL OF SCRIPTS NOT CONFIGURED **************"
- echo "****** neither /etc/gdm/Init nor /etc/lightdm/lightdm.conf were found ************"
-fi
-
-if [ -f /etc/icpc/createbocajail.sh ]; then
- chmod 750 /etc/icpc/createbocajail.sh
- if [ "$2" != "notbuildjail" ]; then
- /etc/icpc/createbocajail.sh
- fi
-else
- echo "************** SCRIPT TO CREATE BOCAJAIL NOT FOUND -- SOMETHING LOOKS WRONG ***************"
-fi
-
-# BOCA CONFIG
-if [ -f /etc/icpc/installboca.sh ]; then
- chmod 750 /etc/icpc/installboca.sh
- /sbin/iptables -F
- /etc/icpc/installboca.sh "$3" "$4"
-else
- echo "************* SCRIPT TO INSTALL BOCA NOT FOUND -- SOMETHING IS WRONG -- I CANT INSTALL BOCA **************"
-fi
-
-fi
diff --git a/tools/sendscore.sh b/tools/sendscore.sh
deleted file mode 100755
index 72393c3..0000000
--- a/tools/sendscore.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-# ////////////////////////////////////////////////////////////////////////////////
-# //BOCA Online Contest Administrator
-# // Copyright (C) 2003-2012 by BOCA Development Team (bocasystem@gmail.com)
-# //
-# // This program is free software: you can redistribute it and/or modify
-# // it under the terms of the GNU General Public License as published by
-# // the Free Software Foundation, either version 3 of the License, or
-# // (at your option) any later version.
-# //
-# // This program is distributed in the hope that it will be useful,
-# // but WITHOUT ANY WARRANTY; without even the implied warranty of
-# // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# // GNU General Public License for more details.
-# // You should have received a copy of the GNU General Public License
-# // along with this program. If not, see <http://www.gnu.org/licenses/>.
-# ////////////////////////////////////////////////////////////////////////////////
-# last modified 22/oct/2012 by cassio@ime.usp.br
-
-if [ "$1" == "" -o "$2" == "" -o "$3" == "" -o "$4" == "" ]; then
- echo "Usage $0 <scorefile> <BOCAaddress> <user> <password> [<PC2site>]"
- echo "e.g. $0 score.dat http://bombonera.ime.usp.br/boca site1 hardpass"
- echo " $0 summary.html http://bombonera.ime.usp.br/boca site1 hardpass 1"
- echo "the last number in the previous line indicates the number of the site, which should be unique among sites"
- exit 1
-fi
-BOCASERVER=$2
-user=$3
-pass=$4
-pc2=0
-if [ "$5" != "" ]; then
-pc2=$5
-fi
-
-for i in wget tr perl shasum cut; do
- p=`which $i`
- if [ -x "$p" ]; then
- echo -n ""
- else
- echo command "$i" not found
- exit 1
- fi
-done
-
-if [ -r "$1" ]; then
-md=`wget -S -T3 -t3 $BOCASERVER/index.php -O /dev/null --save-cookies /tmp/.cookie.txt --keep-session-cookies 2>&1 | grep PHPSESS | tail -n1 | cut -f2 -d'=' | cut -f1 -d';'`
-res=`echo -n $pass | shasum -a 256 - | cut -f1 -d' '`
-res=`echo -n "${res}${md}" | shasum -a 256 - | cut -f1 -d' '`
-wget -T3 -t3 "$BOCASERVER/index.php?name=${user}&password=${res}&action=scoretransfer" --load-cookies /tmp/.cookie.txt --keep-session-cookies --save-cookies /tmp/.cookie.txt -O /tmp/.temp.txt 2>/dev/null >/dev/null
-grep -qi incorrect /tmp/.temp.txt
-if [ $? == 0 ]; then
- echo User or password incorrect
-else
-nom=`echo -n $1 | perl -MURI::Escape -lne 'print uri_escape($_)'`
-echo -n "PC2=${pc2}&name=${nom}&data=" > /tmp/.temp.txt
-if [ "$pc2" != "0" ]; then
- uuencode -m zzzzzzzzzz < "$1" | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> /tmp/.temp.txt
-else
- cat "$1" | perl -MURI::Escape -lne 'print uri_escape($_)' >> /tmp/.temp.txt
-fi
-wget -t3 -T3 "$BOCASERVER/site/putfile.php" --load-cookies /tmp/.cookie.txt --keep-session-cookies -O /tmp/.temp2.txt --post-file=/tmp/.temp.txt >/dev/null 2>/dev/null
-[ -r /tmp/.temp2.txt ] && cat /tmp/.temp2.txt
-rm -f /tmp/.temp2.txt
-fi
-rm -f /tmp/.temp.txt
-rm -f /tmp/.cookie.txt
-else
- echo file $1 not found
-fi
diff --git a/tools/singlefilebkp.sh b/tools/singlefilebkp.sh
index 8f68c41..da7d91d 100755
--- a/tools/singlefilebkp.sh
+++ b/tools/singlefilebkp.sh
@@ -22,14 +22,14 @@ if [ "$1" == "" ]; then
fi
if [ -r "$1" ]; then
-md=`wget -S http://$BOCASERVER/boca/index.php -O /dev/null --save-cookies /tmp/.cookie.txt --keep-session-cookies 2>&1 | grep PHPSESS | tail -n1 | cut -f2 -d'=' | cut -f1 -d';'`
+md=`wget -S https://$BOCASERVER/boca/index.php -O /dev/null --save-cookies /tmp/.cookie.txt --keep-session-cookies 2>&1 | grep PHPSESS | tail -n1 | cut -f2 -d'=' | cut -f1 -d';'`
echo -n "User: "
read user
echo -n "Password: "
read pass
res=`echo -n $pass | md5sum - | cut -f1 -d' '`
res=`echo -n "${res}${md}" | md5sum - | cut -f1 -d' '`
-wget "http://$BOCASERVER/boca/index.php?name=${user}&password=${res}" --load-cookies /tmp/.cookie.txt --keep-session-cookies --save-cookies /tmp/.cookie.txt -O /tmp/.temp.txt 2>/dev/null >/dev/null
+wget "https://$BOCASERVER/boca/index.php?name=${user}&password=${res}" --load-cookies /tmp/.cookie.txt --keep-session-cookies --save-cookies /tmp/.cookie.txt -O /tmp/.temp.txt 2>/dev/null >/dev/null
grep -qi incorrect /tmp/.temp.txt
if [ $? == 0 ]; then
echo User or password incorrect
@@ -37,7 +37,7 @@ else
nom=`echo -n $1 | perl -MURI::Escape -lne 'print uri_escape($_)'`
echo -n "name=${nom}&data=" > /tmp/.temp.txt
uuencode -m zzzzzzzzzz < $1 | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> /tmp/.temp.txt
-wget "http://$BOCASERVER/boca/team/getfile.php" --load-cookies /tmp/.cookie.txt --keep-session-cookies -O /dev/null --post-file=/tmp/.temp.txt >/dev/null 2>/dev/null
+wget "https://$BOCASERVER/boca/team/getfile.php" --load-cookies /tmp/.cookie.txt --keep-session-cookies -O /dev/null --post-file=/tmp/.temp.txt >/dev/null 2>/dev/null
fi
rm -f /tmp/.temp.txt
rm -f /tmp/.cookie.txt
diff --git a/tools/updatescore.sh b/tools/updatescore.sh
deleted file mode 100755
index 546e17f..0000000
--- a/tools/updatescore.sh
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/bin/bash
-# ////////////////////////////////////////////////////////////////////////////////
-# //BOCA Online Contest Administrator
-# // Copyright (C) 2003-2012 by BOCA Development Team (bocasystem@gmail.com)
-# //
-# // This program is free software: you can redistribute it and/or modify
-# // it under the terms of the GNU General Public License as published by
-# // the Free Software Foundation, either version 3 of the License, or
-# // (at your option) any later version.
-# //
-# // This program is distributed in the hope that it will be useful,
-# // but WITHOUT ANY WARRANTY; without even the implied warranty of
-# // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# // GNU General Public License for more details.
-# // You should have received a copy of the GNU General Public License
-# // along with this program. If not, see <http://www.gnu.org/licenses/>.
-# ////////////////////////////////////////////////////////////////////////////////
-# last updated 01/nov/2012 by cassio@ime.usp.br
-if [ "`id -u`" != "0" ]; then
- echo "Must be run as root"
- exit 1
-fi
-bocadir=/var/www/boca
-[ -r /etc/boca.conf ] && . /etc/boca.conf
-
-privatedir=$bocadir/src/private/remotescores
-others=$privatedir/otherservers
-if [ "$1" == "" -o "$2" == "" ]; then
- echo "Usage $0 <remotescorefolder> <serversfile>"
- echo "e.g. $0 $privatedir $others"
- echo "*** When arguments are not given, default values as of the previous line is used"
-fi
-if [ "$1" != "" ]; then
- privatedir=$1
-fi
-if [ "$2" != "" ]; then
- others=$2
-else
- others=$privatedir/otherservers
-fi
-
-for i in id chown chmod md5sum shasum wget tr cut awk tail head grep cat sed sleep; do
- p=`which $i`
- if [ -x "$p" ]; then
- echo -n ""
- else
- echo command "$i" not found
- exit 1
- fi
-done
-if [ "`id -u`" != "0" ]; then
- echo "Script must run as root"
-fi
-
-if [ ! -d $privatedir ]; then
- echo "Could not find directory $privatedir"
- exit 1
-fi
-tempdir=$privatedir/tmp
-mkdir -p $tempdir >/dev/null 2>/dev/null
-if [ ! -d $tempdir ]; then
- echo "Could not create directory $tempdir"
- exit 1
-fi
-httpbocadir=boca
-secs=120
-apacheuser=
-[ -r /etc/icpc/apacheuser ] && apacheuser=`cat /etc/icpc/apacheuser | sed 's/ \t\n//g'`
-[ "$apacheuser" == "" ] && apacheuser=www-data
-id -u $apacheuser > /dev/null 2>/dev/null
-[ $? != 0 ] && echo "User $apacheuser not found -- error to set permissions with chown/chmod"
-
-hash="shasum -a 256 -"
-#hash="md5sum -"
-
-#rm -f $privatedir/score_*.dat
-chown $apacheuser.root $privatedir/score_*.dat
-
-if [ ! -r $others ]; then
- echo "External server list in $others not found"
- exit 1
-fi
-echo "Starting loop to get scores from servers defined in $others"
-while /bin/true; do
- echo "Getting scores..."
- qtd=1
- for BOCASERVER in `grep -v "^[ \t]*\#" $others | awk '{ print $1; }'`; do
- if [ "$BOCASERVER" == "" ]; then
- continue
- fi
- echo $BOCASERVER | grep -q "http"
- [ $? == 0 ] || BOCASERVER=http://$BOCASERVER/boca
-
- user=`grep -v "^[ \t]*\#" $others | head -n$qtd | tail -n1 | awk '{ print $2; }'`
- [ "$user" == "" ] && user=score
- pass=`grep -v "^[ \t]*\#" $others | head -n$qtd | tail -n1 | awk '{ print $2; }'`
- [ "$pass" == "" ] && pass=score
- let "qtd = $qtd + 1"
-
- echo -n "Asking server $BOCASERVER. Authenticating with user '$user'..."
- md=`wget -t3 -T3 -S $BOCASERVER/index.php -O /dev/null --save-cookies $tempdir/.cookie.txt --keep-session-cookies 2>&1 | grep PHPSESS | tail -n1 | cut -f2 -d'=' | cut -f1 -d';'`
- res=`echo -n $pass | $hash | cut -f1 -d' '`
- res=`echo -n "${res}${md}" | $hash | cut -f1 -d' '`
- echo -n "sending password..."
- wget -t3 -T3 "$BOCASERVER/index.php?name=${user}&password=${res}" --load-cookies $tempdir/.cookie.txt --keep-session-cookies --save-cookies $tempdir/.cookie.txt -O $tempdir/.temp.txt 2>/dev/null >/dev/null
- grep -qi incorrect $tempdir/.temp.txt
- if [ "$?" != "0" ]; then
- rm -f $tempdir/*
- echo "downloading scoretable..."
- wget -t3 -T3 "$BOCASERVER/scoretable.php?remote=-42" --load-cookies $tempdir/.cookie.txt --keep-session-cookies --save-cookies $tempdir/.cookie.txt -O $tempdir/score.zip 2>$tempdir/.bocascore.tmp >$tempdir/.bocascore.tmp
- if [ "$?" == "0" ]; then
- unzip -qq $tempdir/score.zip -d $tempdir
- if [ "$?" == "0" ]; then
- for fscore in `ls -d $tempdir/*.dat`; do
- chown $apacheuser.root "$fscore"
- chmod 660 "$fscore"
- bfscore=`basename $fscore`
- hasscore=`echo $bfscore | cut -d'_' -f1`
- if [ "$hasscore" != "score" ]; then
- bfscore=score_$bfscore
- fi
- mv "$fscore" "$privatedir/$bfscore"
- echo "Score downloaded successfully into $privatedir/$bfscore"
- done
- else
- echo "Error: score file from $BOCASERVER is not a valid package"
- fi
- else
- echo "Error getting score file from $BOCASERVER: `cat $tempdir/.bocascore.tmp`"
- fi
- else
- echo "Error authenticating to server $BOCASERVER"
- fi
- rm -f $tempdir/.temp.txt
- rm -f $tempdir/.cookie.txt
- done
-
- echo -n "Waiting $secs secs..."
- sleep $secs
- echo ""
-done