cb.c
1.4 KB
smol useful prog that will send to clipboard piped content
usage:
then
example:
usage:
gcc -o cb cb.c $(pkg-config --cflags --libs gtk+-3.0) && chmod +x cb && sudo cp cb /usr/local/bin/
then
any command with output | cb
example:
find /tmp | cb
Irregular alternative to heredoc cat using bare /dev/stdin:
cp /dev/stdin /tmp/plaintext.txt << EOF
some
multiline
text
test
test
EOF
A way to make a full disk backup of WIN* (NTFS partition):
backup:
restore:
backup:
~/trash $ cat save-image.sh
ntfsclone --save-image -o - /dev/sdb1 | zstd -9 -o /run/media/host/old2.52/WIN8.1BKUPS/sdb1-DEFRAG-ACT-NVIDIA-OPTI-11AUG2021.img
restore:
~/trash $ cat restore-images.sh
zstdcat /run/media/host/old2.52/WIN8.1BKUPS/SELEECT |ntfsclone --restore-image --overwrite /dev/SELEECT -
bash forkbomb not working there:
systemd-run --user --unit=safe-fork \
--property=MemoryMax=1G \
--property=CPUQuota=10% \
--property=TasksMax=3 \
--property=TimeoutSec=3 \
--pty /bin/bash
best compression using ZPAQ
(its very slow, but compression ratio around 30% better than ZST )
lrzip -z -L 9 -U -p $(nproc) <file>
(its very slow, but compression ratio around 30% better than ZST )
ZST variant:
zstd --ultra -22 --long=16 -T$(nproc) -v storage.qcow2 -o storage_$(date +%Y%m%d)_.qcow2.zst
zstd --ultra -22 --long=16 -T$(nproc) -v system.qcow2 -o system_$(date +%Y%m%d)_.qcow2.zst
Get TUI weather from the Norway telnet service:
OR pure bash TCP ver:
If it doesn't work, try different city names.
It looks like their backend is hitting bugs.
Internal server error.
printf 'Kyiv\r\n' | nc graph.no 79
OR pure bash TCP ver:
exec 3<>/dev/tcp/graph.no/79
printf 'Kyiv\r\n' >&3
cat <&3
exec 3>&-
It looks like their backend is hitting bugs.
Internal server error.
This media is not supported in your browser
VIEW IN TELEGRAM
freaked interfaces №45
calculate PI to 5000 decimal places:
same for Euler (exponential func):
time echo "scale=5000; 4*a(1)" | bc -l -q
same for Euler (exponential func):
time echo "scale=5000; e(1)" | bc -l -q
General Email Regex (RFC 5322 Official Standard)
(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
1
(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
🥰1
not perfect keyboard & mice cleaning solution (its temporary disable hid devices from input)
set proper sleep time:
broken rn do not use this script.
set proper sleep time:
#DEVICES=($(for d in /sys/bus/usb/devices/[0-9]*; do ([ -e "$d/driver" ] && readlink "$d/driver" 2>/dev/null | grep -q "usbhid\|hid") || ([ -d "$d" ] && ls $d/*/input* >/dev/null 2>&1) && echo "$d"; done | sed 's/:.*$//' | sort -u)); for dev in "${DEVICES[@]}"; do sudo bash -c "echo 0 > $dev/authorized" & done; wait; sleep 3; for dev in "${DEVICES[@]}"; do sudo bash -c "echo 1 > $dev/authorized" & done; wait
broken rn do not use this script.
add clock to term (why? idk)
while sleep 1;do tput sc;tput cup 0 $(($(tput cols)-29));date;tput rc;done &
Vintage-like records morphing using sox:
you can play with numbers. That will achieve that cool vintage background noises.
another ver:
# Step 1: Band-limit and add saturation
sox input.wav temp.wav highpass 300 lowpass 3000 overdrive 20 gain -n
# Step 2: Add pink noise and hum
sox -m temp.wav "|sox -n -p synth 60 pinknoise vol 0.06 bass -10 treble -15" \
"|sox -n -p synth 60 sine 60 vol 0.018" final_vintage.wav
you can play with numbers. That will achieve that cool vintage background noises.
another ver:
# Step 1: Band-limit, saturate, EQ, compress, and reverb
sox audio_2025-07-11_17-55-45.ogg temp.wav \
highpass 300 lowpass 3000 overdrive 18 gain -n \
bass -8 treble -10 \
compand 0.3,1 6:-70,-60,-20 -5 -90 0.2 \
reverb 25
# Step 2: Add pink noise (shaped) and low hum
sox -m temp.wav \
"|sox -n -p synth 60 pinknoise vol 0.04 bass -12 treble -18" \
"|sox -n -p synth 60 sine 60 vol 0.01" \
final_vintage2.wav
linux util fixes /etc/shadow errors (somethimes nixpgs can cause it)
sanity checks:
pwck -r
sanity checks:
pwck -s
grpck -s
things
static black screen for 10hours and 1 second: ffmpeg -f lavfi -i color=c=black:s=1920x1080:r=1 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=8000 -t 10:00:01 -c:v libx264 -c:a aac -b:v 1k -b:a 1k -crf 63 -movflags +faststart -pix_fmt yuv420p -y…
static image for many hours:
second variant with encoding (long processing) precisely 10hours 1 second:
1
ffmpeg -loop 1 -i 1111.png -f lavfi -i anullsrc=channel_layout=mono:sample_rate=8000 -t 10 -c:v libx264 -preset fast -tune stillimage -crf 50 -c:a aac -b:a 1k -pix_fmt yuv420p -r 0.00001 -vf scale=iw/2:ih/2 -movflags +faststart -y segment.mp4
2
ffmpeg -stream_loop 11111 -i segment.mp4 -c copy -y output_static3333.mp4
second variant with encoding (long processing) precisely 10hours 1 second:
ffmpeg -loop 1 -i 1111.png -f lavfi -i anullsrc=channel_layout=mono:sample_rate=8000 -t 10:00:01 -c:v libx264 -tune stillimage -crf 42 -c:a aac -b:a 8k -pix_fmt yuv420p -r 0.033 -shortest -movflags +faststart -y output_static.mp4