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
    
  
  
    
  | Setting up python environments | |
| python3 -m venv venv | |
| source venv/bin/activate | |
| pip install numpy | |
| pip install pillow | 
  
    
      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
    
  
  
    
  | Rust | |
| Encoding Prost Message | |
| pl.encode_to_vec() | |
| Decoding Prost message | |
| let new_pl = integration_pb::UplinkEvent | |
| ::decode(&mut Cursor::new(buf)) | 
  
    
      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
    
  
  
    
  | To reduce the build file size please add the following setting into the cargo.toml | |
| [profile.release] | |
| opt-level = 'z' # Optimize for size | |
| lto = true # Enable link-time optimization | |
| codegen-units = 1 # Reduce number of codegen units to increase optimizations | |
| panic = 'abort' # Abort on panic | |
| strip = true # Strip symbols from binary* | 
  
    
      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
    
  
  
    
  | -- Table: public.alarmlog | |
| -- DROP TABLE IF EXISTS public.alarmlog; | |
| CREATE TABLE IF NOT EXISTS public.alarmlog | |
| ( | |
| id_alarm_log bigserial NOT NULL, | |
| id_control_device bigint NOT NULL, | |
| asset_name character varying(50) COLLATE pg_catalog."default" NOT NULL, | |
| property_group_name character varying(50) COLLATE pg_catalog."default" NOT NULL, | 
  
    
      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
    
  
  
    
  | echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile | |
| source ~/.bash_profile | 
  
    
      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
    
  
  
    
  | This document is intended for upgrading PostgreSQL 12 database to PostgreSQL 14 or timescale/timescaledb:2.9.1-pg14 db | |
| Inside the docker container | |
| 1. cd root | |
| 2. pg_dumpall -U postgres -v > $HOME/upgrade_backup.sql | 
  
    
      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
    
  
  
    
  | with performance_table | |
| as (select name, | |
| asset_uuid, | |
| device_uuid, | |
| group_uuid, | |
| value, | |
| time | |
| from public.messages | |
| where time between 1690653600000 and 1690739999000 | |
| and asset_uuid = '1e112e32-a533-48a7-9c1d-ef30c8b4ed6e' | 
  
    
      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
    
  
  
    
  | export PATH=$PATH:$(go env GOPATH)/bin | 
  
    
      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
    
  
  
    
  | if go get private package does not work then follow these | |
| go env -w GOPRIVATE='github.com/repoURL/private-repo' | |
| or | |
| go env -w GOPRIVATE='github.com/<OrgNameHere>/*' | |
| https://stackoverflow.com/questions/58305567/how-to-set-goprivate-environment-variable | 
  
    
      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
    
  
  
    
  | CREATE TABLE IF NOT EXISTS public.alarmlog | |
| ( | |
| id_alarm_log bigserial NOT NULL, | |
| id_control_device bigint NOT NULL, | |
| asset_name character varying(50) NOT NULL, | |
| property_group_name character varying(50) NOT NULL, | |
| value double precision NOT NULL, | |
| unit character varying(5) NOT NULL, | |
| is_acknowledged boolean NOT NULL DEFAULT 'false', | |
| acknowledged_at double precision, | 
NewerOlder