Skip to content

Instantly share code, notes, and snippets.

View gmcclins's full-sized avatar

Geoffrey McClinsey gmcclins

View GitHub Profile
@gmcclins
gmcclins / .bash_aliases
Last active August 29, 2015 14:19
alias file
# start a fresh docker container and delete changes on exit
alias docker-fresh='docker run --rm -i -t ubuntu:15.04 /bin/bash'
# Git commit log
alias git-get='git log --oneline --graph'
@gmcclins
gmcclins / non-ascii-del
Created April 26, 2015 05:51
cleans up text files by removing non-ascii
#!/usr/bin/env bash
# This script cleans up text files by removing non-ascii
# Geoffrey McClinsey
set -e
echo what file has the non-ascii text? #include path to file if not in same location as script
read dirty
echo -e "\v"
@gmcclins
gmcclins / vagrant-hostname-down.sh
Created May 26, 2015 15:57
manage a vagrant host with systemd
#!/usr/bin/env bash
#
# script to stop vagrant box for use with systemd
# place scripts into /usr/lib/systemd/scripts/
# be sure to put the .service file in /lib/systemd/system/
#
# -- Geoffrey McClinsey
VAGRANTUSR=vagrant # user you want vagrant box to run as
VAGRANTBOXPATH= # add path to Vagrantfile
@gmcclins
gmcclins / plex.service
Last active May 18, 2016 01:03
systemd unit to start plex on boot
# Place the following as plex.service file in ~/.config/systemd/user
# sudo systemctl enable ~/.config/systemd/user/plex.service
# sudo systemctl daemon-reload
# sudo systemctl restart service.service
[Unit]
Description=Plex service
Requires=docker.service
After=docker.service
@gmcclins
gmcclins / interfaces
Created June 14, 2016 05:54
bridged interface setup [lxd]
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@gmcclins
gmcclins / my-pi-temp.sh
Last active October 25, 2017 16:50
Get CPU & GPU Temps
#!/bin/bash
# Script: my-pi-temp.sh
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# Updated: Geoffrey McClinsey <hashbang.sh> under GPL v2.x+
# Changed: Made the output a little cleaner
# -------------------------------------------------------
gpu=$(/opt/vc/bin/vcgencmd measure_temp)
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
@gmcclins
gmcclins / fstab
Last active May 23, 2022 06:26
fstab for raspbian w/ rootfs on USB and 3 WD USB drives (RASPBERRY PI 2 MODEL B)
# WD External Drives
PARTUUID=9a0b23dd-f3aa-904a-aa36-fbfcb89693e5 /media/WD1 ntfs-3g permissions,locale=en_US.utf8 0 2
PARTUUID=135ced04-ce4e-9a4b-9501-106e92e9c435 /media/WD2 ntfs-3g permissions,locale=en_US.utf8 0 2
PARTUUID=052d07e3-cc87-8647-a0cb-58f406c2513b /media/WD3 ntfs-3g permissions,locale=en_US.utf8 0 2
@gmcclins
gmcclins / ifwsl
Created March 26, 2018 18:14
If WSL
if ! [[ "$(uname -r)" = *Microsoft* ]]; then
@gmcclins
gmcclins / rename.sh
Created April 26, 2018 17:42
rename files avi.mkv to just mkv after convert
for file in *.avi.mkv; do
mv "$file" "${file/avi./}"
done