Skip to content

Instantly share code, notes, and snippets.

View MrDrMcCoy's full-sized avatar

Jeremy McCoy MrDrMcCoy

View GitHub Profile
@MrDrMcCoy
MrDrMcCoy / rclone-eye.sh
Created July 7, 2021 19:05
Scrape the-eye.eu using rclone
#!/usr/bin/env bash
#####
# Scrape the-eye.eu using rclone
#####
trap 'exit 1' INT TERM KILL
rclone_opts=(
# --dry-run

Keybase proof

I hereby claim:

  • I am mrdrmccoy on github.
  • I am mrdrmccoy (https://keybase.io/mrdrmccoy) on keybase.
  • I have a public key ASCbfHBqKdF_iQw-Ctf44D7VUBEmexsPsE4SzljIIwaQngo

To claim this, I am signing this object:

@MrDrMcCoy
MrDrMcCoy / Caddyfile
Created August 23, 2019 21:55
Run Nextcloud, Bitwarden_rs, and poste.io with Caddy proxy in Docker
yourhost.com {
redir / https://cloud.yourhost.com 301
}
cloud.yourhost.com {
tls admin@yourhost.com
header / Strict-Transport-Security "max-age=31536000;"
root /var/www/html
fastcgi / nextcloud:9000 php {
connect_timeout 1h
@MrDrMcCoy
MrDrMcCoy / bash-assignment.md
Last active June 14, 2019 12:18
Bash scripting excersize

Bash coding assignment: Write a wrapper script for ffmpeg

ffmpeg is a command-line tool for transcoding (converting) media like video and audio files. It is extraordinarily powerful, but also not terribly easy or convenient to use. That's where the script comes in: Your goal is to set up a few defaults for yourself for when you need to use ffmpeg so that you don't have to remember or type out the whole command line.

While not strictly necessary, we will also be adding argument parsing, loops for dealing with multiple files, and error handling.

Requirements

Your script must accomplish the following things:

#!/bin/bash -ev
trap exit INT TERM QUIT HUP ERR
##### remove sudo reauthentication timeout
sudo sed -i.bak -e '$a\' -e 'Defaults timestamp_timeout=-1' -e '/Defaults timestamp_timeout=.*/d' /etc/sudoers
##### set better ssh defaults
mkdir -vp $HOME/.ssh
tee $HOME/.ssh/config <<< "
@MrDrMcCoy
MrDrMcCoy / README.md
Last active February 2, 2022 16:16
How to handle automatic bind mounting for shared directories with Proxmox/LXC

The Problem

Proxmox has a neat UI for adding extra storage to containers. However, if that storage already exists somewhere or needs to exist for more than one container, you're SOL. Bind mounting is an easy way to take a mount and make it exist in more than one place. However, bind mounting has to be done in a particular order with Proxmox due to how it creates device nodes and pre-populates directories. This is very frustrating, but not unsolvable.

The solution

ZFS needs to come up first

If you are using ZFS for your storage (which you should), you need to ensure that all of ZFS's mounts are fully online before proxmox does anything. You will need to add After=zfs.target to the [Unit] section of the Proxmox Systemd service files. The change needs to be applied to the following files:

#!/bin/bash
set -o pipefail
set -s
#####
# This script will take a fresh Solus install and make it suitable for getting stuff done.
#####
trap exit SIGINT SIGTERM
@MrDrMcCoy
MrDrMcCoy / install-ardour.bash
Last active June 12, 2022 04:07
Script to compile Ardour on KDE NEON
#!/bin/bash
sudo aptitude -f install \
glibmm-2.4-dev \
gtk-clearlooks-gperfection2-theme \
clearlooks-phenix-theme \
itstool \
jack \
libarchive-dev \
libasound2-dev \
libaubio-dev \
@MrDrMcCoy
MrDrMcCoy / amipwned.py
Last active September 7, 2019 18:34
Check for compromised credentials from CSV export.
#!/usr/bin/env python
"""
Author: Jeremy McCoy (jeremy@awesomegeek.com)
License: WTFPL
About:
This script helps you to check if any of your usernames and passwords have
been found in major security leaks.
It Will take your decrypted passwords from KeePass or simlar and send SHA1
#!/bin/bash
set -o pipefail
set -s
#####
# This script will take a fresh KDE Neon install and make it suitable for getting stuff done.
# It may not work against another Ubuntu Installation type.
# Run it with: bash <(wget -qO- https://git.io/vSe77)
#####