Skip to content

Instantly share code, notes, and snippets.

View pyhedgehog's full-sized avatar

PyHedgehog pyhedgehog

View GitHub Profile
@pyhedgehog
pyhedgehog / README.md
Last active July 3, 2026 09:51
acp2kubeconfig - Script to patch (not to setup) user auth to Alauda ACP from Firefox cookies to kubectl config.

acp2kubeconfig

Script to patch (not to setup) user auth to Alauda ACP from Firefox cookies to kubectl config.

Usage

On Windows command will be acp2kubeconfig (aka acp2kubeconfig.cmd), on other systems - acp2kubeconfig.sh (will not work as firefox have other profile locations).

@pyhedgehog
pyhedgehog / README.md
Created July 1, 2026 12:59
Script to install latest Alpine release into WSL2.

installwslalpine.cmd

Script to install latest Alpine release into WSL2.

Usage

  1. Install WSL2.
  2. Copy to directory where you want distro to live (where will live ext4.vhdx file).
  3. (Optional) Create init.sh to be run inside distro after creation (i.e. before user creation).
  4. (Optional) Create user.sh to be run inside distro after user creation.
# nginx.conf
#user nginx;
worker_processes 3;
error_log /tmp/bug-njs-fetch/error.log warn;
pid /tmp/bug-njs-fetch/nginx.pid;
load_module modules/ngx_http_js_module.so;
events {
}
http {
default_type application/octet-stream;
#FROM nginx:1.23.4-bullseye
FROM nginx:1.27.5-bookworm
COPY ./nginx.conf ./test.js /etc/nginx/
COPY ./default.conf /etc/nginx/conf.d/
COPY ./once.sh /usr/local/bin/
RUN chmod 0755 /usr/local/bin/once.sh
@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 editWikiSaltcornCom@pyhedgehog.github.com
// @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