Skip to content

Instantly share code, notes, and snippets.

DarkPark /
Last active May 13, 2023 13:02
SSH keys

Get fingerprints:

# bash
for file in /etc/ssh/ssh_host_*_key; do ssh-keygen -l -f "$file"; done
# fish
for file in /etc/ssh/ssh_host_*_key; ssh-keygen -l -f "$file"; end

Regenerate keys:

DarkPark /
Created April 21, 2023 10:21
terminal simple benchmark

for bash:

for i in {1..100000}; do
    echo -e '\r'
    echo -e '\033[0K\033[1mBold\033[0m \033[7mInvert\033[0m \033[4mUnderline\033[0m'
    echo -e '\033[0K\033[1m\033[7m\033[4mBold & Invert & Underline\033[0m'
    echo -e '\033[0K\033[31m Red \033[32m Green \033[33m Yellow \033[34m Blue \033[35m Magenta \033[36m Cyan \033[0m'
 echo -e '\033[0K\033[1m\033[4m\033[31m Red \033[32m Green \033[33m Yellow \033[34m Blue \033[35m Magenta \033[36m Cyan \033[0m''.book-row')).forEach($book => {
const stats = $book.querySelector('.book-stats');
if ( stats ) {
const views = Number(stats.firstElementChild.dataset.hint.replace('Просмотры · ', '').replace(/ /g, ''));
const likes = Number(stats.firstElementChild.nextElementSibling.dataset.hint.replace('Понравилось · ', '').replace(/ /g, ''));
const $info = document.createElement('span');
const ratio = Math.floor(views/likes);
DarkPark /
Last active January 11, 2021 21:39


gpg --symmetric --cipher-algo aes256 dp.txt


gpg --decrypt dp.gpg

udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB1)

udevadm monitor --env

lsusb -v

dmesg | grep ttyUSB
DarkPark /
Created February 18, 2020 08:54
Prometheus Node Exporter setup
useradd --no-create-home --shell /bin/false node_exporter
tar xvfz node_exporter-0.18.1.linux-amd64.tar.gz
mv node_exporter-0.18.1.linux-amd64/node_exporter /usr/local/bin/
rm -rf ./node_exporter-0.18.1.linux-amd64*

vim /etc/systemd/system/node_exporter.service
DarkPark /
Created February 8, 2020 16:53
how to fix radeon screen tearing
DarkPark /
Last active August 31, 2022 08:11
Bash script to increase playback speed for all audio files in the current directory.
# bash
for file in *.mp3; do ffmpeg -i "$file" -filter:a "atempo=2" -vn "x2_$file" -y; done
# fish
for file in *.mp3; ffmpeg -i "$file" -filter:a "atempo=2" -vn "x2_$file" -y; end
#!/usr/bin/env bash
# creates daily backups using hard links
# should be run on a storage server to backup remote host:
# ./
# can be executed by crontab on a hourly basis
# stops execution on any error
set -e
DarkPark /
Last active July 6, 2018 09:36
docker installation instructions
#!/usr/bin/env bash
# more details:
sudo apt update
sudo apt --yes install software-properties-common apt-transport-https ca-certificates curl
curl -fsSL | sudo apt-key add -