Skip to content

Instantly share code, notes, and snippets.

@DarkPark
DarkPark / readme.md
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
DarkPark / info.md
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
    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'
Array.prototype.slice.call(document.querySelectorAll('.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);
//console.log(ratio);
@DarkPark
DarkPark / gpg.md
Last active January 11, 2021 21:39

encrypt

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

decrypt

gpg --decrypt dp.gpg

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

udevadm monitor --env

lsusb -v

dmesg | grep ttyUSB
@DarkPark
DarkPark / setup.md
Created February 18, 2020 08:54
Prometheus Node Exporter setup
useradd --no-create-home --shell /bin/false node_exporter
wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
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
DarkPark / tearing.md
Created February 8, 2020 16:53
how to fix radeon screen tearing
@DarkPark
DarkPark / speedup.sh
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 10.0.0.10 host:
# ./backup.sh 10.0.0.10
# can be executed by crontab on a hourly basis
# stops execution on any error
set -e
@DarkPark
DarkPark / docker.sh
Last active July 6, 2018 09:36
docker installation instructions
#!/usr/bin/env bash
# more details:
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt update
sudo apt --yes install software-properties-common apt-transport-https ca-certificates curl
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -