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

# to be executed in after install.ps1
# or directly.. if in Linux

# install the python packages via pip2 and pip3 
# this only occurs in Cygwin, not in Linux
# 
# compile the m4 scripts and everything..
# then install all the config files in the right places

# This occurs after packages are alreeady installed via cygwin packages
# this needs to run the build...
# but before we run the build we must interrogate a few things
# and even run a few scripts

if [[ "$(uname -s)" == Linux* ]]; then

    # on Linux, we assume timezone was already setup on OS installation
    tz="$(cat /etc/zoneinfo)"
    tzdir="/etc/zoneinfo"

elif [[ $(uname -s) == CYGWIN* ]]; then

    # Merge Windows User Temporary with Cygwin /tmp
    echo "none /tmp usertemp binary,posix=0 0 0" >> /etc/fstab
    
    # Acquire timezone information from Windows
    tz="$(./bin/tz-windows-to-iana "$(tzutil /l | grep --before-context=1 "$(tzutil /g)" | head --lines=1)")"
    
    if [ -f /usr/share/zoneinfo/"$tz" ]; then
        echo "$tz" > /etc/timezone
        ln --symbolic --force /usr/share/zoneinfo/"$tz" /etc/localtime
        ln --symbolic --force /usr/share/zoneinfo /etc/zoneinfo
        tzdir="/usr/share/zoneinfo"
    else 
        echo "Unable to acquire IANA timezone information, update the timezone matching script, or do it manually."
    fi

fi

# We need to pass "PH_TZ" and "PH_TZDIR" as variables to m4 preprocessor

# run the m4 macro and build into ./.build folder

# copy files from ./.build into ~
# where --archive means: --recursive --links --perms --times --group --owner
rsync --update --checksum --archive "./.build/" "${HOME}/"

# Make ~/.ssh directory and below only readable by me
chmod 600 --recursive ~/.ssh<commit_msg>Changing default shell in /etc/passwd to ZSH<commit_after>#!/usr/bin/env bash

# to be executed in after install.ps1
# or directly.. if in Linux

# install the python packages via pip2 and pip3 
# this only occurs in Cygwin, not in Linux
# 
# compile the m4 scripts and everything..
# then install all the config files in the right places

# This occurs after packages are alreeady installed via cygwin packages
# this needs to run the build...
# but before we run the build we must interrogate a few things
# and even run a few scripts

if [[ "$(uname -s)" == Linux* ]]; then

    # on Linux, we assume timezone was already setup on OS installation
    tz="$(cat /etc/zoneinfo)"
    tzdir="/etc/zoneinfo"

elif [[ $(uname -s) == CYGWIN* ]]; then

    # Merge Windows User Temporary with Cygwin /tmp
    echo "none /tmp usertemp binary,posix=0 0 0" >> /etc/fstab
    
    # Acquire timezone information from Windows
    tz="$(./bin/tz-windows-to-iana "$(tzutil /l | grep --before-context=1 "$(tzutil /g)" | head --lines=1)")"
    
    if [ -f /usr/share/zoneinfo/"$tz" ]; then
        echo "$tz" > /etc/timezone
        ln --symbolic --force /usr/share/zoneinfo/"$tz" /etc/localtime
        ln --symbolic --force /usr/share/zoneinfo /etc/zoneinfo
        tzdir="/usr/share/zoneinfo"
    else 
        echo "Unable to acquire IANA timezone information, update the timezone matching script, or do it manually."
    fi
    
    # Change default shell to zsh
    # On Linux we could use chsh --shell
    # But Cygwin doesn't support it, so we just need to edit it using sed
    sed --in-place "/^${USER}/ s/:[^:][^:]*$/:"${$(which zsh)//\//\\\/}"/" /etc/passwd

fi

# We need to pass "PH_TZ" and "PH_TZDIR" as variables to m4 preprocessor

# run the m4 macro and build into ./.build folder

# copy files from ./.build into ~
# where --archive means: --recursive --links --perms --times --group --owner
rsync --update --checksum --archive "./.build/" "${HOME}/"

# Make ~/.ssh directory and below only readable by me
chmod 600 --recursive ~/.ssh
{'fraction_non_alphanumeric': 0.13025210084033614, 'fraction_numerical': 0.007352941176470588, 'mean_word_length': 2.786282306163022, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1909276', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1180, 'n_words': 483}