Skip to content

Instantly share code, notes, and snippets.

@Jipok
Jipok / backup.sh
Created March 7, 2025 09:45
Backup HOME with restic, exclude trash, caches and other useless data
#!/usr/bin/env bash
echo -e "\033[0;32mПароль в keepass под именем restic\033[0m"
# Each element is the exclusion path
excludes=(
"$HOME/.local" # Local configuration and application files
"$HOME/.cache" # Temporary cache files
"$HOME/Downloads" # Downloads folder
@Jipok
Jipok / jsv.sh
Created December 6, 2024 19:30
Automaticly create tmux service for runit for each linux user
#!/usr/bin/env bash
USERS_DIR="/home"
SERVICES_DIR="/etc/sv"
RUNIT_DIR="/var/service"
create_tmux_service() {
user="$1"
service_name="tmux-${user}"
service_dir="${SERVICES_DIR}/${service_name}"
@Jipok
Jipok / amdgpu_power_control2.py
Created February 11, 2024 14:41
TUI with chart for radeon power cap control, temp monitoring. SIGSTOP python if overheated
#!/usr/bin/env python3
import plotext as plt
from subprocess import check_output
import psutil
import time
import math
CMD = "sensors amdgpu-pci-0500 | grep PPT | grep -oP '(?<=cap =) *(.?\d+)'"
TARGET_TEMP_MAX = 91
TARGET_TEMP_MIN = 87
@Jipok
Jipok / amdgpu-power-control.py
Last active February 3, 2024 06:57
TUI with chart for radeon power cap control, temp monitoring
#!/usr/bin/env python3
import plotext as plt
from subprocess import check_output
import psutil
import time
CMD = "sensors amdgpu-pci-0500 | grep PPT | grep -oP '(?<=cap =) *(.?\d+)'"
TARGET_TEMP = 83
CRITICAL_TEMP = 92
CAP_MIN = 2
@ymoslem
ymoslem / M2M-100-example.py
Last active September 1, 2024 13:23
Example of translating a file with M2M-100 using CTranslate2
# This example uses M2M-100 models converted to the CTranslate2 format.
# Download CTranslate2 models:
# • M2M-100 418M-parameter model: https://bit.ly/33fM1AO
# • M2M-100 1.2B-parameter model: https://bit.ly/3GYiaed
import ctranslate2
import sentencepiece as spm
@haxscramper
haxscramper / languages-and-vms.md
Last active July 2, 2024 03:38
languages-and-vms
@probonopd
probonopd / Wayland.md
Last active April 16, 2025 20:29
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.


As 2024 is winding down:

@Jipok
Jipok / mpd-notifications
Last active January 26, 2025 04:27
Show music info(with cover) for mpd. Will show gray cover, when paused
#!/bin/bash
expireTime="3200"
mpddir="$HOME/Music/"
defaultimage="$HOME/music.png"
update_cover() {
path=$mpddir$(mpc -f %file% current)
album=$(mpc -f %file% current)
ffmpeg -loglevel quiet -y -i "$path" /tmp/cover
@Jipok
Jipok / mpd-select
Last active December 18, 2018 18:08
Select mpd track via dmenu
#!/bin/sh
mpc -f "[[%artist% - ][%album% - ]%title%]|[%file%]" playlist | \
cat -n | sed "s/\t/: /" | \
cut -c 1-120 | dmenu -i | cut -d ':' -f 1 \
| xargs -r mpc play > /dev/null
@vurtun
vurtun / _readme_quarks.md
Last active March 29, 2025 00:56
Quarks: Graphical user interface

gui