This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#######b. ### ### .d####b.########################b d############## | |
### Y##b### ###d##P Y##b ### ### ####b d#### ### | |
### ###### ###Y##b. ### ### #####b.d##### ### | |
### d##P### ### "Y###b. ### ####### ###Y#####P### ### | |
#######P" ### ### "Y##b. ### ### ### Y###P ### ### | |
### T##b ### ### "### ### ### ### Y#P ### ### | |
### T##b Y##b. .d##PY##b d##P ### ### ### " ### ### | |
### T##b "Y#####P" "Y####P" ### ### ### ### ### | |
# ignore = [] # Skip formatting the specified files and directories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 = Success | |
1 = Operation not permitted | |
2 = No such file or directory | |
3 = No such process | |
4 = Interrupted system call | |
5 = Input/output error | |
6 = No such device or address | |
7 = Argument list too long | |
8 = Exec format error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting a random free tcp port in python using sockets | |
def get_free_tcp_port(): | |
tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
tcp.bind(('', 0)) | |
addr, port = tcp.getsockname() | |
tcp.close() | |
return port | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.hazmat.primitives.asymmetric import rsa | |
from cryptography.hazmat.primitives import serialization | |
from cryptography.hazmat.primitives import hashes | |
from cryptography.hazmat.primitives.asymmetric import padding | |
def utf8(s: bytes): | |
return str(s, 'utf-8') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
00D1E5 | |
0111E | |
0115 | |
011ED | |
011F1E1D | |
011F1E1D5 | |
015E | |
01AF | |
01D1E |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cryptography.hazmat.primitives.asymmetric.ed25519 import ( | |
Ed25519PrivateKey, | |
Ed25519PublicKey, | |
) | |
from cryptography.hazmat.primitives import serialization | |
private_key = Ed25519PrivateKey.generate() | |
public_key = private_key.public_key() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for json in $(kubectl get svc -o json | jq -c '.items[] | select(.kind == "Service") | {name:.metadata.name, port:.spec.ports[0].port}'); do | |
service=$(echo "${json}" | jq .name | tr -d '"') | |
remote_port=$(echo "${json}" | jq .port | tr -d '"') | |
local_port=$((remote_port)) | |
if [ $((local_port)) -lt 1024 ]; then | |
local_port=$((local_port + 8000)) | |
fi | |
echo kubectl port-forward "service/${service}" "${local_port}:${remote_port}" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--ignore-dir=node_modules/ | |
--ignore-dir=.venv/ | |
--ignore-dir=.venv | |
--ignore-dir=*.egg-info | |
--ignore-dir=... | |
--ignore-dir=.caches | |
--ignore-dir=man | |
--color-colno=137 | |
--type-add=rs=.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -exu |
NewerOlder