Skip to content

Instantly share code, notes, and snippets.

View Knetic's full-sized avatar

George Lester Knetic

View GitHub Profile
@Knetic
Knetic / acquireCert.sh
Last active February 1, 2021 01:43
Acquires a certificate from LetsEncrypt
#!/bin/bash
# Acquires a certificate for the given domain.
# Runs the certbot container - so as to not litter the host FS with python nonsense.
# If the keys do not already exist, this will generate strong elliptical curve keys (not susceptible to Logjam).
# Resultant certs/keys are placed in `/etc/letsencrypt/certs`, which ought to be mounted into other applications.
# Must be run from a device able to take traffic for the given domain name,
# since this hands-off method uses an http challenge to show LetsEncrypt that we own the domain.
@Knetic
Knetic / ue4build.sh
Last active July 10, 2018 11:11
Recompiles and hot-reloads the game module for a ue4 project from commandline
#!/bin/bash
# No arguments - run in the same directory as your "*.uproject" file.
UNR_PATH="<PATH_TO_YOUR_UNREALENGINE>/UnrealEngine"
RANDNUM=$(( ( RANDOM % 1000 ) + 1000 ))
CURR_DIR=$(pwd)
PROJECT_PATH=$(find ${CURR_DIR} -maxdepth 1 -name "*.uproject")
PROJECT_FILE=$(basename ${PROJECT_PATH})
PROJECT_NAME=${PROJECT_FILE%.*}
@Knetic
Knetic / headset.sh
Last active March 31, 2020 00:28
Ensures bluetooth audio device is connected and using a2dp
#!/bin/bash
# headset.sh
# Created; April 2018
# Author; George Lester
# Under Mint Linux 17 and 18, on multiple devices, I consistently found that
# my bluetooth headset wouldn't reliably use a2dp, instead favoring the phone profile,
# and would completely refuse to switch to a2dp.
@Knetic
Knetic / exportUnityPackage.py
Last active January 6, 2017 03:55
fixed copy/paste error
#!/usr/bin/env python
# Invokes a build of this project's assets as a unitypackage.
# Working directory must be in the top-level of the project, i.e., "Assets" must be directly underneath cwd.
import sys
import os
import subprocess
from distutils.spawn import find_executable
# Determines a Unity editor executable that is available from the PATH.
#!/usr/bin/env python
# syncUnchangeP4.py
# Date: 2016-01
# Author; George Lester
# Recurses all folders underneath the path given by the first positional parameter,
# finding all git repos. As it finds repos, it checks to see if they're gitp4 repos.
# If the repo is gitp4 and contains no local uncommitted changes, this performs a `git p4 rebase`.
@Knetic
Knetic / installAPK.py
Last active March 17, 2022 18:37
Guarantees an APK file will be freshly installed onto an Android device
#!/usr/bin/env python
# installAPK.py
# Author; George Lester
# Created; 2016-01
# Uninstalls (and reinstalls) the given APK by path.
# This is needed in some cases where:
# - signed/unsigned APKs conflict,
# - `adb install -r` does not actually do anything,
@Knetic
Knetic / lored.sh
Last active December 4, 2015 23:25
Starts and stops local redis instances by index, so that you don't need to remember commands/pids/files to do so
#!/bin/bash
# lored.sh
# Starts and stops local redis instances by index
# so that you don't need to manually type "redis-server --port...." and then later manually `kill` them.
# Author; George Lester
# Date; 2015/12
###