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
#!/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 <[email protected]>
#
# 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 / 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 <[email protected]>
#
# 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 / 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 / dissidia-ru-quiz.md
Last active September 11, 2023 21:14
Ответы на викторину муглов из Dissidia Final Fantasy (PSP)

Верно! Это был легкий вопрос, куп... эм... Все, больше не могу! Купо-купо-купо! Итак, третий вопрос, купо! Помнишь "Золотое блюдце" из Final Fantasy VII? Какого из этих аттракционнов там не было?

Варианты ответов неизвестны, дополнить позже

Да! Скажи, там можно было играть часами! Всё, последний вопрос, купо! На сей раз - по Final Fantasy VIII. Помнишь историю Лагуны? Какую из перечисленных фраз он НЕ произносит во время битвы в кратере?

"Мне нужно в туалееет!"
"У меня пятки чееешутся!"
"У меня нос чееешется!"

@jeffangelion
jeffangelion / riff.magic
Created May 28, 2023 21:46
Custom binwalk signature descriptors
# Rough RIFF signature
0 string RIFF riff,
>4 lelong+4 >0 size: %d
>4 lelong+4 >0 {size: %d}
*** Pre-CBMEM romstage console overflowed, log truncated! ***
[DEBUG] Selected CAS latency : 9T
[DEBUG] MPLL busy... done in 10 us
[DEBUG] MPLL frequency is set at : 666 MHz
[DEBUG] Selected CWL latency : 7T
[DEBUG] Selected tRCD : 9T
[DEBUG] Selected tRP : 9T
[DEBUG] Selected tRAS : 24T
[DEBUG] Selected tWR : 10T
@jeffangelion
jeffangelion / detect_ehci_debug_port.sh
Created September 5, 2021 07:25
Updated version of Carl-Daniel Hailfinger's script for detecting USB EHCI debug ports
#!/usr/bin/env bash
# Copyright 2008 Carl-Daniel Hailfinger
# Small fixes by Ivan Vatlin (C) 2021
# Original script: http://www.coreboot.org/pipermail/coreboot/attachments/20140530/245547f8/attachment.sh
# Link was taken from this article: https://www.coreboot.org/EHCI_Debug_Port
LANG=C
dmesgfile=$1
debug_lspci_devs=$(lspci -nvvD |
#include <iostream>
#include <cstring>
#include <cmath>
/* This function converts char array (little endian) to integer
* For example: {0xCA, 0xFE, 0xBA, 0xBE} -> 0xBEBAFECA -> 3199925962
* I'm a bad programmer, so here is workaround:
* You need to specify length of char array by second function argument
* Kill me :(
*/
int hex_to_dec (const unsigned char input[], const unsigned int count)
@jeffangelion
jeffangelion / technical-issues.htm
Created November 19, 2019 11:30
Technical issues webpage
<!DOCTYPE html>
<html>
<head>
<style>
:root {
--bg-color: #261A60;
--font-color: #9C93C6;
--base-color: #613A2F; /* Chocolate: #613A2F */
--left-color: #8A5448; /* Light Chocolate: #8A5448 */
--right-color: #482E28; /* Dark Chocolate: #482E28 */

Синтаксис регулярных выражений

При написании регулярного выражения можно пользоваться обозначениями, привёденными в таблице:

Представление Значение Эквивалент Комментарий Пример
\w любая буква [А-яA-zЁё] Буква кириллического/латинского алфавитов вне зависимости от регистра. Букв