Skip to content

Instantly share code, notes, and snippets.

View mslinn's full-sized avatar

Mike Slinn mslinn

View GitHub Profile
#!/bin/bash
# Author: Mike Slinn mslinn@mslinn.com
# Modified from AWS version (dynameicDnsAws) 2022-06-30
# Added auth subdomain 2022-08-18
# See https://www.namecheap.com/support/knowledgebase/article.aspx/36/11/how-do-i-start-using-dynamic-dns/
export SAVE_FILE_NAME="$HOME/.dynamicDns"
function help {

Keybase proof

I hereby claim:

  • I am mslinn on github.
  • I am mslinn (https://keybase.io/mslinn) on keybase.
  • I have a public key whose fingerprint is C314 2D6F A505 33FD 58BF 4D37 9A49 B9E4 11A7 3386

To claim this, I am signing this object:

/tmp/ruby-build.20220428104457.2389.OeOKU9 /var/sitesUbuntu/www.mslinn.com
/tmp/ruby-build.20220428104457.2389.OeOKU9/ruby-2.7.6 /tmp/ruby-build.20220428104457.2389.OeOKU9 /var/sitesUbuntu/www.mslinn.com
checking for ruby... /home/mslinn/.rbenv/shims/ruby
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
@mslinn
mslinn / edit_all
Last active March 21, 2022 23:05
Edit all Jekyll projects, one after the other, and rebuild each one
#!/bin/bash
set -e
# Commit changes, the comment does not matter, we are iterating over many files
function commit {
git add -A
git commit -m -
git push
}
@mslinn
mslinn / crop
Last active January 23, 2022 18:06
Trim an audio or video file using ffmpeg
#!/bin/bash
function help {
echo "$(basename $0) - Trim an audio or video file using ffmpeg
Works with all formats supported by ffmpeg.
Seeks to the nearest frame positions by re-encoding.
Does not overwrite pre-existing output files.
Reduces file size procduced by OBS Studio by >80%.
Usage:
@mslinn
mslinn / notepad
Last active January 16, 2022 16:52
Run Notepad++ From WSL
#!/bin/bash
if [ $# != 1 ]; then
echo "Usage: $(basename $0) filename"
echo " If filename is not found in the current directory then subdirectories are searched"
echo " The file is then edited in Notepad++"
echo "Assumes 64-bit version of Notepad++ is installed in the default location."
exit -1
fi
if [ -f "$1" ]; then
@mslinn
mslinn / atom
Last active January 9, 2022 17:51
WSL launch atom
#!/bin/bash
function help {
echo "Edit WSL files or directories in atom, on Windows.
Usage:
$( basename $0 ) [ FILE_OR_DIRECTORY | -l PHRASE ] ...
FILE_OR_DIRECTORY can either be absolute or relative to the current directory.
If no arguments are specified, the current directory is assumed.
@mslinn
mslinn / upgrader
Last active July 15, 2021 19:33
Upgrade Ubuntu from groovy to hirsute
# See https://help.ubuntu.com/community/HirsuteUpgrades
sudo apt install update-manager-core update-manager
sudo cp /etc/apt/sources.list{,.groovy}
sudo sed -i 's/groovy/hirsute/g' /etc/apt/sources.list
sudo perl -pi -e 's/^Prompt=.*/Prompt=normal/' /etc/update-manager/release-upgrades
sudo RELEASE_UPGRADER_ALLOW_THIRD_PARTY=1 do-release-upgrade
@mslinn
mslinn / install.sh
Last active July 15, 2022 19:36
Install AWS Cloud9 on an Ubuntu 20.04 server external to AWS
# Log into your Ubuntu machine then follow these directions
# First allow Cloud9 to ssh to your machine using your account:
# https://docs.aws.amazon.com/cloud9/latest/user-guide/create-environment-ssh.html
# Install required dependencies
if [ -z `which virtualenv` ]; then
sudo pip install virtualenv
fi
if [ -z `apt -qq list libevent-dev 2> /dev/null | grep installed` ]; then
@mslinn
mslinn / scpPass
Last active September 11, 2020 14:11
Wrapper around ssh/sshpass
#!/usr/bin/env python3
# Python3 version of https://askubuntu.com/a/878335/58760
#
# See https://github.com/sorend/sshconf
#
# pip3 install sshconf
from __future__ import print_function
import shutil, subprocess, sys