Skip to content

Instantly share code, notes, and snippets.

View SmartFinn's full-sized avatar
🇺🇦

Serhii Yeremenko SmartFinn

🇺🇦
  • Ukraine
  • 11:45 (UTC +03:00)
View GitHub Profile
@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 / 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 / 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 / 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 / gmail_label_to_telegram.gs
Last active February 24, 2025 16:33
Forward email marked with custom label to Telegram #google-script #gas
/**
Forward email marked with custom label to Telegram.
Sergei Eremenko (https://github.com/SmartFinn) © 2020
**/
// Custom trigger to run script every 1 min
function startCustomTrigger() {
ScriptApp.newTrigger('checkInbox').timeBased().everyMinutes(1).create()
}
@SmartFinn
SmartFinn / send_email_on_logged_in.rsc
Last active March 15, 2025 17:59
A script to send an email when a user logged in the MikroTik router #RouterOS #MikroTik
# This script sends an email when a new user logged in the router
#
# Required permissions:
#
# [x] read [x] write
# [x] policy [x] test
#
# written by Sergei Eremenko (https://github.com/SmartFinn)
:global TokensOfLoggedUsers
@SmartFinn
SmartFinn / .rsyncignore
Last active January 6, 2023 15:20
[Makefile] Yet another wrapper for rsync
/Makefile
/.rsyncignore
@SmartFinn
SmartFinn / group_by_age.awk
Created November 7, 2020 09:55
Скрипт групує відкриті дані по захворюваності на COVID-19 в Україні по віку
#!/usr/bin/awk -f
# Copyright (c) 2020 Sergei Eremenko (https://github.com/SmartFinn)
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
@SmartFinn
SmartFinn / sym2bind.sh
Last active October 11, 2022 06:40
Replace symlinks to mounted drive with bind mount
#!/usr/bin/env bash
#
# Copyright (c) 2021 Sergei Eremenko (https://github.com/SmartFinn)
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
@SmartFinn
SmartFinn / test_ls_colors.sh
Created October 15, 2022 13:31
Simple script that creates various directories to test your $LS_COLORS setup
#!/usr/bin/env bash
# Simple script that creates various directories to test your $LS_COLORS setup
set -euo pipefail
mkdir -p test
cd test
# File
touch FILE