<commit_before>#! /bin/bash -ex
# https://help.ubuntu.com/community/CloudInit
# http://www.knowceantech.com/2014/03/amazon-cloud-bootstrap-with-userdata-cloudinit-github-puppet/
export DEBIAN_FRONTEND=noninteractive  # Bypass ncurses configuration screens

# -----------------------------------------------------------------------------

# Backup ubuntu user folder files as we will then mount the instance store to it
mkdir /ubuntuUser-old/
cp -pRP /home/ubuntu/.bash_logout /ubuntuUser-old/
cp -pRP /home/ubuntu/.bashrc /ubuntuUser-old/
cp -pRP /home/ubuntu/.profile /ubuntuUser-old/
cp -pRP /home/ubuntu/.ssh/authorized_keys /ubuntuUser-old/
rm -rf /home/ubuntu/

# Format and mount all available instance stores.
# Adapted from http://stackoverflow.com/a/10792689
# REOF = Real End Of File because the script already have EOF
# Quoting of REOF comes from: http://stackoverflow.com/a/8994243
cat << 'REOF' > /home/mountInstanceStore.sh
#!/bin/bash

# This script formats and mounts all available Instance Store devices

##### Variables
devices=( )

##### Functions

function add_device
{
    devices=( "${devices[@]}" $1 )
}

function check_device
{
    if [ -e /dev/$1 ]; then
        add_device $1
    fi
}

function check_devices
{
    # If these lines are added/removed, make sure to check the sed line dealing with /etc/fstab too.
    check_device xvdb
    check_device xvdb1
    check_device xvdb2
    check_device xvdb3
    check_device xvdb4
    check_device xvdc
    check_device xvdc1
    check_device xvdc2
    check_device xvdc3
    check_device xvdc4
    check_device xvdd
    check_device xvde
    check_device xvdf
    check_device xvdg
    check_device xvdh
    check_device xvdi
    check_device xvdj
    check_device xvdk<commit_msg>Remove extra devices to be checked.<commit_after>#! /bin/bash -ex
# https://help.ubuntu.com/community/CloudInit
# http://www.knowceantech.com/2014/03/amazon-cloud-bootstrap-with-userdata-cloudinit-github-puppet/
export DEBIAN_FRONTEND=noninteractive  # Bypass ncurses configuration screens

# -----------------------------------------------------------------------------

# Backup ubuntu user folder files as we will then mount the instance store to it
mkdir /ubuntuUser-old/
cp -pRP /home/ubuntu/.bash_logout /ubuntuUser-old/
cp -pRP /home/ubuntu/.bashrc /ubuntuUser-old/
cp -pRP /home/ubuntu/.profile /ubuntuUser-old/
cp -pRP /home/ubuntu/.ssh/authorized_keys /ubuntuUser-old/
rm -rf /home/ubuntu/

# Format and mount all available instance stores.
# Adapted from http://stackoverflow.com/a/10792689
# REOF = Real End Of File because the script already have EOF
# Quoting of REOF comes from: http://stackoverflow.com/a/8994243
cat << 'REOF' > /home/mountInstanceStore.sh
#!/bin/bash

# This script formats and mounts all available Instance Store devices

##### Variables
devices=( )

##### Functions

function add_device
{
    devices=( "${devices[@]}" $1 )
}

function check_device
{
    if [ -e /dev/$1 ]; then
        add_device $1
    fi
}

function check_devices
{
    # If these lines are added/removed, make sure to check the sed line dealing with /etc/fstab too.
    check_device xvdb
    check_device xvdc
    check_device xvdd
    check_device xvde
    check_device xvdf
    check_device xvdg
    check_device xvdh
    check_device xvdi
    check_device xvdj
    check_device xvdk
{'fraction_non_alphanumeric': 0.13777644949193066, 'fraction_numerical': 0.016736401673640166, 'mean_word_length': 2.8604382929642447, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '5132111', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1057, 'n_words': 306}