Skip to content

Instantly share code, notes, and snippets.

View Voronenko's full-sized avatar
turning coffee into code since late 90s

Vyacheslav Voronenko

turning coffee into code since late 90s
View GitHub Profile
An error occurred (InvalidClientTokenId) when calling the ListAccountAliases operation: The security token included in the request is invalid.
Run the sts get-session-token AWS CLI command, replacing the variables with information from your account, resources, and MFA device:
$ aws sts get-session-token --serial-number arn-of-the-mfa-device --token-code code-from-token
You receive an output with temporary credentials and an expiration time (by default, 12 hours) similar to the following:
{
"Credentials": {
import sys
!conda install --yes --prefix {sys.prefix} pymongo
# HELP node_nslookup dns lookup time in ms
# TYPE node_nslookup gauge
node_nslookup{ns="1.2.3.4",record="api.cloudpayments.ru"} 0
node_nslookup{ns="8.8.8.8",record="api.cloudpayments.ru"} 15
mknod /dev/null c 1 3
chmod 666 /dev/null
#!/bin/bash
git ls-files --others --ignored --exclude-from=.gitignore
TL;DR — For TLS certificates issued by Let’s Encrypt, the root certificate (DST Root CA X3) in the default chain expires on September 30, 2021. Due to their unique approach, the expired certificate will continue to be part of the certificate chain till 2024. This affects OpenSSL 1.0.2k on RHEL/CentOS 7 servers, and will result in applications/tools failing to establish TLS/HTTPS connections with a certificate has expired message.
As of 24/9/21, upgrading ca-certificates package (2021.2.50–72) should fix the issue. Version 2021.2.50–72 removes DST Root CA X3.
As of 17/9/21, the only available solution is to blacklist the root certificate as follows,
trust dump --filter "pkcs11:id=%c4%a7%b1%a4%7b%2c%71%fa%db%e1%4b%90%75%ff%c4%15%60%85%89%10" | openssl x509 | sudo tee /etc/pki/ca-trust/source/blacklist/DST-Root-CA-X3.pem
sudo update-ca-trust extract
@Voronenko
Voronenko / dashbord-to-jsonnet.py
Created September 30, 2021 11:05 — forked from tennix/dashbord-to-jsonnet.py
Convert Grafana dashboard json to jsonnet
#!/usr/bin/env python
import json
from jinja2 import Template
# git clone https://github.com/pingcap/tidb-docker-compose
# cd tidb-docker-compose
# git clone https://github.com/tennix/grafonnet-lib -b table
# python dashboard-to-jsonnet.py > pd.jsonnet
# jsonnet -J grafonnet-lib pd.jsonnet > config/dashboards/generated-pd.json
with open('config/dashboards/pd.json', 'r') as f:
data = json.load(f)
apk --update --no-cache add busybox-extras
By mogła zapanować Równość,
trzeba wpierw wdeptać wszystkich w gówno;
by człowiek był człowieka bratem,
trzeba go wpierw przećwiczyć batem;
wszystko mu także się odbierze,
by mógł własnością gardzić szczerze.
Ubranko w paski, taczka, kilof
niezwykle życie ci umilą,
a gdy już znajdziesz się za drutem,
opuści troska cię i smutek
<powershell>
Set-Location c:\gitlab-runner
Import-Module ./register-runner.ps1
$env:CACHE_TYPE = 's3'
$env:CACHE_SHARED = 'true'
$env:CACHE_S3_SERVER_ADDRESS = 's3.SPECIFY_REGION.amazonaws.com'
$env:CACHE_S3_BUCKET_NAME= 'SPECIFY_UNIQUE_NAME'
$env:CACHE_S3_BUCKET_LOCATION = 'SPECIFY_REGION'
$env:CACHE_PATH = 'cache'