Skip to content

Instantly share code, notes, and snippets.

# This is the mount script I have been using for my crypt drive.
# So far, these settings have been stable enough to use as a library source in Plex.
#
# start/enable this unit passing the remote name ("instance") you want to mount.
# example: sudo systemctl start rc-mount@gcrypt.service #instance is "gcrypt"
# instance needs to be defined in your rclone.conf
#
# Assuming:
# rclone is located at /usr/bin/rclone
#
@checktravis
checktravis / arewethereyet.sh
Last active October 6, 2018 18:32
simple "how much longer" bash script (inspired by waiting on a disk to zero out with DD, watching "892044574720 bytes (892 GB, 831 GiB) copied, 9013 s, 99.0 MB/s"
if [ $# -lt 3 ]
then echo "expecting 3 numaric prams: # goal size in GB, # amount complete in GB, # speed in MB/s"
exit 1
fi
goal=$1
sofar=$3
speed=$2
onegbmb=1024
@checktravis
checktravis / enter-chroot.bash
Created September 16, 2018 23:41 — forked from linkdd/enter-chroot.bash
Script to manage chroot
#!/bin/bash
if [ "$UID" != "0" ]
then
echo "You have to be root" >&2
exit 1
fi
CHROOT=$1
@checktravis
checktravis / safe-multi-ff.info
Created July 31, 2018 12:59
multi-touch (screen) zoom in Ubuntu Firefox without introducing font artifacts.
Open with env var MOZ_USE_XINPUT2 from command line
$ MOZ_USE_XINPUT2=1 /usr/bin/firefox
This gives us multifouch zooming (albeit a bit clunky). It also seems to add some memory issues with
the display of fonts. If you see random bold / blurry / jagged head over to preferences and search
for "smooth" and uncheck "Use smooth scrolling"
@checktravis
checktravis / Dockerfile
Created July 16, 2018 03:07
docker-compose,yml & Dockerfile for plex with sqlitebrowser and xforwarding (for ssh/remote/headless)
FROM plexinc/pms-docker:plexpass
RUN apt-get update && apt-get install software-properties-common -y
RUN add-apt-repository -y ppa:linuxgndu/sqlitebrowser
RUN apt-get update && apt-get install sqlitebrowser -y
@checktravis
checktravis / readme.md
Created June 23, 2018 19:37
fix npm permissions, solve for error "npm WARN checkPermissions Missing write access to /usr/lib/..."

ref. npm/npm#8165 (comment)

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'

vim ~/.profile # add this line:
export PATH=~/.npm-global/bin:$PATH

source ~/.profile
@checktravis
checktravis / GCS-Dockerfile
Last active June 15, 2018 01:03
Experimenting node deployment from within Google Cloud Shell. The default image has node but not yarn. It is configurable with a Dockerfile, this seems to work: (this would be a DEV source, not optimized for prod)
FROM gcr.io/cloudshell-images/cloudshell:latest
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install yarn -y
# Add your content here
# To trigger a rebuild of your Cloud Shell image:
# 1. Commit your changes locally: git commit -a
# 2. Push your changes upstream: git push origin master
#!/bin/bash
# int_ = not exported
# COLOR CODES https://en.wikipedia.org/wiki/ANSI_escape_code
NC='\033[0m'
BLUE='\033[0;34m'
int_selectHeader() {
printf "Select a subfolder of ${BLUE}$1${NC}:" | fold -s -w 80
echo
#!/bin/bash
. /usr/local/bin/myFunctions.sh
SRCDIR="/downloads/completed"
DESTDIR="/backup"
###############################################################################
# goto in bash https://bobcopeland.com/blog/2012/10/goto-in-bash/
function jumpto
{
label=$1
cmd=$(sed -n "/$label:/{:a;n;p;ba};" $0 | grep -v ':$')
@checktravis
checktravis / rsyncGo.sh
Last active February 14, 2018 23:48
Simple script to copy (rsync) directories. Resumable, verbose. ex: $ ./rsyncGo.sh "/source/*" "/dest/" # contents under source/ will be copied in dest/
#! /bin/bash
echo "starting syncing $1 to $2"
rsync -r -vh --append-verify --no-compress --info=progress2 --out-format='[%t] [%i] (Last Modified: %M) (bytes: %-10l) %-100n' $1 $2
echo "completed"