Skip to content

Instantly share code, notes, and snippets.

View jeffangelion's full-sized avatar
💩
writing shell scripts

Ivan Vatlin jeffangelion

💩
writing shell scripts
View GitHub Profile
@jeffangelion
jeffangelion / tg_color_picker.v
Created January 6, 2024 21:24
Get empty userpic color by Telegram ID as an official client
// https://github.com/telegramdesktop/tdesktop/blob/2ef8136308e31e07988ee4654b73ae2a5ab495dc/Telegram/SourceFiles/ui/empty_userpic.cpp#L257
// https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/SourceFiles/ui/chat/chat_style.cpp#L1033
struct Color {
red u8
green u8
blue u8
}
fn (c Color) str() string {
@jeffangelion
jeffangelion / intel_x520_patcher.py
Created November 7, 2024 10:47 — forked from ixs/intel_x520_patcher.py
Intel x520 EEPROM Patcher allows to unlock the x520 network card to work with non-intel branded SFP modules.
#!/usr/bin/env python3
#
# Simple Intel x520 EEPROM patcher
# Modifies the EEPROM to unlock the card for non-intel branded SFP modules.
#
# Copyright 2020,2021,2022 Andreas Thienemann <andreas@bawue.net>
#
# Licensed under the GPLv3
#
# Based on research described at https://forums.servethehome.com/index.php?threads/patching-intel-x520-eeprom-to-unlock-all-sfp-transceivers.24634/
#!/usr/bin/env bash
#
# Simple Intel x520 EEPROM patcher
# Modifies the EEPROM to unlock the card for non-intel branded SFP modules.
#
# Copyright 2024 Ivan Vatlin <me@jeffangelion.ru>
#
# Licensed under the GPLv3
#
# Based on research described at https://forums.servethehome.com/index.php?threads/patching-intel-x520-eeprom-to-unlock-all-sfp-transceivers.24634/
@jeffangelion
jeffangelion / link_to_repo.md
Last active November 4, 2025 18:13
Automated script for including custom packages in Debian ISO without network mirror/preseed
@jeffangelion
jeffangelion / mongodb-debian-repo-mirror.sh
Created January 14, 2026 07:20
Mirroring MongoDB Debian repo using debmirror despite its awful structure
#!/usr/bin/env bash
#DIR=path/to/repo/dir
#MongoDB repo structure sucks so we'll download Release, Release.gpg and Packages.gz separately
#MongoDB 8.0 (Debian 12)
#Creating debmirror working directory and placing files by hand (via wget)
mkdir -p ${DIR}/mongodb-8.0/apt/debian/.temp/.tmp/dists/bookworm
wget https://repo.mongodb.org/apt/debian/dists/bookworm/mongodb-org/8.0/Release -O ${DIR}/mongodb-8.0/apt/debian/.temp/.tmp/dists/bookworm/Release
wget https://repo.mongodb.org/apt/debian/dists/bookworm/mongodb-org/8.0/Release.gpg -O ${DIR}/mongodb-8.0/apt/debian/.temp/.tmp/dists/bookworm/Release.gpg