Skip to content

Instantly share code, notes, and snippets.

View gvych's full-sized avatar

g.vyacheslav gvych

  • Russia, Saint-Petersburg
View GitHub Profile
@gvych
gvych / nginx.conf
Created July 19, 2023 15:39
NGINX logging json format (for containerization)
log_format json_combined escape=json
'{'
'"time_local":"$time_local",'
'"remote_addr":"$remote_addr",'
'"remote_user":"$remote_user",'
'"upstream_addr":"$upstream_addr",'
'"request":"$request",'
'"status": "$status",'
'"body_bytes_sent":"$body_bytes_sent",'
'"request_time":"$request_time",'
@gvych
gvych / gist:8bc2813d7ba6215b38656288ed1e4fc8
Last active January 6, 2022 14:36
curl "one-liner" for detailed network metrics of GET request
curl -w @<(echo "\n
time_namelookup: %{time_namelookup}s\n
time_connect: %{time_connect}s\n
time_appconnect: %{time_appconnect}s\n
time_pretransfer: %{time_pretransfer}s\n
time_redirect: %{time_redirect}s\n
time_starttransfer: %{time_starttransfer}s\n
----------\n
time_total: %{time_total}s\n") -s -o NULL https://ya.ru/
@gvych
gvych / _etc_nginx_nginx.conf
Created August 27, 2021 11:12
Nginx transparent proxy http->https for traffic snooping (for debugging)
server {
listen 8080 default;
proxy_ssl_server_name on;
location / {
proxy_pass https://<external_host>;
proxy_set_header Accept-Encoding "disabled";
}
}
@gvych
gvych / gist:cd1c8a5975904021d674104e73376cba
Created June 12, 2020 10:01
GitHub Actions + Amazon Managed Kubernetes (AWS EKS) cli tools installation on Linux
curl -fsSL https://github.com/derailed/k9s/releases/download/0.8.2/k9s_0.8.2_Linux_x86_64.tar.gz | tar -xvz -f - -C /usr/local/bin/ k9s
curl -fsSL https://storage.googleapis.com/kubernetes-helm/helm-v2.8.1-linux-amd64.tar.gz | \
sudo tar -xvz --strip=1 -f - -C /usr/local/bin/ linux-amd64/helm
curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
wget -O - https://get.docker.com/ | sh
mkdir -p ~/bin; cd ~/bin; curl -L https://raw.githubusercontent.com/flant/multiwerf/master/get.sh | bash
spec:
containers:
- image: ...
volumeMounts:
- mountPath: /app/config.yml
name: config-volume
subPath: config.yml
volumes:
- configMap:
defaultMode: 420
@gvych
gvych / gist:d7766150d5bfb4f812753862038deaa2
Last active July 16, 2021 17:35
Wish you were here Tabs
PART 1
^ ^ v v
E|------------|--3--3-3--3-----------3-----3-----3----|-----------------3--3--3--3--|
B|------------|--3--3-3--3-----------3-----3-----3----|-----------3--3--3--3--3--3--|
G|------------|--0--0-0--0--0--------0-----0-----0----|-----------0--0--0--0--0--0--|
D|------0--2--|----------------2--0-------------------|-----0--2--2--2--------------|
A|-0h2--------|---------------------------------------|-0h2-------------------------|
E|------------|-------------------------3-----3-----3-|-----------------------------|
@gvych
gvych / gist:f0a897fd816402b2309f0f554e2630c8
Created February 27, 2019 16:34
encrypt text using ssh-keys
Encrypt:
echo secure message to send | openssl rsautl -encrypt -oaep -pubin -inkey <(ssh-keygen -e -f ~/.ssh/id_rsa.pub -m PKCS8) | base64
O4O4V...PawicXqomdrY71Qxw==
Decrypt:
echo 'O4O4V...PawicXqomdrY71Qxw==' | base64 -d | openssl rsautl -decrypt -oaep -inkey ~/.ssh/id_rsa
Enter pass phrase for .ssh/id_rsa:
secure message to send
@gvych
gvych / keybase.md
Last active February 2, 2019 08:45

Keybase proof

I hereby claim:

  • I am gvych on github.
  • I am vyacheslav (https://keybase.io/vyacheslav) on keybase.
  • I have a public key ASDQneVVIQ7ID9HIu-Xo-FvxWplxG88IxsnUMEYGbfue-Qo

To claim this, I am signing this object:

jq '.result.items[].transactions[]| {
timestamp: .timestamp,
address: .transfers[].address,
amount: .transfers[].amount,
transactionHash: .transactionHash
} '
@gvych
gvych / gist:8334cd8a6f7ec287ec82bbab56d71071
Created May 27, 2018 07:45
Ansible dictionary with variable as name
- set_fact:
conf:
dictionary:
'{ "{{name}}": json }'