Skip to content

Instantly share code, notes, and snippets.

View adam-stokes's full-sized avatar
🦧

Adam Stokes adam-stokes

🦧
  • North Carolina
  • 07:02 (UTC -04:00)
View GitHub Profile
@adam-stokes
adam-stokes / update-cu-brew.txt
Created April 3, 2019 14:51 — forked from kwmonroe/update-cu-brew.txt
update conjure-up for brew
# update brew
brew update
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
# fork https://github.com/Homebrew/homebrew-core
git fetch --all
git checkout master
git pull
git push <FORK>
def create_or_update_snap_builder(self, name, owner, version, repo, branch, track):
""" Creates a new LP builder for snap with a specific git branch to build from
"""
lp_snap_name = f'{name}-{version}'
lp_snap_project_name = f'snap-{name}'
lp_owner = self.owner(owner)
if not isinstance(track, list):
track = [track]
@adam-stokes
adam-stokes / delete-vpc.sh
Created October 24, 2018 20:40 — forked from cjp/delete-vpc.sh
Delete AWS VPC including dependencies
#!/bin/sh
#
# Delete a VPC and its dependencies
if [ -z "$1" ] then
echo "usage: $0 <vpcid>"
exit 64
fi
vpcid="$1"
#!/bin/bash
set -eu
_UID=$(id -u)
GID=$(id -g)
# give lxd permission to map your user/group id through
grep root:$_UID:1 /etc/subuid -qs || sudo usermod --add-subuids ${_UID}-${_UID} --add-subgids ${GID}-${GID} root
# set up a separate key to make sure we can log in automatically via ssh
# with $HOME mounted
@adam-stokes
adam-stokes / register_node.sh
Created August 16, 2018 00:27 — forked from scarytom/register_node.sh
bash script to register new jenkins node
#!/bin/bash
# jenkins master vitals
CI_MASTER_HOST="ci-1.youdevise.com"
CI_MASTER_PORT="80"
# node vitals
NODE_HOST="tom-denley-rocks-01.youdevise.com"
NODE_NAME="tom-denley-rocks-name-01"
NODE_DESC="my node of glory"
@adam-stokes
adam-stokes / remove-nodes-safely.sh
Created August 16, 2018 00:26 — forked from scarytom/remove-nodes-safely.sh
Script to safely de-register jenkins nodes usage: $ remove-nodes-safely.sh my-node-1 my-node-2 my-node-3
#!/bin/bash
set -e
set -u
CI_MASTER_URL="http://ci-1"
node_online() {
curl --silent "$CI_MASTER_URL/computer/$1/api/json" | grep --silent '"temporarilyOffline":false'
}
@adam-stokes
adam-stokes / heredoc_json.bash
Created June 14, 2018 17:19 — forked from kdabir/heredoc_json.bash
json in heredoc in bash script alongwith variable substitution
_BUCKET_NAME="foo.example.com"
_POLICY=$(cat <<EOT
{
"Version":"2012-10-17",
"Statement":[{
"Sid":"PublicReadForGetBucketObjects",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
2018-04-20 17:01:33,522 [DEBUG] conjure-up/_unspecified_spell - juju.py:34 - bin_path candidate found
2018-04-20 17:01:33,522 [DEBUG] conjure-up/_unspecified_spell - juju.py:34 - wait_path candidate found
2018-04-20 17:01:33,672 [DEBUG] conjure-up/_unspecified_spell - app.py:263 - Juju version: 2.3.3-xenial-amd64, conjure-up version: 2.5.6
2018-04-20 17:01:33,704 [DEBUG] conjure-up/_unspecified_spell - telemetry.py:17 - Showing screen: Application Start
2018-04-20 17:01:33,707 [DEBUG] conjure-up/_unspecified_spell - telemetry.py:31 - OS: Linux-4.13.0-38-generic-x86_64-with-debian-stretch-sid
2018-04-20 17:01:33,711 [INFO] conjure-up/_unspecified_spell - events.py:172 - Watching for shutdown
2018-04-20 17:01:33,800 [DEBUG] conjure-up/_unspecified_spell - events.py:53 - Awaiting Shutdown at conjureup/events.py:175
2018-04-20 17:01:33,811 [DEBUG] conjure-up/_unspecified_spell - telemetry.py:17 - Showing screen: Spell Selection
2018-04-20 17:01:35,338 [DEBUG] conjure-up/_unspecified_spell - telemetry.py:31 - Spe
@adam-stokes
adam-stokes / githubcss.css
Last active August 29, 2019 00:43
userstyle github
#files .file .data pre,
#files .file .line-data,
#files .file .line-number,
code,
pre,
.blob-code,
.blob-code-inner,
#readme div.plain pre {
font-family: 'Ubuntu Mono', monospace !important;
font-variant-ligatures: contextual !important;
@adam-stokes
adam-stokes / gist:74e473f017641490f39db4a8586e6f3a
Last active April 3, 2018 16:31
verify parsing version string
diff --git a/canonical-kubernetes/steps/00_process-providertype/before-deploy b/canonical-kubernetes/steps/00_process-providertype/before-deploy
index 49d0a3b..7f7680a 100755
--- a/canonical-kubernetes/steps/00_process-providertype/before-deploy
+++ b/canonical-kubernetes/steps/00_process-providertype/before-deploy
@@ -6,7 +6,13 @@ set -eux
if [[ "$JUJU_PROVIDERTYPE" == "localhost" ]]; then
debug "Running pre-deploy for $CONJURE_UP_SPELL"
- sed "s/##MODEL##/$JUJU_MODEL/" "$(scriptPath)/lxd-profile.yaml" | lxc profile edit "juju-$JUJU_MODEL"
+ lxc_aa_profile="lxc.aa_profile"