Skip to content

Instantly share code, notes, and snippets.

View DepthDeluxe's full-sized avatar

Colin Heinzmann DepthDeluxe

View GitHub Profile
@DepthDeluxe
DepthDeluxe / copy.py
Last active April 18, 2022 15:33
TeraStation Copy.py
#!/usr/bin/python3
'''
This script leverages the command execution mode of acp-commander to dump files from the TeraStation to a user's local machine.
'''
import argparse
import subprocess
import sys
from os.path import exists
@DepthDeluxe
DepthDeluxe / restic-backup.sh
Last active September 1, 2021 20:33
Restic Cron Script
#!/bin/bash
# Adapted from https://github.com/erikw/restic-systemd-automatic-backup/blob/master/usr/local/sbin/restic_backup.sh
set -e -o pipefail
export PATH="/bin:/usr/bin:/usr/local/bin"
RESTIC="/usr/local/bin/restic"
RESTIC_ENV="${HOME}/.restic.env"
BACKUP_TAG='cron'
even_matrix = [
[ 0, 1, 2, 3 ],
[ 4, 5, 6, 7 ],
[ 8, 9, 10, 11 ],
[ 12, 13, 14, 15 ]
]
odd_matrix = [
[ 0, 1, 2, 3, 4 ],
[ 5, 6, 7, 8, 9 ],
@DepthDeluxe
DepthDeluxe / DriverTests.inf
Created June 16, 2020 16:32
Sample INF for control driver not associated with any PNP device
;
; DriverTests.inf
;
[Version]
Signature="$WINDOWS NT$"
Class=Sample ; TODO: edit Class
ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171} ; TODO: edit ClassGuid
Provider=%ManufacturerName%
CatalogFile=DriverTests.cat
@DepthDeluxe
DepthDeluxe / lpass-tool.sh
Last active November 11, 2019 22:06
Combines the power of lastpass cli and fzf to offer an interactive fuzzy finding password experience on the command line. Lists all lastpass passwords and pipes into FZF to search by name. Once selected, the script copies desired password to the system clipboard.
#!/bin/bash
lpass_data=$(lpass ls)
if [[ "$lpass_data" == "" ]]; then
echo 'Error: You are likely not logged into lastpass, attempting to login'
exit 1
fi
chosen_element=$(echo "$lpass_data" | fzf)
location /util {
allow all;
default_type 'text\plain';
root /dev/null;
location /util/display_filesize_bytes {
set_by_lua $my_var '
function fsize(filename)
local file = io.open(filename, "r")
local size = file:seek("end")
// for the paper, chose charge time T=0.56ms, used Timer0
// voltage sample times
// k = 70 usec
// l = 280 usec
// m = 490 usec
const unsigned int totalPeriodTicks = 140u; // 560 usec
const unsigned int kTimeTicks = 17u; // 70 usec
const unsigned int lTimeTicks = 70u; // 280 usec
const unsigned int mTimeTicks = 120u; // 480 usec

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname