<commit_before>#!/bin/bash
#
# Setup network configuration for a CentOS 6.6 virtual machine on VirtualBox
# Please see directions at https://github.com/enterprisemediawiki/meza1

#
# Load Meza1 repository
#
cd ~
mkdir sources
cd sources
wget https://github.com/enterprisemediawiki/Meza1/tarball/master -O meza1.tar.gz
mkdir meza1
tar xpvf meza1.tar.gz -C ./meza1 --strip-components 1

#
# Modify network scripts in /etc/sysconfig/network-scripts, 
# ifcfg-eth0 (for NAT network adapter) and ifcfg-eth1 (for host-only)
#
cd /etc/sysconfig/network-scripts

ipaddr="192.168.56.56"

# modify ifcfg-eth0 (NAT)
sed -r -i 's/ONBOOT=no/ONBOOT=yes/g;' ./ifcfg-eth0
sed -r -i 's/NM_CONTROLLED=yes/NM_CONTROLLED=no/g;' ./ifcfg-eth0

# copy ifcfg-eth1  (host-only)
cp ~/sources/meza1/client_files/ifcfg-eth1 ./ifcfg-eth1

# get eth1 HWADDR from ifconfig, insert int ifcfg-eth1
eth1_hwaddr="$(ifconfig eth1 | grep '[a-zA-Z0-9]{2}:[a-zA-Z0-9]{2}:[a-zA-Z0-9]{2}:[a-zA-Z0-9]{2}:[a-zA-Z0-9]{2}:[a-zA-Z0-9]{2}' -o -P)"
sed -r -i "s/HWADDR=.*$/HWADDR=$eth1_hwaddr/g;" ./ifcfg-eth1<commit_msg>Allow choosing IP address during Vbox setup<commit_after>#!/bin/bash
#
# Setup network configuration for a CentOS 6.6 virtual machine on VirtualBox
# Please see directions at https://github.com/enterprisemediawiki/meza1

# Get host-only IP address
while [ -z "$ipaddr" ]
do
echo -e "Enter your desired IP address (follow Meza1 VirtualBox Networking steps)"
read -e -i "192.168.56.56" ipaddr
done


#
# Load Meza1 repository
#
cd ~
mkdir sources
cd sources
wget https://github.com/enterprisemediawiki/Meza1/tarball/master -O meza1.tar.gz
mkdir meza1
tar xpvf meza1.tar.gz -C ./meza1 --strip-components 1

#
# Modify network scripts in /etc/sysconfig/network-scripts, 
# ifcfg-eth0 (for NAT network adapter) and ifcfg-eth1 (for host-only)
#
cd /etc/sysconfig/network-scripts

# modify ifcfg-eth0 (NAT)
sed -r -i 's/ONBOOT=no/ONBOOT=yes/g;' ./ifcfg-eth0
sed -r -i 's/NM_CONTROLLED=yes/NM_CONTROLLED=no/g;' ./ifcfg-eth0

# copy ifcfg-eth1  (host-only)
cp ~/sources/meza1/client_files/ifcfg-eth1 ./ifcfg-eth1

# modify IP address as required:
sed -r -i "s/IPADDR=192.168.56.56/IPADDR=$ipaddr/g;" ./ifcfg-eth1

# get eth1 HWADDR from ifconfig, insert int ifcfg-eth1
eth1_hwaddr="$(ifconfig eth1 | grep '[a-zA-Z0-9]{2}:[a-zA-Z0-9]{2}:[a-zA-Z0-9]{2}:[a-zA-Z0-9]{2}:[a-zA-Z0-9]{2}:[a-zA-Z0-9]{2}' -o -P)"
sed -r -i "s/HWADDR=.*$/HWADDR=$eth1_hwaddr/g;" ./ifcfg-eth1
{'fraction_non_alphanumeric': 0.16838205022643063, 'fraction_numerical': 0.04857966241251544, 'mean_word_length': 3.9795081967213113, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, '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': '6897574', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1030, 'n_words': 226}