goto linode dashboard > node
1st, setting > shutdown watchdog > disable
second, boot into rescue mode
disclaimer: i'm not responsible for any problems with your system (but you may contact me)
mkdir /mnt/r
| import stream from 'stream'; | |
| const mime = require('mime-types'); | |
| import aws from 'aws-sdk'; | |
| import multer from 'multer'; | |
| import multerS3 from 'multer-s3'; | |
| multer({ | |
| //..., | |
| storage: multerS3({ |
| const { find2 } = require('../controllers/category') | |
| module.exports = { | |
| definition: ` | |
| type Category2 { | |
| id: ID! | |
| created_at: DateTime! | |
| updated_at: DateTime! | |
| Title: String | |
| Icon: String |
goto linode dashboard > node
1st, setting > shutdown watchdog > disable
second, boot into rescue mode
disclaimer: i'm not responsible for any problems with your system (but you may contact me)
mkdir /mnt/r
| const auth: any = context.auth || {} | |
| if (!auth || !auth.uid) { | |
| //not logged in | |
| } | |
| let authUser = await admin.auth().getUser(auth.uid) |
| exports = function(changeEvent) { | |
| console.log("changed", changeEvent.operationType, JSON.stringify(Object.keys(changeEvent))) | |
| //allows replace and create | |
| if(changeEvent.operationType == "update") { | |
| let keys = Object.keys(changeEvent.updateDescription.updatedFields) | |
| console.log("changed", JSON.stringify(Object.keys(changeEvent.updateDescription.updatedFields))) | |
| if(keys.indexOf('created_at') > -1 || keys.indexOf('updated_at') > -1 || keys.length == 0) { | |
| //changed fields contains created_at or updated_at | |
| // on $set, it will trigger "update" | |
| console.log("ignoring change") |
| module.exports = { | |
| root: true, | |
| env: { | |
| browser: true, | |
| node: true | |
| }, | |
| parser: 'vue-eslint-parser', | |
| parserOptions: { | |
| 'parser': '@typescript-eslint/parser', | |
| 'ecmaVersion': 2017, |
| version: "3.2" | |
| services: | |
| logrotate: | |
| image: blacklabelops/logrotate | |
| restart: unless-stopped | |
| volumes: | |
| - "/home/yourpathtolog:/log" | |
| - "./logrotate-status:/logrotate-status" | |
| environment: | |
| - "LOGS_DIRECTORIES=/log" |
| version: "3.2" | |
| services: | |
| dzero: | |
| image: dgraph/dgraph:v1.0.10 | |
| volumes: | |
| - "./dgraph0:/dgraph" | |
| ports: | |
| - 5080:5080 | |
| - 6080:6080 | |
| restart: on-failure |
Dgraph is a graph databases. It stores data in a similar fashion for any type of collections. To differentiate the collection list, we may add a predicate, let's say "_type" indicate the type of collection / table. Example: User will have _type='users' and Role will have _type='roles'. ID field in dgraph is named "uid"
| package main | |
| import ( | |
| "fmt" | |
| "reflect" | |
| ) | |
| type X struct { | |
| Name string | |
| Values *[]Y |