Skip to content

Instantly share code, notes, and snippets.

@subvillion
subvillion / script-template.sh
Created November 18, 2022 09:05 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@subvillion
subvillion / import
Created May 5, 2022 12:13 — forked from Pliner/import
Mikrotik antifilter.download update script
:do {
:do {
/file remove "/ipsum.rsc";
/file remove "/subnet.rsc";
} on-error={}
:put "Downloading ipsum.rsc...";
:do {
/tool fetch url="https://antifilter.download/list/ipsum.rsc" dst-path="/ipsum.rsc"
} on-error={
@subvillion
subvillion / KVM Attempt 1
Created April 13, 2022 07:59 — forked from ilude/KVM Attempt 1
KVM virt-install command
qemu-img create -f qcow2 /pool/vms/xp.qcow2 50G
sudo virt-install --connect qemu:///system -n xp -r 512 --disk path=/pool/vms/xp.qcow2,size=50 \
-c /pool/iso/windows/en_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73974.iso \
--graphics vnc,listen=0.0.0.0,port=65322 --noautoconsole \
--os-type windows --os-variant winxp
@subvillion
subvillion / pick_word.py
Created January 2, 2017 11:40 — forked from ed-flanagan/LICENSE
Oren Tirosh’s mnemonic word list
#!/usr/bin/env python3
import random
def main():
with open("wordlist.txt", "r") as word_file:
words = [word.rstrip() for word in word_file.readlines()[2:]]
print(random.choice(words))
@subvillion
subvillion / img.py
Created January 27, 2013 15:15 — forked from bobuk/img.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Video of this screencast: https://vimeo.com/57296525
#
#
from __future__ import print_function, division, absolute_import
from PIL import Image as pImage
import numpy