Skip to content

Instantly share code, notes, and snippets.

Mike Slinn mslinn

Block or report user

Report or block mslinn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mslinn
mslinn / idea
Created Oct 13, 2019
WSL launch script for IntelliJ IDEA
View idea
#!/bin/bash
set -eo pipefail
idea2 "$@" &
@mslinn
mslinn / play27Template
Created Sep 30, 2019
bash script that automatically does the necessary steps for creating a new Play Framework project from play27Template
View play27Template
#!/bin/bash
# Clones play27Template and starts a new SBT project
# Optional argument specifies name of directory to place the new project into
DIR=play27Template
if [ "$1" ]; then DIR="$1"; fi
git clone https://github.com/mslinn/play27Template.git "$DIR"
cd "$DIR"
rm -rf .git
@mslinn
mslinn / wtj
Created Jun 23, 2019
Bash script to display and change Microsoft Terminal color scheme for Ubuntu tabs
View wtj
#!/bin/bash
WTJ="/mnt/c/Users/mslinn/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/RoamingState/profiles.json"
if [[ -z"$1" ]]; then # Display the color schemes
echo -n "Color scheme for this tab is "
jq -r '.profiles[] | select(.name=="Ubuntu") | .colorScheme' "$WTJ"
echo "Color scheme values are:"
jq -r '.schemes[] | .name' "$WTJ" | sort | uniq
else # Set the color scheme
X="$( jq '(.profiles[] | select(.name=="Ubuntu") | .colorScheme)="$1"' "$WTJ" )"
@mslinn
mslinn / profiles.json
Last active Aug 5, 2019
Microsoft Terminal settings file
View profiles.json
{
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"initialCols" : 150,
"initialRows" : 55,
"keybindings" :
[
{
@mslinn
mslinn / cronTest
Last active May 7, 2019
Run a cron job manually and immediately
View cronTest
#!/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 / .cadenzaClient.json
Last active May 1, 2019
Bash incantation for defining whiptail radiolist programmatically
View .cadenzaClient.json
{
"activeDatabase": "localhost",
"databases": [
{
"name": "production",
"PGDB": "asdf",
"PGHOST": "asfd",
"PGPASSWORD": "asf",
"PGPORT": "asdf",
"PGUSER": "asf"
@mslinn
mslinn / buildAlmond
Last active Aug 14, 2019
Almond Installation Builder
View buildAlmond
#!/bin/bash
ALMOND_VERSION=0.4.0
INSTALL_PATH=/tmp
SCALA_VERSION=2.12.9
unset OVERWRITE
function help {
echo "${1}$(basename $0) - Build Almond installer and execute it, then deletes installer and lists the Jupyter kernels.
almond is a Scala kernel for Jupyter. See https://almond.sh/docs
@mslinn
mslinn / c:\wsl\git.bat
Created Apr 26, 2019
Run WSL git from native Windows apps
View c:\wsl\git.bat
@echo off
rem Taken from https://stackoverflow.com/a/54106424/553865
setlocal enabledelayedexpansion
set command=%*
set find=C:\Users\%USERNAME%\AppData\Local\Temp\git-commit-msg-.txt
set replace=/mnt/c/Users/%USERNAME%/AppData/Local/Temp/git-commit-msg-.txt
call set command=%%command:!find!=!replace!%%
echo | C:\Windows\System32\bash.exe -c 'git %command%'
@mslinn
mslinn / less
Last active Apr 21, 2019
View GitHub Markdown files in a console
View less
#!/bin/bash
function help {
echo "View GitHub markdown files in a console using less.
1. Install pandoc and lynx.
a. For Ubuntu (and WSL): sudo apt install pandoc lynx
b. For MacOS: brew install pandoc lynx
2. Name the this script as less and save it somewhere on the PATH, for example /usr/local/bin.
@mslinn
mslinn / buildPound.md
Last active Apr 20, 2019
Build a working version of pound on Ubuntu 18.04
View buildPound.md

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.

You can’t perform that action at this time.