Skip to content

Instantly share code, notes, and snippets.

View l8nite's full-sized avatar

Shaun Guth l8nite

  • 12:48 (UTC -07:00)
View GitHub Profile
@l8nite
l8nite / dns-sync.sh
Last active August 8, 2018 06:59 — forked from matthiassb/dns-sync.sh
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO

Keybase proof

I hereby claim:

  • I am l8nite on github.
  • I am shaunguth (https://keybase.io/shaunguth) on keybase.
  • I have a public key whose fingerprint is 4401 B0C4 473F AECF BDB2 7BDA 03DF 2A7A 279C CBFC

To claim this, I am signing this object:

@l8nite
l8nite / clone-all-stash-repositories.sh
Created March 2, 2016 05:40
Clone all repositories in stash that you have access to
#!/bin/bash
if [[ "$STASH_USER" == "" || "$STASH_PASS" == "" ]]; then
echo "FATAL: You need to set STASH_USER and/or STASH_PASS"
exit 1
fi
STASH_HOST=${STASH_HOST:-stash.hq.practicefusion.com}
STASH_URL=https://${STASH_USER}:${STASH_PASS}@${STASH_HOST}
@l8nite
l8nite / hound_stash.sh
Last active February 18, 2016 05:12
Make an etsy/hound config file for stash repositories a user/pass have access too
!/bin/bash
if [[ "$STASH_USER" == "" || "$STASH_PASS" == "" ]]; then
echo "FATAL: You need to set STASH_USER and/or STASH_PASS"
exit 1
fi
STASH_HOST=${STASH_HOST:-your.host.here.com}
STASH_URL=https://${STASH_USER}:${STASH_PASS}@${STASH_HOST}
# read config values from vault and export into the shell
vault_secrets_filename=$(mktemp)
http_response=$(curl --fail --silent --connect-timeout 3 -H "X-Vault-Token: ${VAULT_TOKEN}" -X GET http://vault:8200/v1/secret/${PF_ENV}/${PF_APP} -o $vault_secrets_filename --write-out '%{http_code}')
if [[ "$http_response" = "200" ]]; then
eval $(cat $vault_secrets_filename | jq -r '.data | to_entries[] | (.key | ascii_upcase | gsub("/";"_")) as $key | (.value) as $val | "export \($key)=${\($key):=\($val)}"')
elif [[ "$http_response" = "404" ]]; then
echo "Warning: No secrets found in vault."
else
echo "Fatal: Error connecting to vault! Check $vault_secrets_filename for more details."
@l8nite
l8nite / gist:18e1aa073d4c758bf440
Created November 20, 2014 08:18
Quick and dirty way to exclude files from a gemspec
git_tracked_files = `git ls-files -z`.split("\x0")
gem_ignored_files = `git ls-files -i -X .gemignore -z`.split("\x0")
spec.files = git_tracked_files - gem_ignored_files
@l8nite
l8nite / iso-639-2-to-display.xsl
Last active December 29, 2015 09:49
XSL template for converting ISO 639-2 3-letter codes to displayable language name.
<xsl:template name="show-language">
<xsl:param name="languageCode"/>
<xsl:choose>
<xsl:when test="$languageCode = 'eng'">English</xsl:when>
<xsl:when test="$languageCode = 'aar'">Afar</xsl:when>
<xsl:when test="$languageCode = 'abk'">Abkhazian</xsl:when>
<xsl:when test="$languageCode = 'ace'">Achinese</xsl:when>
<xsl:when test="$languageCode = 'ach'">Acoli</xsl:when>
<xsl:when test="$languageCode = 'ada'">Adangme</xsl:when>
<xsl:when test="$languageCode = 'ady'">Adyghe; Adygei</xsl:when>
@l8nite
l8nite / gist:7101818
Created October 22, 2013 14:36
Workman keyboard layout creator file with fixed VK settings
KBD Layout01 "US - Workman - Custom"
COPYRIGHT "(c) 2012 Company"
COMPANY "Company"
LOCALENAME "en-US"
LOCALEID "a0010409"