Skip to content

Instantly share code, notes, and snippets.

View petersellars's full-sized avatar
🏠
Working from home

Peter Sellars petersellars

🏠
Working from home
View GitHub Profile
# On Ubuntu/Mint you will need the yubico ppa if you want the Yubico management
# tools
# NB. It appears the yubikey-personalization is no longer maintained by Yubico,
# so at some point may want to remove the yubikey-personalization installed
# applications
sudo -E apt-add-repository -y ppa:yubico/stable
sudo -E apt-get -qy update
sudo -E apt-get -qy install yubikey-personalization-gui \
@petersellars
petersellars / keybase.md
Created April 30, 2018 08:43
keybase.md

Keybase proof

I hereby claim:

  • I am petersellars on github.
  • I am psellars (https://keybase.io/psellars) on keybase.
  • I have a public key ASDDYLQbYHO3Z89-w_hrVxpfozgc9j0WHETIl2FC37GzJwo

To claim this, I am signing this object:

@petersellars
petersellars / autokey-github.sh
Last active March 4, 2024 21:23
Automate SSH Key generation on a machine for use with GitHub
#!/bin/bash
# Requirements
# You will need to have created a GitHub Access Token with admin:public_key permissions
# Usage
# chmod +x autokey-github.sh
# ./autokey-github.sh <YOUR-GITHUB-ACCESS-TOKEN>
# Reference
variable "region" {
default = "ap-southeast-2"
}
variable "version" {
default = "trusty-14.04"
}
variable "architecture" {
default = "amd64"
This file has been truncated, but you can view the full file.
2016/12/13 10:01:28 [INFO] Terraform version: 0.7.13 2a4b4bbc3f315d100f76a83570e0364275e0fc6b
2016/12/13 10:01:28 [INFO] CLI args: []string{"/usr/local/bin/terraform_0.7.13_linux_amd64/terraform", "plan", "-var-file=donotcommit.tfvars", "-target=module.ecs_alb"}
2016/12/13 10:01:28 [DEBUG] Detected home directory from env var: /home/psellars
2016/12/13 10:01:28 [DEBUG] Detected home directory from env var: /home/psellars
2016/12/13 10:01:28 [DEBUG] Attempting to open CLI config file: /home/psellars/.terraformrc
2016/12/13 10:01:28 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2016/12/13 10:01:28 [DEBUG] Detected home directory from env var: /home/psellars
2016/12/13 10:01:28 [TRACE] Preserving existing state lineage "e6eaa9a2-b858-492a-ae08-82e7fc6d5cbb"
2016/12/13 10:01:28 [TRACE] Preserving existing state lineage "e6eaa9a2-b858-492a-ae08-82e7fc6d5cbb"
Variable
#!/bin/bash
set -e
# Send a private message to someone on slack
# from the command line.
# Print a usage message and exit.
usage(){
local name=$(basename "$0")
@petersellars
petersellars / update_groovy_build_version.groovy
Last active August 29, 2015 14:17
Jenkins Groovy Scripts: Update Groovy from 2.2.1/Default to Groovy 2.3 builders
import jenkins.model.*
for(item in Jenkins.instance.items) {
if (!(item instanceof com.cloudbees.plugins.flow.BuildFlow)
&& !(item instanceof hudson.maven.MavenModuleSet)
&& !(item instanceof org.jenkinsci.plugins.workflow.job.WorkflowJob)) {
for (builder in item.builders) {
if(builder instanceof hudson.plugins.gradle.Gradle) {
println(item.name)
println(builder)
@petersellars
petersellars / docker-ip
Created March 17, 2015 08:41
Docker Scripts: Get the IP address of a Docker Container by name or ID
#!/bin/sh
exec docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$@"
@petersellars
petersellars / docker-pid
Created March 17, 2015 08:35
Docker Scripts: Conveniently obtain the PID of a docker container by name or ID
#!/bin/sh
exec docker inspect --format '{{ .State.Pid }}' "$@"
@petersellars
petersellars / activate_chuck_norris.groovy
Created March 4, 2015 22:26
Jenkins Groovy Scripts: Activate Chuck Norris Plugin for all Jobs
import jenkins.model.*
for(item in Jenkins.instance.items) {
println("job $item.name")
if (!(item.class == org.jenkinsci.plugins.workflow.job.WorkflowJob)) {
chuck_activated = false
for (publisher in item.publishersList) {
if (publisher.descriptor.displayName == "Activate Chuck Norris")
chuck_activated = true
}