Skip to content

Instantly share code, notes, and snippets.

View qiwichupa's full-sized avatar

qiwichupa

View GitHub Profile
@qiwichupa
qiwichupa / bond_mon.sh
Last active April 5, 2024 10:57
checks if the gateway is not available and switches the active interface in bond
#!/bin/bash
# Checks if the gateway is not available and switches the active interface in bond.
# The script is made for zvirt node, designed for bond management via NetworkManager.
#
# v2024.04.05
#
# Change your "bondname" and add script to crontab like:
# @reboot root /opt/bond_mon.sh
bondname=bond0
@qiwichupa
qiwichupa / kinopoisk_comments_rating
Last active March 23, 2024 20:14
userscript - показывает рейтинг, основанный на комментариях пользователей.
// ==UserScript==
// @name kinopoisk comments rating
// @namespace https://gist.github.com/qiwichupa/4e843ab13db601ac43f138700c7a3241
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js
// @include https://www.kinopoisk.ru/film/*
// @include https://www.kinopoisk.ru/series/*
// @run-at document-idle
// @grant GM_xmlhttpRequest
// @grant GM_addStyle
// @version 20240323.23
@qiwichupa
qiwichupa / btrfs_snapshot.sh
Last active March 27, 2024 13:13
btrfs_snapshot.sh - create snapshot for btrfs mountpoints/volumes (and send to another btrfs backup directory)
#!/bin/bash
# v. 2023.03.27
MOUNTPOINTS=('/' '/home' )
SNAPSHOTDIRNAME='.snapshots'
RETAINSNAPS=2
SENDTOBACKUP=no # yes or no
BACKUPDIR='/mnt/backup'
@qiwichupa
qiwichupa / tsend.py
Created February 23, 2024 00:35
sending to telegram channel: tsend.py <channel id> "<message>"
#!/usr/bin/python3
import time
import config
import telebot
import sys
import os
from emoji import emojize
bottoken="<token>"
proxy = '<IP>:<PORT>'
@qiwichupa
qiwichupa / autodisable_steam_bt_gamepad.py
Created January 17, 2024 20:51
script to automatically disable the bluetooth gamepad when there is no activity for a specified time. Written for Steam and SteamDeck
#!/usr/bin/env python3
'''
script to automatically disable the bluetooth gamepad when there is no activity for a specified time.
Written for Steam and SteamDeck (requires "/dev/input/js0" device).
Change maxidletime and devid variables.
Мake the script executable and add it to autorun in desktop mode.
'''
import struct
from datetime import datetime as dt
@qiwichupa
qiwichupa / gist:2882c53e40ddb3ccd20163c48270acf7
Last active January 14, 2024 15:39
PS4ESO steam layout
BASE:
Share - System Menu;
Options - Map;
✖ - Jump;
R1 (hold) - Run;
R3 - Interact;
● (hold) - Close;
L1 (hold) - Sneak;
Down - Mount;
@qiwichupa
qiwichupa / YouTube RSS Feed
Last active January 7, 2024 12:43
Userscript: YouTube RSS Feed
// ==UserScript==
// @name YouTube RSS Feed (qiwichupa fork)
// @namespace https://gist.github.com/qiwichupa/733994d90c7b6ceaaf69067584cd6017
// @homepage https://greasyfork.org/ru/scripts/484129-youtube-rss-feed-qiwichupa-fork
// @author Doodles + qiwichupa
// @version 20240107.1542
// @description Adds an RSS feed button to YouTube channels next to the subscribe button
// @icon http://i.imgur.com/Ty5HNbT.png
// @icon64 http://i.imgur.com/1FfVvNr.png
// @match *://www.youtube.com/*
@qiwichupa
qiwichupa / zabbix_check_availability.sh
Last active January 18, 2024 16:51
check server availability from zabbix proxies
#!/bin/bash
# Usage: ./zabbix_check_availability.sh my-server.local
#
# If you run it as root:
# You need to have "zabbix_get" executable binary on each proxy
# in the /root dir, and set passwordless ssh authentication.
# v. 20240118
# https://gist.github.com/qiwichupa/39e47db270a070e1dafa2eb14033d1c5
PROXYLIST=(zabbix-proxy1.local
@qiwichupa
qiwichupa / nm-export-ovpn.sh
Last active December 18, 2023 08:58
export openvpn config (with certificates) from NetworkManager
#!/bin/bash
# v.202311301520
# gen vpn connections menu
unset options i
while IFS= read -r f; do
options[i++]="$f"
done < <(nmcli --fields TYPE,NAME connection show | grep vpn | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}' )
select opt in "${options[@]}" ; do
@qiwichupa
qiwichupa / sensor-light.yaml
Last active February 2, 2023 13:01 — forked from Blackshome/sensor-light.yaml
Home Assistant Sensor Light that can be used in Blueprints
blueprint:
name: Sensor Light (~qiwichupa)
description: >
# Sensor Light
**Version: 2.5~qiwichupa**
Bypass switch logic reversed: on - automation works, off - automation is disabled. So bypass is automation switch now.
You can find original blueprint here: : [Click Here](https://community.home-assistant.io/t/sensor-light/481048)