Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update packages #1

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/ioiconf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ EOM
if [ -f "/usr/share/zoneinfo/$2" ]; then
cat - <<EOM
Your timezone will be set to $2 at your next login.
*** Please take note that all dates and times communicated by the IOI 2022 ***
*** organisers will be in Asia/Jakarta timezone (GMT+07), unless it is ***
*** Please take note that all dates and times communicated by the IOI 2023 ***
*** organisers will be in Europe/Budapest timezone (GMT+2), unless it is ***
*** otherwise specified. ***
EOM
echo "$2" > /opt/ioi/config/timezone
Expand Down
2 changes: 1 addition & 1 deletion bin/ioiexec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ case $1 in
chfn -f "IOI Contestant" ioi
echo "Due to some issues, we have disabled VPN connection to CMS."
echo ""
echo "For now, open https://cms-public.ioi2022.id on Firefox,"
echo "For now, open https://cms-public.nonexistent on Firefox,"
echo "and log in using the following credentials:"
echo ""
echo "- Username: $(cat /opt/ioi/run/username.txt)"
Expand Down
2 changes: 1 addition & 1 deletion bin/ioisetup
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ do_setup()

if [ ${retval} -eq 2 ]; then
read -d '' -r MSG<<-EOM
Failed to communicate with the IOI 2022 configuration server.\n
Failed to communicate with the IOI 2023 configuration server.\n
Please try again. If this persists, please contact the HTC.
EOM
zenity "$ZENTITLE" $ZENARG \
Expand Down
1 change: 1 addition & 0 deletions cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ PARTKEY=$(/opt/ioi/sbin/genkey.sh)
echo $PARTKEY

echo REMEMBER TO REMOVE SETUP DIRECTORY
echo REMEMBER TO FINALIZE VM IMAGE

