Skip to content

Instantly share code, notes, and snippets.

@ryanvgates
ryanvgates / mongorestore.sh
Last active December 14, 2020 22:00
Mongo Namespace Gotcha
mongorestore --host mongoose --ssl --username user --password password --authenticationDatabase myDB --archive=/dump_myDB.archive --gzip --nsInclude "myDB" --nsFrom "myDB" --nsTo "myDB"
2019-08-28T11:15:40.909-0400 preparing collections to restore from
2019-08-28T11:17:22.461-0400 done
mongorestore --host mongoose --ssl --username user --password password --authenticationDatabase myDB --archive=/dump_myDB.archive --gzip --nsFrom "myDB" --nsTo "myDB"
2019-08-28T11:43:53.381-0400 preparing collections to restore from
2019-08-28T11:43:53.440-0400 Failed: myDB.1359_23_10591_1290: error reading database: not authorized on myDB to execute command { listCollections: 1, cursor: { batchSize: 0 }, $db: "myDB" }
@ryanvgates
ryanvgates / shell.sh
Last active December 14, 2020 21:45
Mongo SSL Gotcha
..[ryan@local] - [~/Documents/git/repo] - [Tue Aug 27, 04:25]
..[$] <((git)-[branch]-)> mongo --host=mongohost
MongoDB shell version v4.0.3
connecting to: mongodb://mongohost:27017/
2019-08-27T16:25:35.608-0400 E QUERY [js] Error: network error while attempting to run command 'isMaster' on hmongohost:27017' : connect@src/mongo/shell/mongo.js:257:13
@(connect):1:6
exception: connect failed
@ryanvgates
ryanvgates / output.txt
Created November 12, 2019 04:58
Mongo Gotcha: use myDB from commandline successfully
..[ryan@host] - [~/Documents/git/repo] - [Mon Aug 26, 12:19]
..[$] <( (git)-[branch]-)> mongo --host=localhost --port=27017 --eval "db = db.getSiblingDB(‘myDB’); db.runCommand( { dbHash: 1 } )"
MongoDB shell version v4.0.3
connecting to: mongodb://localhost:27017/
WARNING: No implicit session: Logical Sessions are only supported on server versions 3.6 and greater.
Implicit session: dummy session
MongoDB server version: 3.2.15
WARNING: shell and server versions do not match
{
"host" : "fa34c6baf5a9",
@ryanvgates
ryanvgates / output.txt
Last active November 12, 2019 04:57
Mongo Gotcha: use myDB from commandline but get error
..[ryan@host] - [~/Documents/git/repo] - [Mon Aug 26, 12:19]
..[$] <( (git)-[branch]-) > mongo --host=localhost --port=27017 --eval 'use myDB; db.runCommand( { dbHash: 1 } )'
MongoDB shell version v4.0.3
connecting to: mongodb://localhost:27017/
WARNING: No implicit session: Logical Sessions are only supported on server versions 3.6 and greater.
Implicit session: dummy session
MongoDB server version: 3.2.15
WARNING: shell and server versions do not match
2019-08-26T12:19:38.598-0400 E QUERY [js] SyntaxError: missing ; before statement @(shell eval):1:4
@ryanvgates
ryanvgates / output.txt
Created November 12, 2019 04:49
Mongo Gotcha: use myDB from cli
..[ryan@host] - [~/Documents/git/repo] - [Mon Aug 26, 12:16]
..[$] <( (git)-[branch]-)> mongo
MongoDB shell version v4.0.3
connecting to: mongodb://127.0.0.1:27017
WARNING: No implicit session: Logical Sessions are only supported on server versions 3.6 and greater.
Implicit session: dummy session
MongoDB server version: 3.2.15
WARNING: shell and server versions do not match
> use myDB
switched to db myDB
@ryanvgates
ryanvgates / JenkinsFile
Created August 27, 2019 02:24
Sonarqube Nodejs on Windows
stage('SonarQube analysis') {
when {
branch 'dev'
}
environment {
scannerHome = tool 'SonarQube Scanner'
}
steps {
withSonarQubeEnv('my - Sonar') {
bat "${scannerHome}\\bin\\sonar-scanner.bat"
@ryanvgates
ryanvgates / bacula-dir.conf
Created July 10, 2019 14:25
Bacula: Disable Job
#Job {
# Name = "Backup-db2"
# JobDefs = "DefaultJob"
# Client = db2
#}
@ryanvgates
ryanvgates / output.txt
Created April 30, 2019 18:37
Node-gyp on windows cannot find python
F:\jenkins\workspace\workspace\api_dev-KPFG4LZGOH2GAPQCTN2RC7K2P4QXGER4MXUO7BJCCH2YI4P3JT5Q\node_modules\deasync>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program
@ryanvgates
ryanvgates / output.txt
Created April 30, 2019 18:36
Node-gyp on windows Microsoft.Cpp.Default.props not found
F:\jenkins\workspace\workspace\api_dev-KPFG4LZGOH2GAPQCTN2RC7K2P4QXGER4MXUO7BJCCH2YI4P3JT5Q\node_modules\deasync>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
F:\jenkins\workspace\workspace\api_dev-KPFG4LZGOH2GAPQCTN2RC7K2P4QXGER4MXUO7BJCCH2YI4P3JT5Q\node_modules\deasync\build\deasync.vcxproj(20,3): error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess
@ryanvgates
ryanvgates / output.txt
Created April 30, 2019 18:34
Node-gyp on windows Failed To Load CL.exe
F:\jenkins\workspace\workspace\api_dev-KPFG4LZGOH2GAPQCTN2RC7K2P4QXGER4MXUO7BJCCH2YI4P3JT5Q\node_modules\deasync>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [F:\jenkins\workspace\workspace\api_dev-KPFG4LZGOH2GAPQCTN2RC7K2P4QXGER4MXUO7BJCCH2YI4P3JT5Q\node_modules\deasync\build\deasync.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack