Skip to content

Instantly share code, notes, and snippets.

@simora
simora / learn_python.py
Last active December 3, 2020 00:32
A simple python script to start learning python
import json
import requests
"""
The following script will help you learn python by poking at a simple url
that returns a known value. You can identify what you want to extract,
format as necessary and print it to illustrate your mastery.
"""
@simora
simora / vm_backup.sh
Created August 17, 2019 18:44
Unraid KVM vm backup script
#!/bin/bash
#
# This script will stop all Unraid VMs and rsync the specified src directories to
# the specified dst directory. All src directories will be base64 encoded with
# hostname and directory path to eliminate potential naming collisions and
# the need for character escapes. This will complicate restoration of
# backup data. The following illustrates what will be written and how to decode
# the base64 string.
#
# # echo $SRC
@simora
simora / setup-sync-node.sh
Last active October 16, 2019 21:09
Script to setup the Hardkernel Odroid HC1/2 and XU4 for Wireguard and Resilio-sync
#!/bin/bash
function set_hostname() {
read -r -p 'Hostname: ' hostname
hostname $hostname
}
function install_pkgs() {
apt install -y vim libmnl-dev libelf-dev build-essential pkg-config git parted xfsprogs
apt-mark hold linux-odroid-5422
#!/usr/bin/env bash
DESTDIR="/dvr/Olympics"
SCRIPT=$(readlink -f $0)
SCRIPTDIR=$(dirname ${SCRIPT})
SCRIPTFN=$(basename "$SCRIPT")
BASE=$(dirname ${SCRIPTDIR})
PLEXFILE="$1"
PLEXFN=$(basename "$1")
PLEXFN_NOEXT=${PLEXFN%.*}