Skip to content

Instantly share code, notes, and snippets.

View AndreiCherniaev's full-sized avatar

Andrei Cherniaev AndreiCherniaev

View GitHub Profile
@AndreiCherniaev
AndreiCherniaev / docx_pptx_grep
Created September 16, 2025 02:12
Command-line tool to search docx files
# https://unix.stackexchange.com/a/743302/481341
docx_pptx_grep() {
keyword="$1"
/usr/bin/fdfind -t f -e docx -e pptx . | while read -r arg; do
if unzip -p "$arg" 2>/dev/null | rg -q --ignore-case --fixed-strings "$keyword"; then
echo "$arg"
fi
done
}
@AndreiCherniaev
AndreiCherniaev / Cher0_1_ubuntu-deployment.yaml
Last active September 15, 2025 07:20
YAML configuration files for Ubuntu installer
identity:
hostname: ubuntu-desktop
password: '$6$TThZwH2sYnfxdzIN$COsmkwowJBH.pYW/jpfhzcBsxSQ6.lrEygIGUQLDrJBsTBgT1gLnkspvttBmgKIJl6UGGSOv4cDfV4Hj0BqS9/'
# There is password hash, use `mkpasswd --method=SHA-512`
realname: q
username: q
interactive-sections:
- storage
apt:
preserve_sources_list: false
@AndreiCherniaev
AndreiCherniaev / VM_alias_install.sh
Last active September 1, 2025 06:02
[Debian] install must-have aliases for virtual machine
echo "alias upd='sudo apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update && sudo apt upgrade -y && sudo apt autoremove -y'" >> "$HOME/.bash_aliases"
echo "alias t='sudo apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update && sudo apt autoremove -y'" >> "$HOME/.bash_aliases"
@AndreiCherniaev
AndreiCherniaev / my AV1 century.md
Last active October 15, 2025 03:46
How to keep media?

video

MOV to slideshow

Make slideshow based on MOV. '-c:v copy' is used to took images as is. You can avoid this option to get low-qualite (low size) jpg...

fdfind -e MOV -e mov -tf --maxdepth 1 -x bash -c 'mkdir "${0}Photo" && ffmpeg -y -i ${0} -c:v copy ${0}Photo/output_%04d.jpg'

mp4 to slideshow

Make slideshow based on mp4. You can use for all simiar formats like mkv, webm, ...

fdfind -e mp4 -tf --maxdepth 1 -x bash -c 'mkdir "${0}Photo" && ffmpeg -y -i ${0} ${0}Photo/output_%04d.jpg'
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme1n1p1 during curtin installation
/dev/disk/by-uuid/653a2212-f324-4b5f-bd9f-01f590dcf876 / btrfs defaults 0 1
# /boot/efi was on /dev/nvme1n1p2 during curtin installation
@AndreiCherniaev
AndreiCherniaev / phoronix-cmd.md
Created July 11, 2025 05:35 — forked from danielgomezrico/phoronix-cmd.md
Phoronix Test Suite Cheat Sheet
@AndreiCherniaev
AndreiCherniaev / phoronix-cmd.md
Last active July 11, 2025 05:32 — forked from anshula/phoronix-cmd.md
Phoronix Test Suite Cheat Sheet
@AndreiCherniaev
AndreiCherniaev / autoinstall.yaml
Last active June 30, 2025 05:40
Ubuntu autoinstall configuration
#cloud-config
interactive-sections:
- identity
autoinstall:
interactive-sections:
- identity
apt:
disable_components: []
geoip: true
preserve_sources_list: false
@AndreiCherniaev
AndreiCherniaev / my_hexdump.txt
Last active August 25, 2025 06:39
hexdump per bytes for first 21 bytes only
hexdump -n21 -e '/1 "%02X "' -v filename.bin
@AndreiCherniaev
AndreiCherniaev / Linux kernel reboot.txt
Last active June 2, 2025 04:38
Ask kernel to rebooot
напрямую направить ядру запрос о перезагрузке устройства с помощью sysrq
#!/system/bin/sh
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger