<commit_before>#!/bin/bash

set -e

# Check that the script was called with the correct number of arguments
if [ $# -ne 2 ]; then
    echo "Usage: sasha-setup.sh <master-url> <config-file>"
    echo
    echo "Master url should be the url to the master you want to associate with,"
    echo "config file should be the path to a config file to use."
    exit 1
fi

# Update and upgrade, commented out for now since it's awful slow
#sudo apt-get update
#sudo apt-get upgrade -y

# Download files
git clone https://github.com/thusoy/sasha

# Install pip and requirements
echo "Installing dependencies..."
sudo apt-get install python-pip -y
sudo pip install -e ./sasha

# Generate private- and public keys
sudo ./sasha/sasha/genkeys.sh

# Install PiFace
sudo apt-get install python-pifacecad

sudo apt-get install pifacecommon

# Enable SPI module
sudo modprobe spi-bmc2708

# Start the sysinfo service
sudo service pifacecafsysinfo start

# Enable service to run at boot
sudo update-rc.d pifacecadsysinfo defaults

# Run bootstrapping with master
echo "Associating with master $1..."
sudo sasha $1 --setup

sudo sh -c "cat > /etc/init/sasha.conf <<EOF
description \"Sasha client daemon\"

start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]

respawn

exec sasha -c $2 $1
EOF"

echo "Starting sasha service..."
sudo service sasha start
<commit_msg>Add -y flag to apt-get install<commit_after>#!/bin/bash

set -e

# Check that the script was called with the correct number of arguments
if [ $# -ne 2 ]; then
    echo "Usage: sasha-setup.sh <master-url> <config-file>"
    echo
    echo "Master url should be the url to the master you want to associate with,"
    echo "config file should be the path to a config file to use."
    exit 1
fi

# Update and upgrade, commented out for now since it's awful slow
#sudo apt-get update
#sudo apt-get upgrade -y

# Download files
git clone https://github.com/thusoy/sasha

# Install pip and requirements
echo "Installing dependencies..."
sudo apt-get install -y python-pip
sudo pip install -e ./sasha

# Generate private- and public keys
sudo ./sasha/sasha/genkeys.sh

# Install PiFace
sudo apt-get install -y python-pifacecad pifacecommon

# Enable SPI module
sudo modprobe spi-bmc2708

# Start the sysinfo service
sudo service pifacecafsysinfo start

# Enable service to run at boot
sudo update-rc.d pifacecadsysinfo defaults

# Run bootstrapping with master
echo "Associating with master $1..."
sudo sasha $1 --setup

sudo sh -c "cat > /etc/init/sasha.conf <<EOF
description \"Sasha client daemon\"

start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]

respawn

exec sasha -c $2 $1
EOF"

echo "Starting sasha service..."
sudo service sasha start

{'fraction_non_alphanumeric': 0.08577712609970674, 'fraction_numerical': 0.010263929618768328, 'mean_word_length': 3.633276740237691, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3798432', 'n_tokens_mistral': 895, 'n_tokens_neox': 851, 'n_words': 373}