<commit_before>#!/bin/bash
set -ex

# Forward incoming requests on port 80 to local port 8080
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080

# Set timezone to Europe/Helsinki
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/Europe/Helsinki /etc/localtime

# Install updates and upgrade Java
yum --assumeyes update
yum --assumeyes install java-1.8.0-openjdk-devel
yum --assumeyes remove java-1.7.0-openjdk

cd /home/ec2-user/

# Set up Gradle
mkdir .gradle/
echo "org.gradle.daemon=false" > .gradle/gradle.properties
echo "org.gradle.parallel=true" >> .gradle/gradle.properties

# Install schnitzel.ax web app
wget https://github.com/pheimdah/schnitzel.ax/archive/master.zip
unzip master.zip
rm master.zip
mkdir schnitzel.ax-master/logs/

# Restore permissions, make sure everything is owned by ec2-user
chown -R ec2-user:ec2-user /home/ec2-user/

# Start schnitzel.ax web app
cd schnitzel.ax-master/
sudo -u ec2-user bash -c "sh gradlew bootRun > logs/server.log 2>&1 &"<commit_msg>1 GiB swap file for ec2 instances<commit_after>#!/bin/bash
set -ex

# Forward incoming requests on port 80 to local port 8080
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080

# Set timezone to Europe/Helsinki
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/Europe/Helsinki /etc/localtime

# Install updates and upgrade Java
yum --assumeyes update
yum --assumeyes install java-1.8.0-openjdk-devel
yum --assumeyes remove java-1.7.0-openjdk

cd /home/ec2-user/

# Set up Gradle
mkdir .gradle/
echo "org.gradle.daemon=false" > .gradle/gradle.properties
echo "org.gradle.parallel=true" >> .gradle/gradle.properties

# Install schnitzel.ax web app
wget https://github.com/pheimdah/schnitzel.ax/archive/master.zip
unzip master.zip
rm master.zip
mkdir schnitzel.ax-master/logs/

# Restore permissions, make sure everything is owned by ec2-user
chown -R ec2-user:ec2-user /home/ec2-user/

# Start schnitzel.ax web app
cd schnitzel.ax-master/
sudo -u ec2-user bash -c "sh gradlew bootRun > logs/server.log 2>&1 &"

# Set up a 1 GiB swap file
dd if=/dev/zero of=/swapfile bs=1024 count=1048576
mkswap /swapfile
chmod 0600 /swapfile
swapon /swapfile
{'fraction_non_alphanumeric': 0.11361545538178473, 'fraction_numerical': 0.03219871205151794, 'mean_word_length': 3.7282608695652173, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '872445', 'n_tokens_mistral': 883, 'n_tokens_neox': 804, 'n_words': 239}