Skip to content

Instantly share code, notes, and snippets.

View user890104's full-sized avatar

Vencislav Atanasov user890104

View GitHub Profile
@user890104
user890104 / net.sh
Created December 10, 2018 11:23
Fix network on lxd
for cnt in $(lxc list --format csv --columns n)
do
GATEWAY_NUM=$(lxc exec $cnt -- bash -c 'route -n -A inet6 | grep -F "::/0" | grep -Fv "!n" | wc -l')
if [ $GATEWAY_NUM -eq 0 ]
then
echo restart network on $cnt
lxc exec $cnt -- netplan apply
fi
done
<?php
namespace User890104;
class MultiCurl {
private $multi_handle;
private $handles = [];
public function __construct() {
$multi_handle = curl_multi_init();
@user890104
user890104 / convert.php
Created February 13, 2019 00:18
Arduino MIDI nodejs stepper motor
<?php
if (
empty($_SERVER['argc']) || empty($_SERVER['argv']) ||
!is_int($_SERVER['argc']) || !is_array($_SERVER['argv']) ||
3 !== $_SERVER['argc'] || 3 !== count($_SERVER['argv'])
)
{
echo 'usage: ', $_SERVER['argv'][0], ' <input> <output>', "\n";
exit;
}
@user890104
user890104 / config.md
Last active February 19, 2023 18:02
ESP8266 display tasmota config
@user890104
user890104 / sync-to-discord.sh
Created November 8, 2025 00:17
Sync Wordpress Event Manager events to Discord
#!/usr/bin/env bash
set -euo pipefail
# CONFIGURATION
# test
#DISCORD_GUILD_ID="1434925424957460520"
# prod
DISCORD_GUILD_ID="1393669204238008350"
@user890104
user890104 / initramfs.sh
Created January 25, 2026 22:35
Linux on iPod nano (7th generation)
#!/bin/bash
set -eEx
ARCH=armv7
VER=3.23.2
MAJOR=v${VER%.*}
TAR=alpine-minirootfs-${VER}-${ARCH}.tar.gz
URL=https://dl-cdn.alpinelinux.org/alpine/${MAJOR}/releases/${ARCH}/${TAR}
@user890104
user890104 / boot.sh
Created March 23, 2026 19:31
Linux on iPod nano (7th generation)
#!/bin/bash
set -e
ID=05ac:8007
~/Git/wInd3x/wInd3x cfw run ~/Git/u-boot/u-boot.bin
echo -n Waiting for U-boot