# vim: ts=4
8 changes: 4 additions & 4 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
<title>IOI2022</title>
<title>IOI2023</title>
<style type="text/css">
/* share-regular - latin */
@font-face {
Expand Down Expand Up @@ -50,12 +50,12 @@
</style>
</head>
<body>
<h1 style="display: none;">IOI2022</h1>
<h1 style="display: none;">IOI2023</h1>
<div style="text-align: center;">
<img src="ioi-website-logo.png" alt="IOI 2022" style="max-height: 150px;" />
<img src="ioi-website-logo.png" alt="IOI 2023" style="max-height: 150px;" />
</div>
<div class="ll" style="margin: 1em 0;">
<a class="button" href="https://cms.ioi2022.id/">CMS WEBSITE</a>
<a class="button" href="https://cms.XXX/">CMS WEBSITE</a>
</div>
<div class="container">
<div class="ll"><a href="file:///opt/cppref/reference/en/index.html">C/C++ Reference</a></div>
Expand Down
14 changes: 7 additions & 7 deletions html/vm.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
<title>IOI2022</title>
<title>IOI2023</title>
<style type="text/css">
/* share-regular - latin */
@font-face {
Expand Down Expand Up @@ -63,13 +63,13 @@ <h2>Contestant Account</h2>
with your contestant username, e.g. XXX1, which will be displayed in the top right
corner on subsequent logins.</p>

<p>The VPN connection identifies this VM instance to the IOI 2022 grading system
<p>The VPN connection identifies this VM instance to the IOI 2023 grading system
as being associated to the configured contestant. If
another contestant takes over the use of this VM instance, they must re-run IOI
Setup with their credentials.</p>

<p><strong>IMPORTANT</strong>: There must be only <strong>one</strong> VM instance running and
connected to the IOI 2022 grading system per contestant credentials. If the
connected to the IOI 2023 grading system per contestant credentials. If the
same contestant is logged in more than once, the VPN connection will flap
between the two instances and will <strong>NOT</strong> be usable.</p>

Expand Down Expand Up @@ -98,7 +98,7 @@ <h2>Advanced Features</h2>
<h3>Home Directory Backup</h3>

<p>The contestant VM provides a backup/replication mechanism that uses rsync to
replicate the home directory to IOI 2022
replicate the home directory to IOI 2023
backup server. This is not enabled by default. Contestants can
either:</p>

Expand Down Expand Up @@ -129,9 +129,9 @@ <h3>Automatic Screen Lock</h3>

<h3>Timezone</h3>

<p>The contestant VM is configured to show time in the <strong>Asia/Jakarta</strong> timezone.
All dates and times communicated by the IOI 2022 organisers will be in
Asia/Jakarta timezone unless otherwise specified.</p>
<p>The contestant VM is configured to show time in the <strong>Budapest/Europe</strong> timezone.
All dates and times communicated by the IOI 2023 organisers will be in
Budpaest/Europe timezone unless otherwise specified.</p>

<p>If you strongly prefer to see the time in your local timezone, you can run
<code>ioiconf settz &lt;timezone&gt;</code>, where
Expand Down
1 change: 1 addition & 0 deletions sbin/mkioiuser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ echo 'TZ=$(cat /opt/ioi/config/timezone)' >> ~ioi/.profile
echo 'export TZ' >> ~ioi/.profile

# Mark Gnome's initial setup as complete
sudo -Hu ioi bash -c 'mkdir -p ~/.config'
sudo -Hu ioi bash -c 'echo yes > ~/.config/gnome-initial-setup-done'

sudo -Hu ioi bash -c 'mkdir -p ~ioi/.local/share/gnome-shell/extensions'
Expand Down
2 changes: 1 addition & 1 deletion sbin/startatd.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

COUNT=0
TIMEOUT=60
Expand Down
37 changes: 21 additions & 16 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ fi

# Fix up date/time

timedatectl set-timezone Asia/Jakarta
timedatectl set-timezone Europe/Budapest
vmware-toolbox-cmd timesync enable
hwclock -w

# Install zabbix repo
wget -O /tmp/zabbix-release_5.0-1+focal_all.deb https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb
dpkg -i /tmp/zabbix-release_5.0-1+focal_all.deb
wget -O /tmp/zabbix-release_5.0-2+ubuntu22.04_all.deb https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-2+ubuntu22.04_all.deb
dpkg -i /tmp/zabbix-release_5.0-2+ubuntu22.04_all.deb

# Update packages

Expand All @@ -52,7 +52,7 @@ apt -y install build-essential autoconf autotools-dev

# Install packages needed by contestants

apt -y install openjdk-11-jdk-headless codeblocks emacs \
apt -y install emacs \
geany gedit joe kate kdevelop nano vim vim-gtk3 \
ddd valgrind visualvm ruby python3-pip konsole

Expand All @@ -63,7 +63,7 @@ snap install --classic code
snap install --classic sublime-text

# Install Eclipse
aria2c -x4 -d /tmp -o eclipse.tar.gz "http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2021-09/R/eclipse-java-2021-09-R-linux-gtk-x86_64.tar.gz"
aria2c -x4 -d /tmp -o eclipse.tar.gz "https://eclipse.mirror.liteserver.nl/technology/epp/downloads/release/2023-06/M2/eclipse-cpp-2023-06-M2-linux-gtk-x86_64.tar.gz"
tar zxf /tmp/eclipse.tar.gz -C /opt
rm /tmp/eclipse.tar.gz
wget -O /usr/share/pixmaps/eclipse.png "https://icon-icons.com/downloadimage.php?id=94656&root=1381/PNG/64/&file=eclipse_94656.png"
Expand Down Expand Up @@ -95,9 +95,10 @@ mkdir -p /opt/ioi/store/screenshots
mkdir -p /opt/ioi/store/submissions
mkdir -p /opt/ioi/config/ssh

aria2c -x 4 -d /tmp -o cpptools-linux.vsix "https://github.com/microsoft/vscode-cpptools/releases/download/v1.10.7/cpptools-linux.vsix"
aria2c -x 4 -d /tmp -o cpp-compile-run.vsix "https://github.com/danielpinto8zz6/c-cpp-compile-run/releases/download/v1.0.15/c-cpp-compile-run-1.0.15.vsix"
wget -O /tmp/vscodevim.vsix "https://github.com/VSCodeVim/Vim/releases/download/v1.23.0/vim-1.23.0.vsix"
# Latest as of 2023-05-20
aria2c -x 4 -d /tmp -o cpptools-linux.vsix "https://github.com/microsoft/vscode-cpptools/releases/download/v1.15.4/cpptools-linux.vsix"
aria2c -x 4 -d /tmp -o cpp-compile-run.vsix "https://github.com/danielpinto8zz6/c-cpp-compile-run/releases/download/v1.0.45/c-cpp-compile-run-1.0.45.vsix"
wget -O /tmp/vscodevim.vsix "https://github.com/VSCodeVim/Vim/releases/download/v1.25.2/vim-1.25.2.vsix"
rm -rf /tmp/vscode
mkdir /tmp/vscode
mkdir /tmp/vscode-extensions
Expand All @@ -108,7 +109,7 @@ cp /tmp/vscodevim.vsix /opt/ioi/misc
rm -rf /tmp/vscode-extensions

# Add default timezone
echo "Asia/Jakarta" > /opt/ioi/config/timezone
echo "Europe/Budapest" > /opt/ioi/config/timezone

# Default to enable screensaver lock
touch /opt/ioi/config/screenlock
Expand Down Expand Up @@ -137,6 +138,7 @@ EOM

# Don't list ansible user at login screen

mkdir -p /var/lib/AccountsService/users
cat - <<EOM > /var/lib/AccountsService/users/ansible
[User]
Language=
Expand Down Expand Up @@ -197,6 +199,8 @@ cd build
../configure
make
make install
# These SUID management scripts are not needed
rm /usr/local/bin/llk /usr/local/bin/llkk
cp ../keymaps/en_US_ubuntu_1204.map /opt/ioi/misc/
popd
rm -rf $WORKDIR
Expand All @@ -209,12 +213,10 @@ apt -y install `dpkg-query -Wf '${Package}\n' | grep linux-modules-`
# Remove unneeded packages

apt -y remove gnome-power-manager brltty extra-cmake-modules
apt -y remove llvm-9-dev zlib1g-dev libobjc-9-dev libx11-dev dpkg-dev manpages-dev
apt -y remove llvm-13-dev zlib1g-dev libobjc-11-dev libx11-dev dpkg-dev manpages-dev
apt -y remove linux-firmware memtest86+
apt -y remove network-manager-openvpn network-manager-openvpn-gnome openvpn
apt -y remove gnome-getting-started-docs-it gnome-getting-started-docs-ru \
gnome-getting-started-docs-es gnome-getting-started-docs-fr gnome-getting-started-docs-de
apt -y remove build-essential autoconf autotools-dev
apt -y remove autoconf autotools-dev
apt -y remove `dpkg-query -Wf '${Package}\n' | grep linux-header`

# Remove most extra modules but preserve those for sound
Expand All @@ -230,8 +232,8 @@ depmod -a

cp -a html /opt/ioi/html
mkdir -p /opt/ioi/html/fonts
wget -O /tmp/fira-sans.zip "https://google-webfonts-helper.herokuapp.com/api/fonts/fira-sans?download=zip&subsets=latin&variants=regular"
wget -O /tmp/share.zip "https://google-webfonts-helper.herokuapp.com/api/fonts/share?download=zip&subsets=latin&variants=regular"
wget -O /tmp/fira-sans.zip "https://gwfh.mranftl.com/api/fonts/fira-sans?download=zip&subsets=latin&variants=regular"
wget -O /tmp/share.zip "https://gwfh.mranftl.com/api/fonts/share?download=zip&subsets=latin&variants=regular"
unzip -o /tmp/fira-sans.zip -d /opt/ioi/html/fonts
unzip -o /tmp/share.zip -d /opt/ioi/html/fonts
rm /tmp/fira-sans.zip
Expand Down Expand Up @@ -289,7 +291,10 @@ systemctl disable multipathd
# Disable cloud-init
touch /etc/cloud/cloud-init.disabled

# Don't stsart atd service
# At was not installed by default somewhy
apt -y install at

# Don't start atd service
systemctl disable atd

# Replace atd.service file
Expand Down