<commit_before>#!/usr/bin/env bash

set -e

if [[ $UID -ne 0 ]]; then
    echo 'Must run as root!'
    exit 1
fi

lsb_release_id="$(lsb_release -s -i)"
if [[ $lsb_release_id != Ubuntu ]]; then
    echo 'This script is only for Ubuntu systems.'
    exit 1
fi

ubuntu_codename="$(lsb_release -s -c)"

echo '[apt] Switching to global mirror ... '
if ! [[ $ubuntu_codename == lucid ]]; then
    sed -i 's/\([a-z]\{2\}\.\)\?\(archive\.ubuntu\.com\)/\2/' /etc/apt/sources.list
else
    sed -i 's/\([a-z]\{2\}\.\)\?archive\.ubuntu\.com/old-releases.ubuntu.com/' /etc/apt/sources.list
    sed -i 's/security\.ubuntu\.com/old-releases.ubuntu.com/' /etc/apt/sources.list
fi

echo '[apt] Disabling automatic updates ...'<commit_msg>Initialize-TestVM: Revert to local APT mirror<commit_after>#!/usr/bin/env bash

set -e

if [[ $UID -ne 0 ]]; then
    echo 'Must run as root!'
    exit 1
fi

lsb_release_id="$(lsb_release -s -i)"
if [[ $lsb_release_id != Ubuntu ]]; then
    echo 'This script is only for Ubuntu systems.'
    exit 1
fi

ubuntu_codename="$(lsb_release -s -c)"

echo '[apt] Switching to local mirror ... '
if ! [[ $ubuntu_codename == lucid ]]; then
    sed -i 's/http:\/\/\([a-z]\{2\}\.\)\?\(archive\.ubuntu\.com\)/http:\/\/au\.\2/' /etc/apt/sources.list
else
    sed -i 's/http:\/\/\([a-z]\{2\}\.\)\?archive\.ubuntu\.com/http:\/\/old-releases.ubuntu.com/' /etc/apt/sources.list
    sed -i 's/http:\/\/security\.ubuntu\.com/http:\/\/old-releases.ubuntu.com/' /etc/apt/sources.list
fi

echo '[apt] Disabling automatic updates ...'
{'fraction_non_alphanumeric': 0.22077073807968647, 'fraction_numerical': 0.007838014369693011, 'mean_word_length': 2.727493917274939, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '1525573', 'n_tokens_mistral': 654, 'n_tokens_neox': 574, 'n_words': 139}