Skip to content

Instantly share code, notes, and snippets.

@m-radzikowski
m-radzikowski / script-template.sh
Last active November 15, 2024 11:25
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...]
@nagleaidan
nagleaidan / ngrok-plex.py
Created November 4, 2019 23:17
Run plex through ngrok
#!/usr/bin/python3
from plexapi.myplex import MyPlexAccount
import sys
import json
import requests
import time
# need time for ngrok to start up before requesting data
print("Waiting 15 seconds for ngrok to start up")
@esamson
esamson / calibre-install-user.sh
Created November 10, 2018 10:45
Install Calibre on Linux without sudo
wget https://download.calibre-ebook.com/linux-installer.sh
sh linux-installer.sh install_dir=~/.local/opt isolated=True
@plembo
plembo / CalibreServerOnLinux.md
Last active May 21, 2024 14:50
Calibre Server on Linux

Calibre Server on Linux

Introduction

Calibre is a powerful cross-platform, open source, ebook manager and editing platform. Its calibre-server component can be used to publish an e-book library on a local network. While you can launch calibre-server as a desktop application, it can also be run as a daemon on a headless Linux server.

This tutorial on setting up calibre-server using Ubuntu 14.04 is very good, but dated.

@dcondrey
dcondrey / ffmpegchapters-explicit.sh
Created April 20, 2016 08:34
Use ffmpeg to split file by chapters. Python version and bash version
#!/bin/bash
# Author: http://crunchbang.org/forums/viewtopic.php?id=38748#p414992
# m4bronto
# Chapter #0:0: start 0.000000, end 1290.013333
# first _ _ start _ end
while [ $# -gt 0 ]; do
ffmpeg -i "$1" 2> tmp.txt
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active November 10, 2024 05:28
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@dangtrinhnt
dangtrinhnt / utils.gs
Created November 19, 2014 14:10
Convert row data to dictionary using Google Apps Script
function rowToDict(sheet, rownumber) {
var columns = sheet.getRange(1,1,1, sheet.getMaxColumns()).getValues()[0];
var data = sheet.getDataRange().getValues()[rownumber-1];
var dict_data = {};
for (var keys in columns) {
var key = columns[keys];
dict_data[key] = data[keys];
}
return dict_data;
}