Skip to content

Instantly share code, notes, and snippets.

View dylanmtaylor's full-sized avatar

Dylan M. Taylor dylanmtaylor

View GitHub Profile
Based on https://gist.githubusercontent.com/heppu/6e58b7a174803bc4c43da99642b6094b/raw/96b7ab0ea6356ac783fe4c90d1cb7073bdbb107f/ARCH_INSTALL.MD
# Create bootable USB
Download iso and use Etcher
# Boot from USB and set prepare system
```bash
timedatectl set-ntp true
@dylanmtaylor
dylanmtaylor / gist:f8f1f8a7f0255fab0b9fb2c23eb7de32
Created May 4, 2018 19:13
Use gem jekyll to build on change.
/var/lib/gems/2.5.0/gems/jekyll-3.8.1/exe/jekyll b --watch
From blog folder:
./jekyll-post.py "NAME" -D _posts; rename 'y/A-Z/a-z/' _posts/*
@dylanmtaylor
dylanmtaylor / rename.sh
Created April 27, 2018 03:17
Rename upper to lower
rename 'y/A-Z/a-z/' *
@dylanmtaylor
dylanmtaylor / fedora-latest-stable-kernel.sh
Last active April 24, 2018 03:50
Install Latest Stable Kernel on Fedora
curl -s https://repos.fedorapeople.org/repos/thl/kernel-vanilla.repo | sudo tee /etc/yum.repos.d/kernel-vanilla.repo
sudo dnf config-manager --set-enabled kernel-vanilla-stable
@dylanmtaylor
dylanmtaylor / aliases.sh
Last active April 21, 2018 01:13
Aliases and Snippets
# Update all the things on Ubuntu
alias dup="sudo apt clean all; sudo apt update; sudo apt -y full-upgrade; sudo flatpak update; sudo snap refresh; sudo apt autoremove"
# Check primary nvme drive status
alias nvmeck='sudo smartctl -a /dev/nvme0'
# Connect to my OpenVPN server
alias ovpn='sudo openvpn ~/openvpn_cert.ovpn'
# Fetch latest ISO for OpenSUSE Tumbleweed
alias tumbleweed='wget -N http://download.opensuse.org/tumbleweed/iso/openSUSE-Tumbleweed-DVD-x86_64-Current.iso'
# Fortune-telling rainbow cow. For fun.
fortune | cowsay | lolcat
@dylanmtaylor
dylanmtaylor / gist:2755fc5bd5b5f3dc80953479b80fd98d
Created April 30, 2016 02:41
Unzip folder of zip files to matching directories
find . -name '*.zip' -exec mkdir -p "Unzipped/{}" \;
find . -name '*.zip' -exec unzip -o -d Unzipped/{}/ {} \;
@dylanmtaylor
dylanmtaylor / iptables-kvm-cheatsheet.txt
Created April 3, 2016 03:02
How to forward requests from a host machine to a KVM guest and back using iptables
# echo 1 > /proc/sys/net/ipv4/ip_forward first
# 208.x.x.x is the host machine. 192.x.x.x is the guest machine
# This routes port 80 to the guest and back.
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.x.x.x6:80
iptables -t nat -A POSTROUTING -p tcp -d 192.x.x.x6 --dport 80 -j SNAT --to-source 208.x.x.x
# This routes port 2222 on the host to 22 on the guest machine
iptables -t nat -A PREROUTING -p tcp --dport 2222 -j DNAT --to-destination 192.x.x.x6:22
iptables -t nat -A POSTROUTING -p tcp -d 192.x.x.x6 --dport 22 -j SNAT --to-source 208.x.x.x
@dylanmtaylor
dylanmtaylor / crontab
Last active August 29, 2015 14:19
vps server crontab
*/1 * * * * su -s /bin/sh root -c 'cd /home/dylanmtaylor.com/public_html/ && /usr/bin/git pull origin master' &> /dev/null
*/15 * * * * su -s /bin/sh root -c 'cd /home/fwc.dylanmtaylor.com/public_html/ && /usr/bin/git pull origin master' &> /dev/null
00 00 * * * su -s /bin/sh root -c 'cd /home/dylanmtaylor.com/public_html/images/ && sh /home/dylanmtaylor.com/public_html/images/crushall.sh' &> /dev/null
@dylanmtaylor
dylanmtaylor / autokey.sh
Created April 19, 2015 05:17
Fix Autokey
if grep -q 'Autokey' <(echo `gsettings get com.canonical.Unity.Panel systray-whitelist`); then echo "'Autokey' exists in Unity panel whitelist. Nothing to do here."; else echo "Adding 'Autokey' to Unity panel whitelist." && gsettings set com.canonical.Unity.Panel systray-whitelist "`echo \`gsettings get com.canonical.Unity.Panel systray-whitelist | tr -d ]\`,\'Autokey\']`"; fi