Skip to content

Instantly share code, notes, and snippets.

@yuri1969
yuri1969 / xkcd.md
Last active September 19, 2023 14:01
XKCD list
@yuri1969
yuri1969 / run_kernel_compile.sh
Last active June 2, 2023 20:37
Run kernel compile
#!/bin/bash
cd /usr/src/linux || { echo 'Failed to switch to /usr/src/linux' >&2; exit 1; }
chrt -i 0 ionice -c 3 make -j "$(nproc)" || \
{ echo 'Failed to compile the kernel' >&2; exit 1; }
@yuri1969
yuri1969 / thinkfan.conf
Last active November 27, 2022 09:45
Thinkfan config file for Lenovo T430
sensors:
# thinkpad_acpi
- tpacpi: /proc/acpi/ibm/thermal
indices: [0]
fans:
# thinkpad_acpi to allow disengaged and automatic modes
- tpacpi: /proc/acpi/ibm/fan
levels:
@yuri1969
yuri1969 / 90-generic-dev-fs-tuning.conf
Created April 24, 2022 09:59
Dev-related sysctl config
# Increase watchers count
fs.inotify.max_user_watches=524288
# Increase count of FDs
fs.file-max=262144
@yuri1969
yuri1969 / docker-ce-to-wsl2-debian.sh
Last active March 23, 2022 20:51
WSL2 Debian with Docker CE
# Remove the evil Docker 'non-CE' packages
sudo apt remove docker docker-engine docker.io containerd runc
sudo apt update
# Make sure all the requirements are present
sudo apt install --no-install-recommends apt-transport-https ca-certificates curl gnupg2
# Add Docker package repo
source /etc/os-release
curl -fsSL "https://download.docker.com/linux/${ID}/gpg" | sudo apt-key add -
echo "deb [arch=amd64] https://download.docker.com/linux/${ID} ${VERSION_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt update
gsettings set org.gnome.desktop.sound event-sounds false
@yuri1969
yuri1969 / etc-portage-repos.conf-local.conf
Created March 9, 2022 20:06
Local Gentoo EBuild repository
[local]
priority = 60
location = /var/db/repos/local
@yuri1969
yuri1969 / install-python.sh
Last active March 22, 2022 10:02
Install a non-system Python on GNU Linux
#!/bin/bash
if [[ $# -lt 1 ]]; then
echo "Usage: ${0##*/} <version>"
echo "Example: ${0##*/} 3.6.15"
exit 1
fi
VERSION="$1"
@yuri1969
yuri1969 / run_grub.sh
Created November 8, 2021 21:23
Gentoo Grub updater
#!/bin/bash
{ grub-install --target=x86_64-efi /dev/sda && grub-mkconfig -o /boot/grub/grub.cfg } || { echo "*** ERROR ***" >&2; exit 1; }
@yuri1969
yuri1969 / extract-pre-master-secret.py
Last active September 15, 2021 12:52 — forked from tsaarni/extract-pre-master-secret.py
Extract keys to decrypt Java TLS stream
#!/usr/bin/env python3
#
# Extract TLS pre-master secret to decrypt captured TLS stream in Wireshark
#
# Java TLS implementation can be configured to dump information on TLS stream,
# making it possible to extracting TLS key for decrypting the stream for debug
# purposes.
#
# This script is originally by Timothy Basanov
# https://timothybasanov.com/2016/05/26/java-pre-master-secret.html