Skip to content

Instantly share code, notes, and snippets.

@mathiasmag

mathiasmag/_VC Setup

Last active May 13, 2020
Embed
What would you like to do?
VC Setup
This sets up VC
#!/bin/sh
HOST=$1
WALLET=$2
PWD=$3
BUNDLE=$(openssl version -d|cut -d \" -f2)/cert.pem
# Grab all certs from a site -> Send STDERR to /dev/null
# Send STDERR to a file
# Keep just the first line from the file
# Reverse the string as "cut" cannot return the last field
# Cut the first field (the Common Name for the certificate)
# Reverse the string back to it's origin
CERT=$(echo QUIT|openssl s_client -connect ${HOST}:443 -showcerts >/dev/null 2> /tmp/mycert;head -1 /tmp/mycert|rev|cut -f1 -d=|rev|xargs)
# Grab the certificate from the certificate bundle, onle the part from BEGIN to END
sed -n "/${CERT}/,/^-----END CERTIFICATE-----$/p" ${BUNDLE} | sed -n "/^-----BEGIN CERTIFICATE-----/,/^-----END CERTIFICATE-----$/p" > /tmp/cert.txt
# Add the extracted root certificate to the Oracle Wallet
orapki wallet add -wallet ${WALLET} -trusted_cert -pwd $PWD -cert /tmp/cert.txt
# Remove work files
rm /tmp/mycert /tmp/cert.txt
#/usr/bin/sh
Generated with: code --list-extensions | xargs -L 1 echo code --install-extension
code --install-extension chris-rimmer.liquibase-snippets
code --install-extension donjayamanne.githistory
code --install-extension eamodio.gitlens
code --install-extension formulahendry.auto-close-tag
code --install-extension formulahendry.code-runner
code --install-extension gerane.Theme-Blackboard
code --install-extension ms-azuretools.vscode-docker
code --install-extension ms-python.python
code --install-extension Oracle.oracledevtools
code --install-extension PKief.material-icon-theme
code --install-extension vsls-contrib.gistfs
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+enter",
"command": "workbench.action.terminal.runSelectedText"
}
]
{
"workbench.colorTheme": "Blackboard",
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"oracleDeveloperTools.networkConfiguration.configFilesLocation": "/Users/xxxxxxxxxx/Oracle/network/admin",
"oracleDeveloperTools.networkConfiguration.walletFileLocation": "/Users/xxxxxxxxxx/Oracle/network/admin",
"code-runner.executorMapByFileExtension": {
".sql": "./_run_sql.sh"
},
"git.confirmSync": false,
"git.autofetch": true,
"window.zoomLevel": 0,
"breadcrumbs.enabled": true,
"editor.multiCursorModifier": "ctrlCmd",
"explorer.confirmDragAndDrop": false,
"git.inputValidationSubjectLength": 120,
"git.enableSmartCommit": true,
"editor.detectIndentation": false,
"editor.tabSize": 2,
"editor.tabCompletion": "on",
"oracleDeveloperTools.logging.enable": true,
"oracleDeveloperTools.logging.level": "Information",
"editor.fontSize": 12,
"workbench.iconTheme": "material-icon-theme",
"extensions.ignoreRecommendations": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.