Skip to content

Instantly share code, notes, and snippets.

View gordlea's full-sized avatar

Gord Lea gordlea

View GitHub Profile
@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 / 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"