Skip to content

Instantly share code, notes, and snippets.

View patrickmslatteryvt's full-sized avatar

Patrick M. Slattery patrickmslatteryvt

  • South Burlington, VT
View GitHub Profile
@patrickmslatteryvt
patrickmslatteryvt / install_powerline-go
Last active April 12, 2019 03:50
Install/Update to latest version of powerline-go
# Install/Update to latest version of powerline-go:
# https://github.com/justjanne/powerline-go/releases/download/v1.12.1/powerline-go-linux-amd64
echo "[+] Install powerline-go"
jq || sudo dnf install -y jq || sudo apt-get install -y jq
mkdir -p ~/go/bin/
GITHUB_USER=justjanne
GITHUB_REPO=powerline-go
POWERLINE_GO_VERSION=$(curl -s https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/releases/latest | jq .tag_name | tr -d '"')
echo "powerline-go version: ${POWERLINE_GO_VERSION}"
@patrickmslatteryvt
patrickmslatteryvt / gist:d531c5ae4598fd4c9d508833bde6c7c0
Last active July 24, 2023 07:05
Install/update SOPS to latest on Fedora
# Install/update SOPS to latest on Fedora - https://github.com/getsops/sops
# This script requires jq installed to parse the API return from GitHub
echo "[+] Install/upgrade SOPS"
which jq | grep -o jq > /dev/null && : || dnf install -y jq
SOPS_VERSION=$(curl -s https://api.github.com/repos/getsops/sops/releases/latest | jq .tag_name | tr -d '"')
dnf install -y https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION:1}-1.x86_64.rpm
sops --version
# sops 3.7.3 (latest)

Keybase proof

I hereby claim:

  • I am patrickmslatteryvt on github.
  • I am pslattery (https://keybase.io/pslattery) on keybase.
  • I have a public key ASC4cJN54OsM_6b1EiibeLBL71r-h2VDLesbE_Tf2pGgxAo

To claim this, I am signing this object:

@patrickmslatteryvt
patrickmslatteryvt / ansible_error_april_19_2017.md
Last active April 19, 2017 18:47
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error:

(ansible_2.4.0) [pslattery@pslattery990 ansible-playbooks] $ ansible-playbook playbooks/dms-deploy-docker-gc.yaml --syntax-check
The error appears to have been in '/home/pslattery/source/stash/Automation/ansible-playbooks/playbooks/roles/mwg.docker-gc/tasks/deploy-docker-gc.yaml': line 37, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: "Pull the service image"
@patrickmslatteryvt
patrickmslatteryvt / gist:97c8140d79f0161be53fc65b872f23c6
Last active February 23, 2017 22:55
docker_login until failures
# Task
- name: "Log into hub.docker.com"
become: yes
become_user: automation
docker_login:
username: "{{ docker_hub_username }}"
password: "{{ docker_hub_password }}"
email: "{{ docker_hub_email }}"
register: docker_login_result
# until: docker_login_result.login_result.Status == "Login Succeeded"
# Pull the necessary images:
docker pull nathanleclaire/curl:latest
docker pull openjdk:8u111-jre-alpine

# Start the controller container, note that it has RW access to the Docker API socket:
docker run \
  -ti \
  --rm \

Sample of how to use lists to select from multiple predefined choices in Ansible

playbooks/rackspace.yaml

---
- name: "Provision system(s) in Rackspace"
  hosts: localhost
  connection: local
  gather_facts: yes
# This works:
- include_role:
name: mwg.svn
tasks_from: create-repo
vars:
svn_instance: svn
svn_repo: subversion
# This does not:
- include_role:
@patrickmslatteryvt
patrickmslatteryvt / ansible_uri.yaml
Last active September 21, 2016 18:32
Ansible URI module issue with multiple data objects
# This works
- name: "Set the Couchbase cluster security settings"
shell: "curl -v -X POST http://{{ couchbase_host }}:{{ couchbase_cluster_port }}/settings/web \
-d port={{ couchbase_cluster_port }} \
-d username={{ couchbase_cluster_username }} \
-d password={{ couchbase_cluster_password }}"
# This does not:
- name: "Set the Couchbase cluster security settings"
uri:
@patrickmslatteryvt
patrickmslatteryvt / buildHAProxy.sh
Last active September 18, 2016 17:32 — forked from codingtony/buildHAProxy.sh
Compile of Haproxy using LibreSSL static. See https://github.com/codingtony/docker-build-haproxy for how to use with a Docker Image
#!/bin/bash -e
DIR=$PWD
yum groupinstall -y "Development Tools"
yum install -y make gcc perl wget zlib-devel
#Compile static version of libressl
export STATICLIBSSL=/tmp/staticlibssl
LIBRESSL=libressl-2.4.2