Skip to content

Instantly share code, notes, and snippets.

View gordlea's full-sized avatar

Gord Lea gordlea

View GitHub Profile
@gordlea
gordlea / snapshot-lxc.containers.sh
Last active May 23, 2019 15:31
Update/snapshot all lxc containers (debian, ubuntu, fedora, centos and alpine supported)
#!/usr/bin/env bash
snapshot_containers () {
running_containers=()
while IFS= read -r line; do
running_containers+=( "$line" )
done < <( lxc list --columns=ns --format=json \
| jq --raw-output 'map(select(.status | contains("Running")) | .name) | .[]' )
for i in "${running_containers[@]}"; do
echo "taking snapshot of apt based container: $i"
@gordlea
gordlea / hipchat-v1.sh
Created August 1, 2018 14:57 — forked from rquadling/hipchat-v1.sh
Send an HTML message to HipChat using v1 of the api via cURL
MESSAGE="
<table><thead><tr><td colspan=\"2\"><b>Build starting</b></td></tr></thead>
<tbody>
<tr><td><b>Tag</b></td><td>${build_tag}</td></tr>
<tr><td><b>Built for</b></td><td>${built_for}</td></tr>
<tr><td><b>Built by</b></td><td>${built_by}</td></tr>
</tbody>
</table>
"
curl -s -X POST \
@gordlea
gordlea / edgerouter_ipv6_telus.sh
Last active September 21, 2023 06:48
edgerouter ipv6 config for telus purefibre
# current as of edgeos v1.10.5
# cobbled together from:
# https://medium.com/@nurblieh/ipv6-on-the-edgerouter-lite-c95e3cc8d49d
# https://heald.ca/configuring-telus-optik-ipv6-ubiquiti-edgerouter/
configure
edit firewall ipv6-name WANv6_IN
set default-action drop
set rule 10 action accept
@gordlea
gordlea / .block
Last active March 9, 2023 07:19
D3 v5 Line Chart
license: mit

Keybase proof

I hereby claim:

  • I am gordlea on github.
  • I am gordtron (https://keybase.io/gordtron) on keybase.
  • I have a public key ASANvou6M__LnUn4ySBZShNczzSatlcJnkDfwlTSoGkbkQo

To claim this, I am signing this object:

@gordlea
gordlea / del_node_modules.sh
Created December 12, 2016 17:06
delete node_modules recursively
#!/bin/bash
# taken from https://coderwall.com/p/guqrca/remove-all-node_module-folders-recursively
find . -name "node_modules" -exec rm -rf '{}' +
@gordlea
gordlea / html-domparser.js
Created July 5, 2016 19:51 — forked from eligrey/html-domparser.js
DOMParser HTML extension - Now a polyfill since HTML parsing was added to the DOMParser specification
/*
* DOMParser HTML extension
* 2012-09-04
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */
@gordlea
gordlea / .eslintrc.json
Last active June 23, 2016 19:16
js project boilerplate
// Use this file as a starting point for your project's .eslintrc.
// Copy this file, and add rule overrides as needed.
{
"extends": "airbnb",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"rules": {
@gordlea
gordlea / scope.conf
Last active January 6, 2016 17:46
weave autolaunch on trusty
# scope - start weave after weave
# place under /etc/init/scope.conf
description "starts weave.scope"
author "Gord Lea <jgordonlea@gmail.com>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas
@gordlea
gordlea / gist:7222b0f702a625fd40ff
Last active October 30, 2015 18:14 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
# OR
git branch -m new_branch # Rename current branch
# THEN
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote