Skip to content

Instantly share code, notes, and snippets.

View pyhedgehog's full-sized avatar

PyHedgehog pyhedgehog

View GitHub Profile
@pyhedgehog
pyhedgehog / wsl-error.pml.b64
Created November 10, 2023 11:52
WSL-openssh-error
This file has been truncated, but you can view the full file.
UE1MXwkAAAABAAAARgBSAEkAVABUAEUAUgAAAAAAAAAAAAAAAAAAAAAAAABDADoAXABXAEkATgBE
AE8AVwBTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApOUAAAAA
@pyhedgehog
pyhedgehog / vym2json.sh
Last active October 20, 2023 16:27
vym2json.sh
unzip -p 20231020.vym map.xml \
| xq . \
| jq '
def branches:
if type=="array" then . else [.] end|
map(.key=.heading["#text"]|
.value=(.branch? // []|branches))|
if length==0 then null
elif all(.value|length==0) then map(.key)
else from_entries end
@pyhedgehog
pyhedgehog / saltcorn-qrcode.json
Created September 4, 2023 03:24
saltcorn-qrcode helper
{"success":[{"name":"saltcorn-qrcode","source":"npm","location":"saltcorn-qrcode","description":"Allow to view URL (or any string field) as a QR-Code image"}]}
// ==UserScript==
// @name Show edit button on Saltcorn wiki page
// @id [email protected]
// @namespace https://gist.github.com/pyhedgehog/
// @description Show edit button on Saltcorn wiki page
// @homepage https://gist.github.com/pyhedgehog/82f3431d3288abbd467204f5d9340c02/
// @downloadURL https://gist.github.com/pyhedgehog/82f3431d3288abbd467204f5d9340c02/raw/editWikiSaltcornCom.user.js
// @updateURL https://gist.github.com/pyhedgehog/82f3431d3288abbd467204f5d9340c02/raw/editWikiSaltcornCom.meta.js
// @match https://wiki.saltcorn.com/view/ShowPage/*
// @match https://wiki.saltcorn.com/view/ShowPage?*
@pyhedgehog
pyhedgehog / service-logs.sh
Last active December 2, 2020 16:44
Sample docker command to show healthcheck log for local container of specified service
docker inspect -f '{{if .State.Health}}{{if ne (.State.Health.Log|len) 1}}{{range $l:=.State.Health.Log}}[{{$l.End}}] {{if eq $l.ExitCode 0}}{{"\x1b[32msuccess\x1b[0m"}}{{else}}{{"\x1b[31mfailed="}}{{$l.ExitCode}}{{"\x1b[0m"}}{{end}} {{$l.Output}}{{if gt ($l.Output|len) 1}}{{if le (split $l.Output "\n"|len) 1}}{{"\n"}}{{end}}{{else}}{{"<no output>\n"}}{{end}}{{end}}no healthcheck run yet. {{.State.Status}}{{end}}{{else}}no healthcheck configured. {{.State.Status}}{{end}}' `docker ps -qf label=com.docker.swarm.service.name=full_service_name`
@pyhedgehog
pyhedgehog / INSTALL-cygwin.md
Created June 8, 2020 11:35
Install SSHFS on cygwin

Install SSHFS on cygwin

Install prerequisites

Install cygwin packages

  • meson
  • ninja
  • cmake
  • libglib2.0-devel
@pyhedgehog
pyhedgehog / README.md
Last active April 8, 2020 02:53
script to allow autossh switch between several hosts

Problem

If you want to connect to some ssh server for port forwarding you use autossh to keep it alive disregarding network issues.

It you want to switch between several unreliable tcp ports you can use balance to choose between them.

But when you want to switch between several unreliable ssh servers, you can't direct your ssh client to balance because different servers will have different hostkeys and using single config entry for them will ends in either verification errors or in insecure configuration accepting anybody in the middle.

Solution

@pyhedgehog
pyhedgehog / msm-dipsters.md
Created October 17, 2019 14:30
dipster required
                Meldablend                   Растосмесь
              Wild Bagpipe                Дикая Волынка
           Travelers' Sign             Пасажирский Знак
               Saggle Tree              Шалфевое Дерево
     Directions to Nowhere         Направление в Никуда
           Pipes of Cicado                Трубки Цикада
             Smunkin Patch               Участок Тыковы
                  Tree Hut                 Дом в Дереве
                 Trumplite                    Трубасвет

Hollow Log Дуплистое Бревно

@pyhedgehog
pyhedgehog / HSTS.md
Created September 27, 2019 08:25
Kaspersky: Самоподписанные сертификаты, HSTS и "Проверка защищённых соединений"

Вкратце

Администраторы

Если вынуждены пользоваться самоподписанным сертификатом - сразу отключайте HSTS.

Пользователи

Сразу (до захода на сайт) добавьте свой сайт с самоподписанным сертификатом в список доверенных в Kaspersky Endpoint Security: Настройки->Общие параметры->Параметры сети->Доверенные домены.

Причины

  • Есть случаи, когда самоподписанного сертификата не избежать, несмотря на возможности "Let's Encrypt", например если ваш сайт доступен только из локальной сети.
@pyhedgehog
pyhedgehog / ChangeLog.md
Last active August 31, 2019 09:35
FTF read all chapters link

Version 2

  • fanfics.me migrated to HTTPS.

Version 1

  • Change link under #FicReadLink tag to remove &amp;chapter=0 part.