This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env /usr/bin/arch -arm64 /bin/bash | |
# shebangarch.sh: This is how you can set architecture of your shellscript runtime by using unconventional shebang | |
# comes in handy for M1+ Macs where you can use both arm64 and x86_64 thru Rosetta 2 | |
echo "I'm $(arch) 😊" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# natpmprfr.sh: Maps network ports thru NAT-PMP and refreshes that mapping automatically | |
# (https://en.wikipedia.org/wiki/NAT_Port_Mapping_Protocol) | |
# | |
# Useful for applications with poor or without NAT-PMP implementation | |
# (http://miniupnp.free.fr/libnatpmp.html) | |
# | |
# Script can set UFW rules according to mapped/unmapped local ports | |
# (https://help.ubuntu.com/community/UFW) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# microsync.sh: Syncing two directories by creating symlinks at destination. | |
source="/Users/user/source" | |
destination="/Users/user/destination" | |
# Delete broken symlinks and empty directories if any | |
find "$destination" -type l ! -exec test -e {} \; -exec rm {} \; | |
find "$destination" -type d -empty -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# afterdark.sh: Old-school screensaver functionality for GNOME/Wayland desktops | |
# This script will launch arbitrary command after specified time period if there is no inhibiting applications running | |
# Started process will be terminated after the first sight of user activity | |
# You supposed to launch something like full-screen video or cmatrix :) | |
start_after=15 # minutes | |
cmd="mpv /home/test/Videos/after_dark.mp4 --fs --loop --no-osc" | |
lock_screen=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from urllib import request | |
rpz_file = 'rpz-filter.db' | |
hosts_file_url = 'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts' | |
comment_char = '#' | |
local = ('127.0.0.1', '255.255.255.255', '::1', 'f') | |
default_route = '0.0.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from socket import socket, AF_INET, SOCK_STREAM | |
addresses = [ | |
{'example.com': 80}, | |
{'example.com': 443}, | |
{'host-1234567890-notexist.example.com': 1234}] | |
def echo(addresses: list): | |
results = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
ECHO ++++++++++++++++++++ | |
ECHO + riprunner 1.0 + | |
ECHO ++++++++++++++++++++ | |
rem This script will launch your executable and terminate it after its window will be closed. | |
rem Useful for hunting down zombie processes. | |
rem | |
rem (i) Possible start priorities: LOW, NORMAL, HIGH, REALTIME, ABOVENORMAL, BELOWNORMAL. | |
rem (i) Timeout between checks are set in seconds. |