Skip to content

Instantly share code, notes, and snippets.

@ryanvgates
ryanvgates / Mulesoft_Setup.ps1
Last active April 2, 2019 18:20
Mulesoft AnyPoint Studio Windows PowerShell Setup
$javaDir="C:\Program Files\Java\jdk1.8.0_201"
$anypointStudioDir="C:\Program Files\AnypointStudio-for-win-64bit-7.3.2-201902012052\AnypointStudio"
$pathAddition="%JAVA_HOME%\bin;"
[Environment]::SetEnvironmentVariable("JAVA_HOME", $javaDir, "Machine");
Write-Output "Set JAVA_HOME to $env:JAVA_HOME"
[Environment]::SetEnvironmentVariable("JDK_HOME", "%JAVA_HOME%", "Machine");
Write-Output "Set JDK_HOME to $env:JDK_HOME"
@ryanvgates
ryanvgates / Jenkinsfile
Created April 26, 2019 19:32
Jenkins SonarQube MSBuild Pipelines
environment {
scannerHome = tool 'SonarQube Scanner - MSBuild'
}
steps {
withSonarQubeEnv('My - Sonar') {
echo "${scannerHome}"
bat "${scannerHome}\\SonarScanner.MSBuild.exe begin /k:{project-key} /n:{project-name} /v:build"
bat 'msbuild project.sln /t:Rebuild /p:Configuration=Release'
bat "${scannerHome}\\SonarScanner.MSBuild.exe end"
}
@ryanvgates
ryanvgates / web.config
Created April 26, 2019 20:54
JWT Lessons from Load Balancer
<configuration>
<appSettings>
</appSettings>
<system.web>
<machineKey validationKey="676389D61F63533E5135C98EF7976FD98EB5367CB631F7065A5C09C67F6F565F57E516F3F3BC36096350AB8E9911DE6113BBAB6B75056DCF3E666C75B85D135A" decryptionKey="9B951B88FF9F49E5FBC9D7C969FD679B3C99192FBB89B764" validation="SHA1" decryption="AES" />
</system.web>
<system.webServer>
</system.webServer>
<runtime>
</runtime>
@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
@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: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 / bacula-dir.conf
Created July 10, 2019 14:25
Bacula: Disable Job
#Job {
# Name = "Backup-db2"
# JobDefs = "DefaultJob"
# Client = db2
#}
@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 / 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 / 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