Skip to content

Instantly share code, notes, and snippets.

View qiwichupa's full-sized avatar

qiwichupa

View GitHub Profile
@qiwichupa
qiwichupa / vbmtool-0.7.sh
Created September 29, 2009 19:58
Easy to use, lightweight, interactive shell for VBoxManage and VBoxHeadless tools from Sun VirtualBox. Include basic operations like as creation virtual machine, change basic parameters, start machine in headless mode
#!/bin/bash
#
# Filename: vbmtool-0.7.sh
# Version 0.7
# Date: 2009/09/29 19:56
# Licence: GNU GPL2
# Author: Sergey "Qiwichupa" Pavlov <[email protected]>
#
#
# Easy to use, lightweight, interactive shell for VBoxManage
#!/usr/bin/env python
#Copyright (C) 2009 Allen Sanabria
#This program is free software; you can redistribute it and/or modify it under
#the terms of the GNU General Public License as published by the Free Software Foundation;
#either version 2 of the License, or (at your option) any later version.
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
#without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#See the GNU General Public License for more details. You should have received a copy of i
@qiwichupa
qiwichupa / mednafen-server-run-and-log.py
Created September 24, 2021 07:27
Runs mednafen server, restarts it if it fails, and catch output to log file
#!/usr/bin/env python3
#Runs mednafen server, restarts it if it fails, and catch output to log file
import subprocess
import time
import sys
import pty
import os
def reader(fd):
@qiwichupa
qiwichupa / avmerge.py
Created October 8, 2021 12:12
This script was created for merging stream parts from twitch.tv service (but should be versatile).
#!/usr/bin/env python3
"""
Script: avmerge.py
Author: Sergey "Qiwichupa" Pavlov
Version: 2.04
This script was created for merging stream parts from twitch.tv service (but should be versatile).
Sometimes it is very simple task, but sometimes resizing and reencoding is needed.
Ok, to the code. First of all this script was written for executing in current directory.
I use 'os.listdir' for searching files by extension ('fileExt' variable).
@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)
@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 / 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 / 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 / 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 / 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