Skip to content

Instantly share code, notes, and snippets.

View SmartFinn's full-sized avatar
🇺🇦

Serhii Yeremenko SmartFinn

🇺🇦
  • Ukraine
  • 08:16 (UTC +03:00)
View GitHub Profile
@SmartFinn
SmartFinn / DockerHelper.mk
Last active December 3, 2022 11:51
Makefile for Docker as a simple replacement for docker-compose for working with a single service
# DockerHelper.mk is a simple replacement for docker-compose for
# working with a single service.
#
# Usage Examples:
# - https://gist.github.com/SmartFinn/7bb86b078726f0763ce0#file-usage-md
# - https://github.com/SmartFinn/Dockerfiles
#
# @author: Sergei Eremenko (https://github.com/SmartFinn)
# @license: Unlicense (http://unlicense.org)
# @link: https://gist.github.com/SmartFinn/7bb86b078726f0763ce0
@SmartFinn
SmartFinn / ip_firewall_filter.rsc
Last active February 27, 2025 15:03
MikroTik (RouterOS) Zone-Based Firewall Example
# jan/29/2018 22: 4:17 by RouterOS 6.41
#
/interface list
add name=public comment="public network"
add name=local comment="local network"
add name=guest comment="guest network"
# Change the interfaces below to your own
/interface list member
add list=public interface=ether1
@SmartFinn
SmartFinn / dhcp-leases-to-dns.rsc
Last active April 2, 2025 14:12
MikroTik (RouterOS) script for automatically setting DNS records for clients when they obtain a DHCP lease
# MikroTik (RouterOS) script for automatically setting DNS records
# for clients when they obtain a DHCP lease.
#
# author SmartFinn <https://gist.github.com/SmartFinn>
:local dnsTTL "00:15:00";
:local token "$leaseServerName-$leaseActMAC";
# Normalize hostname (e.g. "-= My Phone =-" -> "My-Phone")
# - truncate length to 63 chars
@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
@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 / _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 / dhcp_option119.py
Last active May 20, 2025 09:41
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 / 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 / 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"