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 json | |
import logging | |
import boto3 | |
from botocore.exceptions import ClientError | |
from botocore.client import Config | |
import os | |
import urllib.parse | |
""" | |
Example CURL, need put and file: |
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
global | |
pidfile /var/run/haproxy.pid | |
log 127.0.0.1 local0 info | |
ulimit-n 65536 | |
defaults | |
mode http | |
clitimeout 600000 # maximum inactivity time on the client side | |
srvtimeout 600000 # maximum inactivity time on the server side |
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
c:\OpenSSL-Win64\bin\openssl.exe pkcs12 -in ???.pfx -out private+cert.pem -nodes | |
c:\OpenSSL-Win64\bin\openssl.exe pkcs7 -text -out chain.pem -print_certs -in <PKCSfile>.p7b | |
show cert | |
c:\OpenSSL-Win64\bin\openssl.exe s_client -connect www.google.com:443 | |
for /F "delims=" %a in ('dir /b /s "*.pfx"') do echo %a | |
for /F "delims=" %a in ('dir /b /s "*.pfx"') do c:\OpenSSL-Win64\bin\openssl.exe pkcs12 -in %a -out %a_private+cert.pem -nodes |
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
if [ -z $1 ] || [ -z $2 ] | |
then | |
echo "Usage: [node file] [output svg]" | |
exit 1 | |
fi | |
# https://www.brendangregg.com/blog/2014-09-17/node-flame-graphs-on-linux.html | |
# https://nodejs.org/en/docs/guides/diagnostics-flamegraph/ | |
sudo perf record -e cycles:u -g -- node --interpreted-frames-native-stack --perf-basic-prof-only-functions "$1" |
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
export ns=NAMESPACE # Change this | |
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" | |
for n in $(kubectl -n $ns get -o=name pvc,configmap,serviceaccount,secret,ingress,service,deployment,statefulset,hpa,job,cronjob) | |
do | |
echo "Exporting $n..." | |
mkdir -p $(dirname $n) | |
# old # kubectl get -o=yaml --export $n > $n.yaml | |
kubectl -n $ns get $n -o yaml | kubectl-neat > $n.yaml |
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
const https = require("https"); | |
function getReq(_url, _headers) { | |
return new Promise((ok, bad) => { | |
const headers = _headers || {}; | |
let result = { status: -1, headers: {}, body: "" }; | |
if (!_url) return bad("Please provide valid URL"); | |
try { |
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
magick convert 2.png -crop 1152x1584 +repage 2.meta-coin.pdf |
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
* git branch -a | |
* git ls-files | |
* git diff <branchA> <branchB> -- <file> | |
* git diff CI_CD remote_data -- | |
git ls-files | grep -vE "yarn\.lock|package-lock\.json" | xargs -L1 -d '\n' git --no-pager diff remotes/origin/remote_data remotes/origin/CI_CD -- >> diff.diff | |
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
npm install -g underscore-cli | |
underscore help | |
underscore --wrapwidth 75 pretty < input.json |
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
const csv_safe_quote = '"'; | |
const csv_safe_escapedQuote = '""""'; | |
function safe_csv_item(item:any) : string { | |
try { | |
if (item === "") { | |
return '""' | |
} | |
// Force string: |