<commit_before>#!/biin/bash -e

# most of this script taken from veewee, vagrant

# dont prompt
export DEBIAN_FRONTEND="noninteractive"

# udev cleanup
rm -rf /etc/udev/rules.d/70-persistent-net.rules
mkdir -p /etc/udev/rules.d/70-persistent-net.rules
rm -rf /dev/.udev/
rm -rf /lib/udev/rules.d/75-persistent-net-generator.rules

# dhcp cleanup
rm -f /var/lib/dhcp3/*

if [[ -z $1 ]]; then # STAGE 1: during veewee build, and copied to ~/ so stage 2 can be called during vagrant
  # vagrant ssh key
  install -v -d -m 0700 ~/.ssh
  cat > ~/.ssh/authorized_keys << EOF
ssh-rsa A<KEY>== vagrant insecure public key
EOF

  # update packages
  aptitude update
  aptitude upgrade -y
  aptitude clean

  # dhcp delays
  echo "pre-up sleep 2" >> /etc/network/interfaces

  exit
fi

# STAGE 2: during vagrant after rebooting into updated kernel

# build requirements for virtual box guest additions
aptitude install -y build-essential wget linux-headers-$(uname -r)

tmp_vguest=$(mktemp -t XXXXXXXXX)

VBOX_VERSION=$(cat ~/.vbox_version)
wget -O $tmp_vguest http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso

mount -o loop $tmp_vguest /mnt
sh /mnt/VBoxLinuxAdditions.run
umount /mnt

rm $tmp_vguest<commit_msg>veewee only concerned with first stage<commit_after>#!/biin/bash -e

# most of this script taken from veewee, vagrant
umask 022

# dont prompt
export DEBIAN_FRONTEND="noninteractive"

# udev cleanup
rm -rf /etc/udev/rules.d/70-persistent-net.rules
mkdir -p /etc/udev/rules.d/70-persistent-net.rules
rm -rf /dev/.udev/
rm -rf /lib/udev/rules.d/75-persistent-net-generator.rules

# dhcp cleanup
rm -f /var/lib/dhcp3/*

# vagrant ssh key
install -v -d -m 0700 ~/.ssh
cat > ~/.ssh/authorized_keys << EOF
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
EOF

# update packages
aptitude update
aptitude upgrade -y
aptitude clean

# dhcp delays
echo "pre-up sleep 2" >> /etc/network/interfaces
{'fraction_non_alphanumeric': 0.10034904013961606, 'fraction_numerical': 0.03577661431064572, 'mean_word_length': 4.606356968215159, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2635205', 'n_tokens_mistral': 1064, 'n_tokens_neox': 986, 'n_words': 207}