muscaiu
8/28/2019 - 6:27 PM

postgresql

{"lastUpload":"2020-02-25T06:12:54.814Z","extensionVersion":"v3.4.3"}
[
  {
    "metadata": {
      "id": "e337c67b-55c2-4fef-8949-eb260e7fb7fd",
      "publisherId": "Shan.code-settings-sync",
      "publisherDisplayName": "Shan"
    },
    "name": "code-settings-sync",
    "publisher": "Shan",
    "version": "3.4.3"
  },
  {
    "metadata": {
      "id": "19804510-b475-4dae-b0f7-6ca08fd1af0c",
      "publisherId": "dsznajder.es7-react-js-snippets",
      "publisherDisplayName": "dsznajder"
    },
    "name": "es7-react-js-snippets",
    "publisher": "dsznajder",
    "version": "2.6.0"
  },
  {
    "metadata": {
      "id": "a1c4713c-cd10-4fbb-9c13-c3adec03b40f",
      "publisherId": "humy2833.ftp-simple",
      "publisherDisplayName": "humy2833"
    },
    "name": "ftp-simple",
    "publisher": "humy2833",
    "version": "0.7.5"
  },
  {
    "metadata": {
      "id": "5960f38e-0bbe-4644-8f9c-9c8824e82511",
      "publisherId": "donjayamanne.githistory",
      "publisherDisplayName": "donjayamanne"
    },
    "name": "githistory",
    "publisher": "donjayamanne",
    "version": "0.5.3"
  },
  {
    "metadata": {
      "id": "4de763bd-505d-4978-9575-2b7696ecf94e",
      "publisherId": "eamodio.gitlens",
      "publisherDisplayName": "eamodio"
    },
    "name": "gitlens",
    "publisher": "eamodio",
    "version": "10.2.1"
  },
  {
    "metadata": {
      "id": "5db78037-f674-459f-a236-db622c427c5b",
      "publisherId": "PKief.material-icon-theme",
      "publisherDisplayName": "PKief"
    },
    "name": "material-icon-theme",
    "publisher": "PKief",
    "version": "3.9.3"
  },
  {
    "metadata": {
      "id": "69b16d69-4e4e-4669-934c-daa646794c37",
      "publisherId": "dcasella.monokai-plusplus",
      "publisherDisplayName": "dcasella"
    },
    "name": "monokai-plusplus",
    "publisher": "dcasella",
    "version": "1.8.0"
  },
  {
    "metadata": {
      "id": "f1f59ae4-9318-4f3c-a9b5-81b2eaa5f8a5",
      "publisherId": "ms-python.python",
      "publisherDisplayName": "ms-python"
    },
    "name": "python",
    "publisher": "ms-python",
    "version": "2020.2.64397"
  },
  {
    "metadata": {
      "id": "d7b592dd-41c9-4f2b-acf3-055ae65e55c6",
      "publisherId": "dzannotti.vscode-babel-coloring",
      "publisherDisplayName": "dzannotti"
    },
    "name": "vscode-babel-coloring",
    "publisher": "dzannotti",
    "version": "0.0.4"
  },
  {
    "metadata": {
      "id": "583b2b34-2c1e-4634-8c0b-0b82e283ea3a",
      "publisherId": "dbaeumer.vscode-eslint",
      "publisherDisplayName": "dbaeumer"
    },
    "name": "vscode-eslint",
    "publisher": "dbaeumer",
    "version": "2.1.1"
  },
  {
    "metadata": {
      "id": "c46b0018-f317-4b6c-a785-d2039b27338f",
      "publisherId": "wix.vscode-import-cost",
      "publisherDisplayName": "wix"
    },
    "name": "vscode-import-cost",
    "publisher": "wix",
    "version": "2.12.0"
  },
  {
    "metadata": {
      "id": "06cc3e44-aedb-41b8-a4ea-29ebf3c491fd",
      "publisherId": "jpoissonnier.vscode-styled-components",
      "publisherDisplayName": "jpoissonnier"
    },
    "name": "vscode-styled-components",
    "publisher": "jpoissonnier",
    "version": "0.0.28"
  },
  {
    "metadata": {
      "id": "3262c42b-a248-4b97-9f4d-5a6812bac132",
      "publisherId": "midnightsyntax.vscode-wrap-console-log",
      "publisherDisplayName": "midnightsyntax"
    },
    "name": "vscode-wrap-console-log",
    "publisher": "midnightsyntax",
    "version": "1.7.2"
  }
]
c9a9fc61a2940b4575086201867a7b4e5385fbea0e8eb0edab0600371f8e2178418312d5a7f8a7a9932002d69b2c5f2e7101324039b9d570174723358b2a63050085827f3226f49108d73e2d012ba9880ae8aaffeffaa4e78ca54d450ef343a1a0466e546a7531cdbf4326ddac5fccc6e46a385c0d99fcc71e0d67d94f09e5a1
{
  "name": "power-meeter",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}
{
  "name": "scanner-temp",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "homebridge-mi-hygrothermograph": "^2.2.1"
  }
}
{
  "name": "sonoff-pump-api",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "nodemon --exec babel-node src/index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "Cristian Muscalu <muscaiu@yahoo.com> (cristian.muscalu.net)",
  "license": "MIT",
  "devDependencies": {
    "@babel/cli": "^7.4.4",
    "@babel/core": "^7.4.5",
    "@babel/node": "^7.4.5",
    "@babel/preset-env": "^7.4.5",
    "nodemon": "^1.19.1"
  },
  "dependencies": {
    "axios": "^0.19.0",
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "cron": "^1.7.1",
    "dotenv": "^8.0.0",
    "express": "^4.17.1",
    "http": "0.0.0",
    "mongoose": "^5.5.11",
    "nano": "^8.1.0",
    "pg": "^7.11.0",
    "sequelize": "^5.8.12",
    "uuid": "^3.3.2"
  }
}
c9a9fc61a2940b4575086201867a7b4edca840d42a0d8ec3c16c886654d1095c86817bc73fc1b81e37cffc12d7dc64cf72bd145873e5cd3c0ddb2d8df486c7d5c414f21c1228ac50e86a5ad634276c8fb40491bf322c7f7fa93203c09c9dcdb6ef34bc5227136d8110d38946400bb269e395d837b5eb4fe40441021753460624b74facd4e84809e624f85de7cb9561b2b12f42a7523a5209d45dc46252c6f8af2535961264fabc5a5d6b4521b960369921bdd2549a810de8852a91897561eff933ffd83d40751028fd4679cf2cedabcb82d4b1c71f536847ecb1c93649a4be7961badd27a310f890262251246807167999f2605101f42254f3d9dc770ba34fae54fc7aab03389b53758e25375619f985
{
  "name": "home-automation-api",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "nodemon --exec babel-node src/index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Cristian Muscalu <muscaiu@yahoo.com> (cristian.muscalu.net)",
  "license": "MIT",
  "devDependencies": {
    "@babel/cli": "^7.7.7",
    "@babel/core": "^7.7.7",
    "@babel/node": "^7.7.7",
    "@babel/preset-env": "^7.7.7",
    "nodemon": "^1.19.4"
  },
  "dependencies": {
    "axios": "^0.19.0",
    "cron": "^1.7.2",
    "dotenv": "^8.2.0",
    "express": "^4.17.1",
    "firebase-admin": "^8.9.0",
    "homebridge-mi-hygrothermograph": "^2.3.2",
    "pg": "^7.11.0",
    "sequelize": "^5.21.3",
    "socket.io": "^2.3.0",
    "winston": "^3.2.1"
  }
}
// Place your key bindings in this file to overwrite the defaults
[
  {
    "key": "ctrl+l",
    "command": "console.log.wrap.down.prefix",
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+alt+w ctrl+alt+down",
    "command": "-console.log.wrap.down.prefix",
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+alt+w ctrl+alt+w",
    "command": "-console.log.wrap.prefix",
    "when": "editorTextFocus"
  }
]
{
    "workbench.colorTheme": "Monokai",
    "workbench.iconTheme": "material-icon-theme",
    "window.zoomLevel": -1,
    "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
    "git.enableSmartCommit": true,
    "window.menuBarVisibility": "default",
    "workbench.activityBar.visible": true,
    "editor.minimap.enabled": false,
    "editor.tabSize": 2,
    "[javascriptreact]": {},
    "emmet.includeLanguages": {
        "javascript": "html"
    },
    "explorer.confirmDelete": false,
    "gitlens.advanced.messages": {
        "suppressCommitHasNoPreviousCommitWarning": false,
        "suppressCommitNotFoundWarning": false,
        "suppressFileNotUnderSourceControlWarning": false,
        "suppressGitVersionWarning": false,
        "suppressLineUncommittedWarning": false,
        "suppressNoRepositoryWarning": false,
        "suppressUpdateNotice": false,
        "suppressWelcomeNotice": true
    },
    "git.autofetch": true,
    "gitlens.keymap": "alternate",
    "explorer.confirmDragAndDrop": false,
    "javascript.updateImportsOnFileMove.enabled": "always",
    "remote.onstartup": true,
    "references.preferredLocation": "view",
    "sync.gist": "dc6b4080f481c9045d406b273e1af6e5",
    "sync.autoDownload": false,
    "sync.autoUpload": false,
    //-------- Remote VSCode configuration --------
    // Port number to use for connection.
    // "remote.port": 52698,
    // Launch the server on start up.
    // "remote.onstartup": true,
    // Address to listen on.
    // "remote.host": "127.0.0.1",
    // If set to true, error for remote.port already in use won't be shown anymore.
    // "remote.dontShowPortAlreadyInUseError": false
}
{
    "Print to console": {
        "prefix": "c",
        "body": [
            "console.log('$1');",
            "$2"
        ],
        "description": "Log output to console"
    }
    /*
    	 // Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and 
    	 // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
    	 // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
    	 // same ids are connected.
    	 // Example:
    	 "Print to console": {
    		"prefix": "log",
    		"body": [
    			"console.log('$1');",
    			"$2"
    		],
    		"description": "Log output to console"
    	}
    */
}
{"version":"7.13.0","status":2,"welcomeShown":true}
Alsways istalll a specific version :::
apt-get install postgresql-12

tutorial:
https://dataslinger.medium.com/setting-up-remote-postgresql-on-raspberry-pi-f9058b415768
connect with pgadmin tutorial:
https://tecadmin.net/postgresql-allow-remote-connections/

Change default password (default password is unset):
sudo -u postgres psql
postgres=# \password postgres
Enter new password: <new-password>
postgres=# \q

Commands:
Restart psql:
sudo service postgresql restart
sudo /etc/init.d/postgresql restart

Copy db from Mac to PI:
pg_dump -C portofoliov3 | ssh -C postgres@192.168.1.100 "portofoliov3"

Get psql location:
psql
SHOW hba_file;
MAC: /opt/homebrew/var/postgres
PI: /etc/postgresql/13/main/pg_hba.conf

BACKUP and RESTORE using pgdamin:
BAckup on mac desktop and restore it. easy.

Build prod command:
DATABASE_URL=$DATABASE_URL NODE_ENV=production npm run build