Skip to content

Instantly share code, notes, and snippets.

View mslinn's full-sized avatar

Mike Slinn mslinn

View GitHub Profile
@mslinn
mslinn / decompile.bat
Last active March 19, 2024 17:07
Decompile JVM class files using IntelliJ IDEA's embedded FernFlower decompiler
java -cp "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.2\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs=true . src
@mslinn
mslinn / update.sh
Last active March 11, 2024 17:09
Bash Script to Update all Git Directories Below Specified Directories
#!/bin/bash
# Update all git directories below specified directories
# Skips directories that contain a file called .ignore
# See https://stackoverflow.com/a/61207488/553865
HIGHLIGHT="\e[01;34m"
NORMAL='\e[00m'
export PATH=${PATH/':./:'/:}
@mslinn
mslinn / cronTest
Last active September 27, 2023 10:35
Run a cron job manually and immediately
#!/bin/bash
# Execute a user crontab entry with the proper environment
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
env -i bash --noprofile --norc -c "$DIR/cronTest2 $USER"
@mslinn
mslinn / instructions.txt
Created November 13, 2015 21:53
Create a PPA repository on S3
$ # see https://github.com/krobertson/deb-s3
$ sudo apt-get install ruby2.1-dev
$ sudo gem install deb-s3
$ cd ~/pound
$ aws s3api create-bucket --bucket mslinn-ppa --acl public-read
{
"Location": "/mslinn-ppa"
}
$ deb-s3 upload --bucket mslinn-ppa pound_2.7f-0ubuntu1_amd64.deb
$ deb-s3 verify -b mslinn-ppa
#!/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 {
@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

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 / PomToSbt.scala
Last active March 18, 2022 01:10
Convert pom.xml to build.sbt
import scala.xml._
// To convert a Maven pom.xml to build.sbt:
// 1) Place this code into a file called PomToSbt.scala next to pom.xml
// 2) Type scala PomtoSbt.scala > build.sbt
// The dependencies from pom.xml will be extracted and place into a complete build.sbt file
// Because most pom.xml files only refernence non-Scala dependencies, I did not use %%
val lines = (XML.load("pom.xml") \\ "dependencies") \ "dependency" map { dependency =>
val groupId = (dependency \ "groupId").text
val artifactId = (dependency \ "artifactId").text