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
@Voronenko
Voronenko / Bash Script Header.sh
Created November 11, 2021 15:06
bash bash bash
#!/bin/bash
#!/usr/bin/env bash
@Voronenko
Voronenko / wakeup_python.sh
Created November 2, 2021 19:30
Here is a Python script that does wake on lan (if your MAC address is01-23-45-67-89-0a:
#!/usr/bin/env python
import socket
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto('\xff'*6+'\x01\x23\x45\x67\x89\x0a'*16, ('192.168.1.255', 80))
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