This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # setup | |
| in server host machines, make sure openssh is installed, if machine is windows, install wsl, use '$wsl ~' to go into linux mode | |
| use '$hostname -I' to find ip address of server machine | |
| read ssh lepton note, to generate ssh private-public key pairs on control node, copy public key over to root of server host, generate ansible ssh key, same, copy over to server hosts | |
| add ip address of server host to ansible inventory file | |
| add ansible private key path to inventory file | |
| try connecting via ansible, if successful, create and run playbook | |
| # Connect to all servers | |
| cd to ansible folder with inventory file | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # SSH login | |
| ssh username@ip-address | |
| # SSH create user | |
| adduser newusername | |
| # Check ssh is installed | |
| ssh localhost | |
| # If success, should not say connection refused | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | client-output-buffer-limit normal 0 0 0 | |
| client-output-buffer-limit replica 0 0 0 | |
| client-output-buffer-limit pubsub 0 0 0 | |
| requirepass password | |
| bind 0.0.0.0 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | npm install -g prettier | |
| prettier --write . | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | {tablename}_{columnname(s)}_{suffix} | |
| where the suffix is one of the following: | |
| pkey for a Primary Key constraint | |
| key for a Unique constraint | |
| excl for an Exclusion constraint | |
| idx for any other kind of index | |
| fkey for a Foreign key | |
| check for a Check constraint | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | \\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | version: '3.9' | |
| services: | |
| fsgcrmfrontend: | |
| build: . | |
| ports: | |
| - '6000:6000' | |
| restart: unless-stopped | |
| volumes: | |
| - type: bind | |
| source: C:\resources | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | MySQL -> DATE ' YYYY-MM-DD ' format | |
| DATETIME -> ' YYYY-MM-DD hh:mm:ss ' format. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const foundBrands = await db.Brand.findAll({ where: { status: STATUS.ACTIVE } }); | |
| //Insert user | |
| const newUser = new db.User({ | |
| firstName, | |
| lastName, | |
| accessRightId, | |
| }); | |
| await newUser.save(); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | await db.sequelize.query(`select setval('users_id_seq', (select max(id) from users), true);`) //Update to max 'id' + 1 | |
| //If uppercase in table name | |
| await db.sequelize.query(`select setval('"dataAnalytics_id_seq"', (select max(id) from "dataAnalytics"), true);`) | |
| const something = await db.sequelize.query(`select nextval('users_id_seq');`) //Check if next id is correct | |
| console.log('****', something) | 
NewerOlder