Skip to content

Instantly share code, notes, and snippets.

View mslinn's full-sized avatar

Mike Slinn mslinn

View GitHub Profile
@mslinn
mslinn / buildPound.md
Last active April 20, 2019 16:23
Build a working version of pound on Ubuntu 18.04

The following fetches the source code for the Pound reverse proxy and load balancer into a new directory under the current directory and builds it.

  1. Install the necessary packages

    sudo apt install -y git gcc make autoconf automake libssl-dev libpcre3-dev openssl
    
  2. Clone the repo. There are multiple sources, choose the one you want. Both provide support for OpenSSL >= 1.1 and WebSockets. Only perform one of the following commands.

@mslinn
mslinn / forAll
Last active April 17, 2019 16:54
Runs a command on all git directories below the current directory or a specified directory.
#!/bin/bash
shopt -s nullglob
function help {
echo "${1}Runs a command on all git directories below the current directory or a specified directory.
Skips directories that contain a file called .ignore.
Usage: $(basename $0) [options] command [directory]
@mslinn
mslinn / syncAdobe
Created April 3, 2019 21:14
Use WSL to sync 2 SSDs containing Adobe Premiere Pro projects
#!/bin/bash
# Use WSL to sync 2 SSDs containing Adobe Premiere Pro projects
SRC_DRIVE=/mnt/e
SRC="${SRC_DRIVE}/work/training/projects/adobePremierProjects"
TARGET_DRIVE=/mnt/d
TARGET=$TARGET_DRIVE
@mslinn
mslinn / ppro_cs6
Last active July 6, 2020 02:50
Convert later versions of Adobe Premiere Pro .prproj files to CS6
#!/bin/bash
# Not tested on MacOS, only tested on Ubuntu (& WSL) converting to CS6
# See https://forums.adobe.com/thread/2553496?red=a
# .prproj files are actually gzips.
#
# 1 - If converting from PPro CC, extract contents (just one file, without a filetype).
# 2 - For converting to PPro CS6, MUST change this line to read Version="25"; for converting to earlier versions the value could be Version="1":
# <Project ObjectID="1" ClassID="62ad66dd-0dcd-42da-a660-6d8fbde94876" Version="35">
#!/bin/bash
GNAME=gowalkthrough
GACCT="$HOME/.$GNAME"
GPASS="$HOME/gethpassword"
JSON="$HOME/$GNAME.json"
rm -rf "$JSON" "$GACCT"
touch "$GPASS" # empty password
@mslinn
mslinn / visualStudioCodeSettings
Created December 22, 2017 23:39
Visual Studio Code Settings
visualStudioCodeSettings
package com.micronautics.publish
import java.util.UUID
object Evaluation {
def default: Evaluation[Unit, Unit] = new Evaluation[Unit, Unit](identity)
}
case class Evaluation[From, +To](evaluate: (From) => To)
@mslinn
mslinn / Nuke.scala
Created November 19, 2017 19:06
Deletes files and directories recursively
object Nuke {
import java.io.IOException
import java.nio.file.{Files, Paths, Path, SimpleFileVisitor, FileVisitResult}
import java.nio.file.attribute.BasicFileAttributes
import sbt.Logger
/** Adapted from https://stackoverflow.com/a/45703150/553865 */
def remove(root: Path, deleteRoot: Boolean = true)
(implicit log: Logger): Unit = {
log.debug(
@mslinn
mslinn / bfg
Last active November 9, 2017 22:17
Bash script to run BFG
#!/bin/bash
# See https://rtyley.github.io/bfg-repo-cleaner/
JAR=/opt/bfg-1.12.16.jar # Be sure to store BFG here, or edit this line
if [ -z "$1" ]; then
java -jar "$JAR"
exit
fi
@mslinn
mslinn / u
Created September 6, 2017 06:48
Run this as a cron job every 24 hours to keep the system up to date
#!/bin/bash
sudo apt update && sudo apt-get -y --force-yes upgrade && sudo apt-get -y --force-yes autoclean && sudo apt-get -y --force-yes autoremove
if [ `which pip3` ]; then sudo -H pip3 install --upgrade pip; fi
if [ `which pip2` ]; then sudo -H pip2 install --upgrade pip; fi