Ref: https://github.com/diesire/git_bash_windows_powerline
cd $HOME
mkdir -p .bash/themes/git_bash_windows_powerline
git clone https://github.com/diesire/git_bash_windows_powerline.git .bash/themes/git_bash_windows_powerline
Ref: https://github.com/diesire/git_bash_windows_powerline
cd $HOME
mkdir -p .bash/themes/git_bash_windows_powerline
git clone https://github.com/diesire/git_bash_windows_powerline.git .bash/themes/git_bash_windows_powerline
let _Namespace = "namespace_name"; | |
let _ServiceName = "deployment_name"; | |
KubePodInventory | |
| where Namespace == _Namespace | |
| where ContainerName has_cs _ServiceName | |
| distinct ContainerID | |
| join kind=inner ContainerLog on ContainerID | |
| where LogEntry has '"type":"http-access"' // filtering out only the http access logs | |
| extend parsedLog=parse_json(LogEntry) | |
| extend latencyMs=todouble(parsedLog.responseTimeMs), |
let _Namespace = "namespace_name"; | |
let _ServiceName = "deployment_name"; | |
let _ContainerName = "container_name"; // required only if the Pod has multiple containers (eg. Sidecars) | |
let _BinSize = 1hr; // 5min, 0.5d, 2d, ... | |
let _ResourceLimitCounterName = 'cpuLimitNanoCores'; | |
let _ResourceUsageCounterName = 'cpuUsageNanoCores'; | |
KubePodInventory | |
| where Namespace == _Namespace | |
| where ServiceName == _ServiceName | |
| where ContainerName has _ContainerName |
let _Namespace = "Your namespace"; | |
let _ServiceName = "Your Deployment name"; | |
let _ContainerName = "Specific Container name"; // Only required if you have multiple containers running (eg. Sidecar) | |
KubePodInventory | |
| where isnotempty(Computer) // eliminate unscheduled pods | |
| where PodStatus in ('Running') | |
| where ServiceName has _ServiceName | |
| where ContainerName has _ContainerName | |
| where Namespace == _Namespace | |
| extend ContainerIdentifier=tostring(split(ContainerName, '/')[1]) |
let _Namespace = "Your Namespace"; | |
let _ServiceName = "Name of your deployment"; | |
let _ContainerName = "Name of the container"; // Only required if you have multiple containers in the Pod (ie. Sidecars) | |
KubePodInventory | |
| project ContainerID, ContainerName, Namespace | |
| where Namespace == _Namespace | |
| where ServiceName == _ServiceName | |
| where ContainerName hasprefix_cs _ContainerName | |
| distinct ContainerID | |
| join kind=inner ContainerLog on ContainerID |
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert-name.pem |
using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
const fs = require("fs"); | |
const FILE = "sample.txt"; | |
// Writes given text to a file asynchronously. | |
// Returns a Promise. | |
function write(text) { | |
return new Promise((resolve, reject) => { | |
fs.writeFile(FILE, text, err => { | |
if (err) reject(err); | |
else resolve(); |
const myPromise = new Promise((resolve, reject) => { | |
// do something asynchronous which eventually calls either: | |
// | |
// resolve(someValue); // when fulfilled | |
// or | |
// reject("failure reason"); // upon failure or rejection | |
}); |
const fs = require("fs"); | |
const FILE = "sample.txt"; | |
// This function returns a promise that the 'text' we pass into | |
// this function has been asynchrnously written into our FILE. | |
const writePromise = text => { | |
return new Promise((resolve, reject) => { | |
fs.writeFile(FILE, text, err => { | |
if (err) reject(err); | |
else resolve(); |