Prometheus is a time-series db, it's query language called PromQL.
Here are some analogies from SQL which may help to understand the basics of PromQL better:
- metric ~ sql table
- label ~ sql column
- Count how many containers running on each node:
#!/usr/bin/env python3 | |
# Currently works for 0.12.x | |
# | |
# TODO: | |
# - use json output instead of stdout | |
# | |
# Usage: | |
# terraform plan > plan.out | |
# python terraform-import-statement-guesser.py plan.out | |
import sys |
choco list -lo -r -y | % { $_.Split('|') | select -First 1 } | % { "choco install " + $_ + " -y" } | |
choco list -lo -r -y | % { $_.Split('|') | select -First 1 } | % { "choco install " + $_ + " -y" } | Out-file choco-software.txt |
/// ... somewhere in your cmdlet (might need to be PSCmdlet?) | |
private const BindingFlags BindingFlags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public; | |
// provided you have a tasty function to reflect private fields/properties | |
protected object TryGetProperty(object instance, string fieldName) { | |
// any access of a null object returns null. | |
if (instance == null || string.IsNullOrEmpty(fieldName)) { | |
return null; | |
} |
echo -----BEGIN CERTIFICATE----- > encoded.txt | |
echo Just Base64 encode your binary data | |
echo TVoAAA== >> encoded.txt | |
echo -----END CERTIFICATE----- >> encoded.txt | |
certutil -decode encoded.txt decoded.bin |
sudo apt-get install apt-transport-https ca-certificates
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt-get update
sudo apt-get install syncthing
sudo apt-get install git
Syncthing: https://syncthing.net/
Syncthing is a free, open-source peer-to-peer file synchronization application available for Windows, Mac, Linux, Android, Solaris, Darwin, and BSD. It can sync files between devices on a local network, or between remote devices over the Internet. Data security and data safety are built into the design of the software.
This is written using Linux Mint 21.2 x86_64 using kernel 5.15.0-89-generic.
I couldn't find good directions for doing this, so here we go.
$ uname -r
#!/usr/bin/env bash | |
# ensure we were given two command line arguments | |
if [[ $# -ne 2 ]]; then | |
echo 'usage: vault-cp SOURCE DEST' >&2 | |
exit 1 | |
fi | |
source=$1 | |
dest=$2 |