<commit_before>#! /bin/bash

###################################
#         add repositories        #
###################################

echo adding repositories
# sudo add-apt-repository -y "deb http://dl.google.com/linux/chrome/deb/ stable main"
#sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -

###################################
#         Basic Update            #
###################################

echo updating system
sudo dpkg --configure -a > /dev/null
sudo apt-get -qq update  > /dev/null
sudo apt-get -qq upgrade > /dev/null

###################################
#      install and unistall apps  #
###################################

echo installing new apps
sudo apt-get -qq install \
    ssh git gitk gitg curl gparted \
    dkms python3-pip rygel nmap \
    nfs-kernel-server

sudo apt-get -y -qq remove \


###################################
#      install python libraries   #
###################################

echo installing python libraries
sudo pip3 install \
	homeassistant

###################################
#      Updating dotfiles          #
###################################
echo installing configuration files
sed -i 's/#force_color_prompt=yes/force_color_prompt=yes/' ~/.bashrc


###################################
#      Setting up Github          #
###################################
    
mkdir ~/projects 

echo setting up github
git config --global user.email "<EMAIL>"
git config --global user.name "<NAME>"


echo downloading the github files
git -C ~/projects clone <EMAIL>:marcwagner/install_scripts.git
git -C ~/projects clone git@github.com:pi-hole/pi-hole.git


###################################
#       setting up nfs shares     #
###################################
echo setting up nfs shares

echo - editing /etc/exports
echo '/home/marc/ 192.168.1.133(rw,sync,no_root_squash,no_subtree_check) ' | sudo tee -a /etc/exports

echo - starting nfs-server
sudo systemctl start nfs-kernel-server.service

###################################
#      Setting up backup script   #
###################################


echo installing foto backup system

echo - creating user fotosync
sudo useradd -m -d /home/fotosync fotosync

echo - adding mounts to fstab 
echo '//192.168.1.130/fotos /media/fotos                    cifs    username=foto_sync,password=<PASSWORD>,rw,noexec   0       0' | sudo tee -a /etc/fstab
echo '//192.168.1.130/Documents /media/documents            cifs    username=foto_sync,password=<PASSWORD>,rw,noexec   0       0' | sudo tee -a /etc/fstab 
echo - creating mount points
sudo mkdir /media/fotos && sudo chown fotosync:fotosync /media/fotos
sudo mkdir /media/documents && sudo chown fotosync:fotosync /media/documents

echo - creating home dir folder structure
sudo mkdir /home/fotosync/scripts
sudo mkdir /home/fotosync/documents
sudo mkdir /home/fotosync/fotos
sudo mkdir /home/fotosync/documents/monthly
sudo mkdir /home/fotosync/documents/daily
sudo mkdir /home/fotosync/fotos/monthly
sudo mkdir /home/fotosync/fotos/daily

echo - copying scripts
cp ~/projects/install_scripts/backups/* /home/fotosync/scripts/

echo - setting the correct file ownerships
sudo chown -R fotosync:fotosync /home/fotosync

echo - mounting laptop fotos
sudo mount -a

echo - setting crontab
sudo su -c '(crontab -l 2>/dev/null; echo " 10 20  *   *   *     /home/fotosync/scripts/daily_sync.sh") | crontab -' fotosync
sudo su -c '(crontab -l 2>/dev/null; echo "  0 20  *   *   *     /home/fotosync/scripts/monthly_sync.sh") | crontab -' fotosync


<commit_msg>updated server_postinstall script to work with new backup script<commit_after>#! /bin/bash

###################################
#         add repositories        #
###################################

echo adding repositories
# sudo add-apt-repository -y "deb http://dl.google.com/linux/chrome/deb/ stable main"
#sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -

###################################
#         Basic Update            #
###################################

echo updating system
sudo dpkg --configure -a > /dev/null
sudo apt-get -qq update  > /dev/null
sudo apt-get -qq upgrade > /dev/null

###################################
#      install and unistall apps  #
###################################

echo installing new apps
sudo apt-get -qq install \
    ssh git gitk gitg curl gparted \
    dkms python3-pip rygel nmap \
    nfs-kernel-server

sudo apt-get -y -qq remove \


###################################
#      install python libraries   #
###################################

echo installing python libraries
sudo pip3 install \
	homeassistant

###################################
#      Updating dotfiles          #
###################################
echo installing configuration files
sed -i 's/#force_color_prompt=yes/force_color_prompt=yes/' ~/.bashrc


###################################
#      Setting up Github          #
###################################
    
mkdir ~/projects 

echo setting up github
git config --global user.email "<EMAIL>"
git config --global user.name "<NAME>"


echo downloading the github files
git -C ~/projects clone <EMAIL>:marcwagner/install_scripts.git
git -C ~/projects clone git@github.com:pi-hole/pi-hole.git


###################################
#       setting up nfs shares     #
###################################
echo setting up nfs shares to laptop_marc

echo - editing /etc/exports
echo '/home/marc/ 192.168.1.133(rw,sync,no_root_squash,no_subtree_check) ' | sudo tee -a /etc/exports

echo - starting nfs-server
sudo systemctl start nfs-kernel-server.service

###################################
#      Setting up backup script   #
###################################


echo installing foto backup system

echo - creating user fotosync
sudo useradd -m -d /home/fotosync fotosync

echo - adding mounts to fstab 
echo '//192.168.1.130/fotos /media/fotos         cifs    username=foto_sync,password=<PASSWORD>,uid=1001,x-systemd.automount,noauto,noexec,user   0       0' | sudo tee -a /etc/fstab
echo '//192.168.1.130/Documents /media/documents  cifs username=foto_sync,password=<PASSWORD>,uid=1001,x-systemd.automount,noauto,noexec,user   0       0' | sudo tee -a /etc/fstab 
echo - creating mount points
sudo mkdir /media/fotos && sudo chown fotosync:fotosync /media/fotos
sudo mkdir /media/documents && sudo chown fotosync:fotosync /media/documents

echo - creating home dir folder structure
sudo mkdir /home/fotosync/scripts
sudo mkdir /home/fotosync/documents
sudo mkdir /home/fotosync/fotos
sudo mkdir /home/fotosync/documents/monthly
sudo mkdir /home/fotosync/documents/daily
sudo mkdir /home/fotosync/fotos/monthly
sudo mkdir /home/fotosync/fotos/daily

echo - copying scripts
cp ~/projects/install_scripts/backups/* /home/fotosync/scripts/

echo - setting the correct file ownerships
sudo chown -R fotosync:fotosync /home/fotosync/*

echo - mounting laptop fotos
sudo mount -a

echo - setting crontab
sudo su -c '(crontab -l 2>/dev/null; echo " /30 *  *   *   *     /home/fotosync/scripts/daily_laptop_backup_script.sh") | crontab -' fotosync


{'fraction_non_alphanumeric': 0.24231363189667274, 'fraction_numerical': 0.012915906219289626, 'mean_word_length': 3.7493333333333334, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 22, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, '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': '2605835', 'n_tokens_mistral': 2308, 'n_tokens_neox': 2126, 'n_words': 581}