Table of Contents

Setting up a Brewer on a New Computer

Note: For setting up a new brewer on an existing computer, skip to setting up the brewer software

Note 2: Code Blocks

Note 2: Code Blocks

Code blocks will indicate whether it is a file or terminal. For files, modify the file so it reflects what it indicates.

/File/Path.txt
...

Terminal, enter the command into a terminal.

Terminal
...

Setting up the computer

  1. Change the ntp server: ...
    /etc/systemd/timesyncd.conf
    #  This file is part of systemd.
    #
    #  systemd is free software; you can redistribute it and/or modify it
    #  under the terms of the GNU Lesser General Public License as published by
    #  the Free Software Foundation; either version 2.1 of the License, or
    #  (at your option) any later version.
    #
    # Entries in this file show the compile time defaults.
    # You can change settings by editing this file.
    # Defaults can be restored by simply deleting this file.
    #
    # See timesyncd.conf(5) for details.
    
    [Time]
    NTP=time.nrc.ca
    FallbackNTP=time.chu.nrc.ca
    #RootDistanceMaxSec=5
    #PollIntervalMinSec=32
    #PollIntervalMaxSec=2048
  2. Restart time service and sync the time.
    Terminal
    sudo systemctl restart systemd-timesyncd && timedatectl
  1. Run an update and upgrade.
    Terminal
    sudo apt-get update && sudo apt-get upgrade -y
  2. Install required applications/services.
    Terminal
    sudo apt-get install x11vnc ssh libsdl1.2-dev automake autoconf python3-pip samba screen wine ntpdate apache2 php libapache2-mod-php php-mysqli p7zip-full libssl-dev libncurses5-dev debhelper autossh git net-tools python3-tk python3-numpy python3-pandas python3-matplotlib -y
  3. Add the fingerprint for exp-studies by connecting to it via ssh.
    Terminal
    ssh arqxozone@exp-studies.tor.ec.gc.ca

    Exit the ssh connection.

    Terminal
    exit
  4. Restart the apache service.
    Terminal
    sudo service apache2 restart
  5. Move the required files onto the linux computer from:
    Terminal
    rsync cbsnet@cbsn.hiitravel.ca:"/home/cbsnet/brews/QMS/Software_Management/Software_Network_Support/Brewer_linux" . -rtvh
    cd "Brewer_linux"
  6. Move the files to the appropriate location.
    Terminal
    sudo cp dosbox /bin/dosbox
    sudo mv icfb /bin/
    sudo mv getbrew /bin/
    sudo mv tailb /bin/
    sudo chmod 777 /bin/dosbox
    sudo chmod 777 /bin/icfb
    sudo chmod 777 /bin/getbrew
    sudo chmod 777 /bin/tailb
    cp -r schedule_task ~/
    rsync -rthv --delete -e "ssh -i "schedule_task/id_depot"" remsens_ext@depot.cmc.ec.gc.ca:/incoming/brewer_programs/schedule_task/ /home/brewer/schedule_task/
    cp Desktop/* ~/Desktop/ -r
    mkdir ~/brews
    chmod 777 ~/brews
  7. Setup the log form
    Terminal
    sudo /etc/init.d/apache2 reload
    cd brewer_log
    sudo sh brewer-logform-mitgrate.sh
  8. Setup Samba user/password
    Terminal
    sudo smbpasswd -a brewer
  9. Add the user brewer to the dialout group
    Terminal
    sudo usermod -a -G dialout $USER
  10. Setup the crontab.
    Terminal
    crontab -e

    Add the following to the end of the crontab.

    crontab
    0 16 * * * /usr/bin/python3 /home/brewer/schedule_task/year_mover.py
    #25,55 * * * * /home/brewer/schedule_task/rsync.sh 
    #15 4 * * * /home/brewer/schedule_task/rsync-program.sh  
    #31 06,18 * * * /usr/bin/python3 /home/brewer/schedule_task/timelogger.py 
    #45 * * * * python3 /home/brewer/schedule_task/brewer_restart.py 
    #10,20,30,40,50,0 * * * * /home/brewer/schedule_task/bfileold.py 
    32 * * * * rsync -vhrult -e "ssh -i "/home/brewer/schedule_task/id_depot"" /home/brewer/dosbox_pidstat/ remsens_ext@depot.cmc.ec.gc.ca:/incoming/brewer/pidstat/
    4 20 * * * rsync -rthv --delete -e "ssh -i "/home/brewer/schedule_task/id_depot"" --exclude-from /home/brewer/schedule_task/schedule_task_exclude.txt remsens_ext@depot.cmc.ec.gc.ca:/incoming/brewer_programs/schedule_task/ /home/brewer/schedule_task/
    0,30 * * * * /var/www/html/Brewer/Forms/scripts/client/pull-cache.sh
    0 0 * * * rsync -rthv --delete -e "ssh -i "/home/brewer/schedule_task/id_depot"" remsens_ext@depot.cmc.ec.gc.ca:/incoming/brewer_programs/Brewer_log/ /var/www/html/Brewer/Forms/
    0 * * * * /var/www/html/Brewer/Forms/scripts/client/push-logs.sh
    

    Setup the root's crontab

    Terminal
    sudo crontab -e

    Add the following code into the crontab

    crontab
    0 20 * * * systemctl restart systemd-timesyncd.service
  11. Setup the VNC, and the clock to auto start. Run the creator script
    Terminal
     python3 ~/schedule_task/BrewerConfig.py
    1. Select 'Auto start script' button, then 'Add a new auto start script' then select 'vnc'
    2. Select 'Auto start script' button, then 'Add a new auto start script' then select 'clock'
  12. Setup samba via the creator.py (relaunch BrewerConfig.py with sudo)
    1. Follow the prompts till the end.
  13. Disable wayland
    /etc/gdm3/custom.conf
    WaylandEnable=false
    sudo systemctl restart gdm3
  14. Set http://localhost/Brewer/Forms/BrewerLogForm.php as the default home page for firefox.
  15. Set the computer sleep turn off display to Never

TO BE ADDED

sudo vi /etc/apache2/envvars
change the User and Group to brewer

Disable Wayland <webcode name=“Default” frameborder=0 width=100% scrolling=yes externalResources=“,” renderingMode=story >

/etc/gdm3/custom.conf
WaylandEnable=false
Terminal
sudo systemctl restart gdm3