Skip to content

Instantly share code, notes, and snippets.

View MrDrMcCoy's full-sized avatar

Jeremy McCoy MrDrMcCoy

View GitHub Profile
@MrDrMcCoy
MrDrMcCoy / tumbleweed-setup.bash
Last active July 10, 2021 23:46
This script sets up my preferred OpenSuSE Tumbleweed desktop so that I can get on with work and play without fuss.
#!/bin/bash -ve
#####
# This script will take a fresh OpenSuse Tumbleweed (KDE Plasma Desktop) install and make it suitable for getting stuff done.
#####
trap exit INT TERM QUIT HUP ERR
# add tmpfs mount for better speed
grep ' /tmp ' /etc/fstab >/dev/null || sudo tee -a /etc/fstab <<< "tmpfs /tmp tmpfs noatime,nodiratime"
@MrDrMcCoy
MrDrMcCoy / update-workstation.bash
Last active March 18, 2022 09:16
Install and update VMware Workstation and Horizon View Client for OpenSUSE Tumbleweed
#!/bin/bash
#this script can be run from:
#curl -Ls https://git.io/vie2W | bash -s -- -i
trap exit SIGINT SIGTERM SIGKILL
function usage () {
echo "
About:
This script installs and updates the necessary kernel modules for VMware Workstation and the Horizon View Client to work on OpenSUSE Tumbleweed x64.
#!/bin/bash
trap exit SIGINT SIGTERM
sshcmd="ssh -q -o StrictHostKeyChecking=no"
hostlist=""
username=""
outfile=""
totalhosts=0
while getopts :u:f:o:h arg ; do
case $arg in
u)
@MrDrMcCoy
MrDrMcCoy / linkdupes.py
Last active December 11, 2017 23:58
A simple duplicate file finder
#!/usr/bin/python2
def linkdupes(base_dir, loglevel='DEBUG'):
import logging, mimetypes, os, zlib
logging.basicConfig(format='%(asctime)s | %(levelname)s | %(funcName)s | %(message)s')
logger = logging.getLogger('linkdupes')
logger.setLevel(logging.getLevelName(loglevel))
mimetypes.add_type('audio/ape', '.ape')
hashes = {}
#!/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)
#####
@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 ([email protected])
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
@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 \
#!/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 / README.md
Last active November 3, 2024 12:54
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 -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 <<< "