This is a companion gist to On the lookout with SAP BTP Core services. Cis patrol | SAP Blogs.
Let's assume, we are already signed up to a SAP BTP trial account - our SAP BTP playground - and ready to be on the lookout with SAP BTP Core services.
#pull a base64 encoded files out of a kubernetes json secret | |
oc get secrets/broker-client-secret -o json | jq -r '.data."client.ts"' | base64 -d > client.ts | |
oc get secrets/broker-server-secret -o json | jq -r '.data."broker.ks"' | base64 -d > broker.ks | |
oc get secrets/broker-server-secret -o json | jq -r '.data."broker.ts"' | base64 -d > broker.ts | |
#replace base64 content in a secret - and save to file | |
THINGY=$(base64 newbroker.ks) | |
oc get secrets/il3-broker-server-secret -o json | jq -r --arg THINGY $THINGY '.data."broker.ks" = $THINGY' > my-new-secret.json |
This is a companion gist to On the lookout with SAP BTP Core services. Cis patrol | SAP Blogs.
Let's assume, we are already signed up to a SAP BTP trial account - our SAP BTP playground - and ready to be on the lookout with SAP BTP Core services.
Thus, it is possible to reuse this kyma cluster domain "as is" by adding a dedicated mutual TLS gateway.
/** | |
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
* It was requested to be introduced at as part of the jsonwebtoken library, | |
* since we feel it does not add too much value but it will add code to mantain | |
* we won't include it. | |
* | |
* I create this gist just to help those who want to auto-refresh JWTs. | |
*/ | |
const jwt = require('jsonwebtoken'); |
var pg = require('pg'), | |
url = require('url'), | |
SocksConnection = require('socksjs'); | |
var db = url.parse(process.env.REDSHIFT_CONN_STRING), | |
dbAuth = db.auth, | |
dbUsername = dbAuth.split(':')[0], | |
dbPassword = dbAuth.split(':')[1], | |
dbName = db.pathname.replace('/', ''); |
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
link.click(); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>iOS background setTimeout test - parent</title> | |
</head> | |
<body> | |
<h1>Parent</h1> | |
<button id="open-popup">Open Popup</button> |