Skip to content

Instantly share code, notes, and snippets.

View SmartFinn's full-sized avatar
🇺🇦

Serhii Yeremenko SmartFinn

🇺🇦
  • Ukraine
  • 03:13 (UTC +03:00)
View GitHub Profile
@SmartFinn
SmartFinn / lvtimesnap.sh
Last active December 4, 2023 19:19
A script for creating/rotating snapshots of LVM volumes via (ana)cron
#!/usr/bin/env bash
#
# Creating and rotating snapshots of LVM volumes
#
# https://gist.github.com/SmartFinn/013dc2670f6605826acfae8e25c11178
#
# Copyright (c) 2023 Serhii Yeremenko (https://github.com/SmartFinn)
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
@SmartFinn
SmartFinn / obs_build_trigger.py
Last active September 17, 2019 19:45
An OBS (Open Build Service) Build Trigger System for GitHub Repositories
#!/usr/bin/python3
"""OBS Build Trigger System for GitHub Repositories
This script looks into a specific repository branch on GitHub and triggers
a build request through the OBS API if the last commit hash has changed.
To get the API Token for your OBS Project run:
$ osc token --create [PROJECT] [PACKAGE]
based on https://github.com/mschnitzer/obs-build-trigger
@SmartFinn
SmartFinn / qemu-desktop-integration.sh
Created August 15, 2018 11:57
creates desktop-files for each Qemu binaries to allow changing icons
#!/usr/bin/env bash
IFS=: read -ra BIN_DIRS <<< "${PATH:-/usr/local/bin:/usr/bin:/bin}"
APPS_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/applications"
for bin_dir in "${BIN_DIRS[@]}"; do
for bin_path in "$bin_dir"/qemu-system-*; do
[ -x "$bin_path" ] || continue
bin_name="$(basename "$bin_path")"
@SmartFinn
SmartFinn / pet-snippet.toml
Last active February 28, 2023 16:43
description
[[snippets]]
description = "Pull and merge GitHub PR"
command = "git pull origin pull/<issue_number>/head"
tag = ["git", "github"]
output = ""
[[snippets]]
description = "Featch GitHub PR"
command = "git fetch origin pull/<issue_number>/head:<new_branch_name>"
tag = ["git", "github"]
@SmartFinn
SmartFinn / fdedupes.sh
Last active January 8, 2020 17:44 — forked from aravindkumarsvg/delete-dupfiles.sh
Replaces the duplicate files with the hard link to the file which comes first in the sorting
#!/usr/bin/env bash
# set -x # Uncomment to debug this shell script
set -o errexit \
-o noclobber \
-o pipefail
readonly PROGNAME="$(basename "$0")"
readonly VERSION="0.0.4"
@SmartFinn
SmartFinn / vpnbook.sh
Last active November 28, 2022 20:23 — forked from tobidope/vpnbook
Simple script to extract the ever-changing credentials from Twitter (Facebook) account of the VPN provider VPNBook. Especially useful on OpenWRT based routers.
#!/bin/sh
# Extracts the user and password for the VPNBook free VPN service
# out of their social media
# based on https://gist.github.com/tobidope/8568487
#
# https://gist.github.com/SmartFinn/aec9267db348c0bffd6045e07294e2cd
readonly CONN_ID="vpnbook"
readonly WEBPAGE="https://nitter.net/vpnbook/rss"
readonly AUTH_FILE_TMP="/tmp/vpnbook.$$"
@SmartFinn
SmartFinn / dhcp_option119.py
Last active February 5, 2025 18:55
a script for converting domain names to DHCP Option 119 (Domain Search Option)
#!/usr/bin/env python3
"""Command generator for setting DHCP Option 119
This script converts the specified domain names to DHCP Option 119
(Domain Search Option) and prints commands for various DHCP servers.
USAGE:
./dhcp_option119.py DOMAIN ...
EXAMPLE:
@SmartFinn
SmartFinn / _mixins.scss
Last active January 25, 2017 06:37
SASS Mixins
/// Mixin to prefix several properties at once
/// @author Hugo Giraudel
/// @param {Map} $declarations - Declarations to prefix
/// @param {List} $prefixes (()) - List of prefixes to print
@mixin prefix($declarations, $prefixes: (webkit moz ms o)) {
@each $property, $value in $declarations {
@each $prefix in $prefixes {
#{'-' + $prefix + '-' + $property}: $value;
}
@SmartFinn
SmartFinn / grub.cfg
Last active April 16, 2022 13:48
[Deprecated. Use ventoy.net instead] My GRUB2 config on a USB drive
if serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1; then
terminal_input --append serial
terminal_output --append serial
fi
insmod font
if loadfont ${prefix}/fonts/unicode.pf2; then
if keystatus --shift; then true
else
insmod gfxterm
@SmartFinn
SmartFinn / config.yml
Last active November 30, 2021 14:45
My current config for FlexGet
schedules:
- tasks: '*'
interval:
hours: 1
- tasks: 'LOCAL'
interval:
hours: 4
web_server:
bind: 0.0.0.0