(wherever it says url.com, use your server's domain or IP)
Login to new server as root, then add a deploy user
sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy
And Update the new password
# List databases | |
sudo su postgres | |
psql | |
\list | |
# Create a compressed backup | |
sudo su postgres | |
pg_dump -Fc <database_name> > <file> | |
# Example |
DUMP | |
// pod-name name of the postgres pod | |
// postgres-user database user that is able to access the database | |
// database-name name of the database | |
kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql | |
RESTORE | |
// pod-name name of the postgres pod | |
// postgres-user database user that is able to access the database | |
// database-name name of the database |
(wherever it says url.com, use your server's domain or IP)
Login to new server as root, then add a deploy user
sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy
And Update the new password
var onevent = socket.onevent; | |
socket.onevent = function (packet) { | |
var args = packet.data || []; | |
onevent.call(this, packet); | |
console.log('packet', packet.data); | |
}; |
POSTGRES_USER=sonar | |
POSTGRES_PASSWORD=sonar | |
POSTGRES_DB=sonarqube |
//Actual promise function that retuns a promise | |
function defer() { | |
var res, rej; | |
var promise = new Promise((resolve, reject) => { | |
res = resolve; | |
rej = reject; | |
}); | |
promise.resolve = res; |
'use strict'; | |
module.exports = function(app) { | |
/* | |
* The `app` object provides access to a variety of LoopBack resources such as | |
* models (e.g. `app.models.YourModelName`) or data sources (e.g. | |
* `app.datasources.YourDataSource`). See | |
* https://loopback.io/doc/en/lb3/Working-with-LoopBack-objects.html | |
* for more info. | |
*/ |
//Importing the db structure for default apps | |
var appModels = ['User', 'AccessToken', 'ACL', 'RoleMapping', 'Role']; | |
var ds = app.dataSources.postgres; | |
ds.isActual(appModels, function (err, actual) { | |
if (!actual) { | |
ds.autoupdate(appModels, function (err) { | |
if (err) throw (err); | |
}); | |
} |
ref.orderByChild('key').equalTo('something').once('value') | |
.then(function (snap) { | |
snap.forEach(function (snap) { | |
if (item.key === '-LTRAB3DKkK4FC765') { | |
snap.remove(); | |
} | |
}); | |
}); |
code --list-extensions | xargs -L 1 echo code --install-extension |