Skip to content

Instantly share code, notes, and snippets.

View msva's full-sized avatar
🤷

Vadim Misbakh-Soloviov msva

🤷
View GitHub Profile
@msva
msva / ghcr.sh
Created November 11, 2024 10:47 — forked from eggplants/ghcr.sh
How to get information from ghcr Docker Registry HTTP API V2 with curl
#!/usr/bin/env bash
# ref: https://git.521000.bestmunity/t/how-to-check-if-a-container-image-exists-on-ghcr/154836/3
# public image's {USER}/{IMAGE}
USER_IMAGE=eggplants/asciiquarium-docker
# get token ('{"token":"***"}' -> '***')
TOKEN="$(
curl "https://ghcr.io/token?scope=repository:${USER_IMAGE}:pull" |
awk -F'"' '$0=$4'
@msva
msva / ghcr.sh
Created November 11, 2024 10:47 — forked from eggplants/ghcr.sh
How to get information from ghcr Docker Registry HTTP API V2 with curl
#!/usr/bin/env bash
# ref: https://git.521000.bestmunity/t/how-to-check-if-a-container-image-exists-on-ghcr/154836/3
# public image's {USER}/{IMAGE}
USER_IMAGE=eggplants/asciiquarium-docker
# get token ('{"token":"***"}' -> '***')
TOKEN="$(
curl "https://ghcr.io/token?scope=repository:${USER_IMAGE}:pull" |
awk -F'"' '$0=$4'
@msva
msva / spawn.lua
Created March 9, 2024 14:20 — forked from iMega/spawn.lua
Using LuaJIT FFI, spawn a Linux command in the background.
-- Spawn a command in the background, optionally redirecting stderr and stdout
--
-- requiring this file returns a function(cmd_line, stdout_redirect, stderr_redirect)
--
-- `cmd_line` is the command with possible arguments
-- optional `stdout_redirect` is io.stdout, io.stderr, or a filename. default/nil is io.stdout
-- optional `stderr_redirect` is io.stdout, io.stderr, or a filename. default/nil is io.stderr
--
-- Example:
-- luajit -e 'require("spawn")("cat /etc/network/interfaces", "foo1", io.stdout)'
@msva
msva / install.sh
Created October 1, 2023 14:28 — forked from putnik/install.sh
OpenVoiceOS Russian config
# Configure RPi
sudo /sbin/iwconfig wlan0 power off
sudo sed -i 's/exit 0/\/sbin\/iwconfig wlan0 power off\n\nexit 0/g' /etc/rc.local
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh --dry-run
sudo usermod -aG docker $USER
newgrp docker