User Tools

Site Tools


software_setup

This is an old revision of the document!


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 freeglut3 screen wine32-development wine-development ntpdate apache2 php libapache2-mod-php php-mysqli p7zip-full libssl-dev libncurses5-dev debhelper autossh git net-tools python3-tk -y
    sudo pip3 install numpy pandas matplotlib
  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 brewer@142.97.231.40:"/home/brewer/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 chmod 777 /bin/dosbox
    cp -r 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/linux
    sudo sh brewer_log_form_install_1.sh ; sh brewer_log_form_install_2.sh
    sudo chmod -R 775 /var/www/html/Brewer
    chmod 600 "/var/cache/BrewerLogForms/ftp/authentication/brewer_pk_priv.pem"
    chmod 777 /var/cache/BrewerLogForms -R
  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. Download year mover and creator script from the github (Request access from Reno.Sit@canada.ca if you do not have access.)
    Terminal
    git clone https://<User>:<Token>@github.com/<User>/Brewer_setup.git
    mv Brewer_setup/creator.py ~/schedule_task/creator.py
    mv Brewer_setup/year_mover.py ~/schedule_task/year_mover.py
    mv Brewer_setup/program_exclude.txt ~/schedule_task/
    mv Brewer_setup/brewer_restart.py ~/schedule_task/
    mv Brewer_setup/brewer_restart.sh ~/schedule_task/
    mv Brewer_setup/timelogger.py ~/schedule_task/
    chmod +x ~/schedule_task/*.sh
    chmod +x ~/schedule_task/*.py
    sudo rm Brewer_setup/ -r
  11. 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 0-3,5-22 * * * /home/brewer/schedule_task/rsync.sh
    15 4 * * * /home/brewer/schedule_task/rsync-all.sh
    0   *    *   *     *          /var/cache/BrewerLogForms/ftp/scripts/brewer_log_forms_ftp.sh -b
    0   0    *   *     *          /var/cache/BrewerLogForms/updates/update_log_form.sh
    0   0    *   *     1          cd /var/www/html/Brewer/Forms/DB_Backup/; ./GenerateLocalCache.bat;
    31 06,18 * * * /usr/bin/python3 /home/brewer/schedule_task/timelogger.py
    45 * * * * python3 /home/brewer/schedule_task/brewer_restart.py
    

    Setup the root's crontab

    Terminal
    sudo crontab -e

    Add the following code into the crontab

    crontab
    0 20 * * * systemctl restart systemd-timesyncd.service
  12. Setup the VNC, and the clock to auto start. Run the creator script
    Terminal
     python3 ~/schedule_task/creator.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'
  13. Setup samba via the creator.py (You must run this with sudo)

Setting up the brewer software

  1. Move the brewer folder (I.E. Br#026) into
    Terminal
    /home/brews/
  2. Run the creator script
    Terminal
     python3 ~/schedule_task/creator.py
    1. Pick option 1 and follow the instruction on the screen
    2. Pick option 2 to create the data transfer scripts
    3. Pick option 4 to config the dosbox config and follow the instruction on the screen
    4. Pick option 5 to setup the auto start script. Type as the script namebr###(where ### is the brewer serial number) to run the brewer script.
    5. Pick option 7 to setup the shortcuts creator

TO BE ADDED

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

run chmod 600 /var/cache/BrewerLogForms/ftp/authentication/brewer_pk_priv.pem

software_setup.1663075884.txt.gz ยท Last modified: 2022/09/13 13:31 by reno

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki