Skip to content

Instantly share code, notes, and snippets.

View brycied00d's full-sized avatar
👍
"Hasn't fucked up recently" engineer.

Bryce Chidester brycied00d

👍
"Hasn't fucked up recently" engineer.
  • Tigard, OR
View GitHub Profile

Keybase proof

I hereby claim:

  • I am brycied00d on github.
  • I am brycec (https://keybase.io/brycec) on keybase.
  • I have a public key whose fingerprint is D52A 28D2 6027 1223 D86A 8DF5 F3E5 CBF7 204B D612

To claim this, I am signing this object:

@brycied00d
brycied00d / gist:627ec6c4235405838247
Created May 29, 2015 09:01
Abusing Nginx Configuration To Serve And Redirect Multiple Subdomains Under a Variable Domain
# The idea is that speedtest.companyA.com can be served from the same server{} block as speedtest.companyB.com
# The index page has links to allow the user to force a connection over ipv4 or ipv6. A connection to /ipv4, for instance,
# will redirect the user to ipv4.speedtest.$X/ where $X is determined dynamically. Likewise for /ipv6, and there's /default
# to redirect to just speedtest.$X/
# Note that this does assume that "ipv4.speedtest.$X" and "ipv6.speedtest.$X" are setup with A and AAAA records respectively.
location = /ipv4 {
# IP access requires a hard-coded IPv4 address for the redirect.
if ($host = "[$server_addr]") { return 302 $scheme://$ipv4addr/; }
if ($host = "$server_addr") { return 302 $scheme://$ipv4addr/; }
@brycied00d
brycied00d / dwstat.pl
Created April 6, 2012 04:53
la11111's dwstat
#!/usr/bin/perl -w
use strict;
use threads;
use threads::shared;
my $script_dir = $ENV{"HOME"}."/.dwm/dwstat";
my $divider = " | ";
@brycied00d
brycied00d / xbindkeys_printscreen.sh
Last active October 10, 2015 19:48
Linux Printscreen+Dropbox Script
#!/bin/bash
capturefile="$HOME/Dropbox/Public/screenshot_`date +%F_%H-%M-%S`.png"
#echo $capturefile
scrot -s "$capturefile"
URL=$(dropbox puburl "$capturefile")
echo -n "$URL" | xclip -selection p
echo -n "$URL" | xclip -selection c
notify-send "Screenshot Uploaded" "Screenshot uploaded as $URL"
echo "$URL"
@brycied00d
brycied00d / update_debian.sh
Created October 31, 2012 22:06
Script to download the latest netboot/net-install files for Debian
#!/bin/bash
MIRROR=mirrors.us.kernel.org
ROOTDIR=/home/image/boot/
# http://$MIRROR/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz
# http://$MIRROR/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/linux
# $ROOTDIR/Debian/squeeze/i386/
for REL in jessie wheezy #squeeze lenny etch sarge
do
for ARCH in i386 amd64
@brycied00d
brycied00d / unpack_and_edit.sh
Created October 31, 2012 22:02
Script to help/automate the unpacking/edit/repacking of our netboot BIOS update images
#!/bin/bash
FILE=${1:-ERROR}
MOUNTPATH=${2:-/mnt/image/}
OWD=$PWD
if [ "x$FILE" = "xERROR" ]
then
echo "No file specified"
exit 1
fi
@brycied00d
brycied00d / update_centos.sh
Created October 31, 2012 22:08
Script to download the latest netboot/net-install files for CentOS
#!/bin/bash
MIRROR=mirrors.us.kernel.org
ROOTDIR=/home/image/boot/
#wget -N http://$MIRROR/centos/5/os/i386/images/pxeboot/initrd.img http://$MIRROR/centos/5/os/i386/images/pxeboot/vmlinuz
#wget -N http://$MIRROR/centos/5/os/x86_64/images/pxeboot/initrd.img http://$MIRROR/centos/5/os/x86_64/images/pxeboot/vmlinuz
#wget -N http://$MIRROR/centos/6/os/i386/images/pxeboot/initrd.img http://$MIRROR/centos/6/os/i386/images/pxeboot/vmlinuz
#wget -N http://$MIRROR/centos/6/os/x86_64/images/pxeboot/initrd.img http://$MIRROR/centos/6/os/x86_64/images/pxeboot/vmlinuz
# Starting with RHEL 7, there are only x86_64 releases (no i386)
@brycied00d
brycied00d / update_ubuntu.sh
Last active October 12, 2015 07:17
Script to download the latest netboot/net-install files for Ubuntu
#!/bin/bash
MIRROR=mirrors.us.kernel.org
ROOTDIR=/home/image/boot
for REL in vivid utopic trusty saucy precise lucid #raring quantal oneiric natty maverick
do
for ARCH in i386 amd64
do
echo "Sync'ing Ubuntu $REL / $ARCH..."
mkdir -p $ROOTDIR/Ubuntu/$REL/$ARCH/
@brycied00d
brycied00d / script.sh
Created October 16, 2015 01:30
Parse TRANS.TBL To Rename Files
#!/bin/sh
# This is a little scriptlet I wrote to take the files I'd copied from a CD under
# Windows, which inexplicably did not honour the RockRidge or Joliet extensions,
# and rename them back to their correct names, and recreate symbolic links.
# Adjust as necessary (eg: some BSDs don't support -v on mv and ln)
#
# Bryce Chidester <bryce@cobryce.com>
#
for DIR in $(find . -type d); do
(cd "$DIR" &&
@brycied00d
brycied00d / update-clonezilla.sh
Created October 18, 2015 01:30
Quick script to update my Clonezilla netboot.
#!/bin/sh
for CZBRANCH in stable alternative; do
# Try to use whatever version was given on the command line on both stable and alternative branches
echo "Processing branch ${CZBRANCH}..."
CZVER=$1
if [ -z ${CZVER} ]; then
# Match the <input> field on the download selector form
CZVER=$(curl -qs http://clonezilla.org/downloads/download.php?branch=${CZBRANCH} | sed -n -r -e 's/.*<input.*name=.version.*value=.(.*).>/\1/p')
echo "Fetched Clonezilla ${CZBRANCH} version ${CZVER}"