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 / 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 / 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
#!/usr/bin/env bash
# I don't know if this will work. It may end up fixing display, but need to be run every time it goes wonky.
# It might not even do that and just do nothing.
# https://askubuntu.com/questions/1030929/ubuntu-18-04-lts-display-flashes-and-turns-upside-down-how-to-fix
# obtain output using xrandr -q
xrandr --output LVDS-1 --rotate normal
exit
@gmcclins
gmcclins / daemon.json
Created June 22, 2018 02:51
Docker breaks LXC networking. This will fix it.
# create /etc/docker/daemon.json if does not exist and paste below
{
"iptables": false
}