# sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
or
# gitlab-rails dbconsole --database main
gitlabhq_production=# insert into users (name, username, email, notification_email, projects_limit, state, created_at, confirmed_at) values ('Name Surname', 'userlogin',
After that password can be restored via password recovery procedure.
Set user admin permissions:
gitlabhq_production=# UPDATE users SET admin = 't' WHERE email like
Links:
https://docs.gitlab.com/ee/security/reset_user_password.html
-----------------------
from
https://discuss.newrelic.com/t/creating-soap-request-using-the-api-scripting-language/28167
Goal : to make it work in newrelic
curl -X POST -F <data1> -F <data2> -F <data3> <URI>
Find substring 'Successful' on the result page
-------------------
API test should be created in newrelic. Code:
var assert = require('assert');
var options = {
body: "field1=data1&field2=data2",
headers: {
'Content-Type': 'application/x-www-formurlencoded'
}
};
//Define expected results using callback function.
function callback(error, response, body) {
//Log status code to Synthetics console.
console.log(response.statusCode + " status code")
//Verify endpoint returns 200 (OK) response code.
var match_result = body.match(/Successful/);
assert.ok((response.statusCode == 200) && (match_result != null), 'Expected 200 OK response and "Successful" on the page');
//Log end of script.
console.log("End reached");
}
$http.post(options, callback);
https://habr.com/ru/company/flant/blog/420055/
https://borgbackup.readthedocs.io/en/stable/installation.html
1. install borg on both backup server and client :
portsnap fetch update ; portmaster -Dbg archivers/py-borgbackup
2. Add user on server
# pw user add -n borg -m -s /sbin/nologin
3. on client generate ssh key :
# ssh-keygen -b 4096
4. on server add key :
# cd /home/borg//.ssh
# echo 'command="/usr/local/bin/borg serve" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNdaDfqUUf/XmSVWfF7PfjGlbKW00MJ63zal/E/mxm+vJIJRBw7GZofe1PeTpKcEUTiBBEsW9XUmTctnWE6p21gU/JNU0jITLx+vg4IlVP62cac71tkx1VJFMYQN6EulT0alYxagNwEs7s5cBlykeKk/QmteOOclzx684t9d6BhMvFE9w9r+c76aVBIdbEyrkloiYd+vzt79nRkFE4CoxkpvptMgrAgbx563fRmNSPH8H5dEad44/Xb5uARiYhdlIl45QuNSpAdcOadp46ftDeQCGLc4CgjMxessam+9ujYcUCjhFDNOoEa4YxVhXF9Tcv8Ttxolece6y+IQM7fbDR' > authorized_keys
# chown -R borg:borg /home/borg/.ssh/
5. on client init repo
# borg init -e none ssh:
6. on client run first backup :
# borg create --stats --list ssh://borg@host:port/path/to/backup::"MyFirstBackup-{now:%Y-%m-%d_%H:%M:%S}" /etc /root /usr/local/etc
------------------
List backups
on client machine :
borg list ssh://borg@host:port/path/to/backups
on server :
borg list /path/to/backups
-----------------
List files in backups :
borg list /path/to/backups::MyBackup-<date>
-------------
Extract file or directory from backup (on server) :
borg extract /path/to/backups::MyBackup-<date> etc/hostname
------------