Skip to content

Instantly share code, notes, and snippets.

View developerinlondon's full-sized avatar
🙂
BizOps

DevOps Extraordinaire! developerinlondon

🙂
BizOps
View GitHub Profile
@developerinlondon
developerinlondon / Rakefile
Created May 27, 2016 21:27 — forked from a2ikm/Rakefile
Rake tasks for Terraform
task :environment do
errors = []
%w(
TF_VAR_dnsimple_email
TF_VAR_dnsimple_token
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION
).each do |name|
errors << name if ENV[name].nil?
@developerinlondon
developerinlondon / check_salt_state.py
Created June 12, 2016 03:42 — forked from djs52/check_salt_state.py
Nagios Salt check which tests the highstate
#!/usr/bin/env python
# Copyright © 2016 Dan Sheridan <[email protected]>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
import salt.client
import argparse
import sys
import fnmatch
@developerinlondon
developerinlondon / jenkins.service
Created June 14, 2016 06:00 — forked from karnauskas/jenkins.service
Jenkins service unit file for Systemd
[Unit]
Description=Jenkins
After=network.target
Requires=network.target
[Service]
Type=simple
EnvironmentFile=/etc/sysconfig/jenkins
ExecStart=/usr/bin/java ${JENKINS_JAVA_OPTIONS} -jar /usr/lib/jenkins/jenkins.war --httpPort=${JENKINS_PORT} --httpListenAddress=${JENKINS_LISTEN_ADDRESS} ${JENKINS_ARGS}
Restart=always
@developerinlondon
developerinlondon / create-ecr-imagepullsecret.sh
Created June 17, 2016 23:47
Allow Multi-region Kubernetes to ECR Registry
#!/bin/bash
#
# Create a Kubernetes registry secret for an AWS ECR region
# Requires AWS CLI: https://aws.amazon.com/cli/
# Requires kubectl: https://coreos.com/kubernetes/docs/latest/configure-kubectl.html
#
#
# This secret can be used with 'imagePullSecret' for Kubernetes
@developerinlondon
developerinlondon / remove-gpg-user.sh
Created March 12, 2017 14:12
Git-crypt remove user.
#!/usr/bin/env bash
#
# Script to remove GPG key from git-crypt
#
# It will re-initialize git-crypt for the repository and re-add all keys except
# the one requested for removal.
#
# Note: You still need to change all your secrets to fully protect yourself.
# Removing a user will prevent them from reading future changes but they will
# still have a copy of the data up to the point of their removal.
@developerinlondon
developerinlondon / hostsfile.py
Created June 8, 2017 14:44 — forked from jtyr/hostsfile.py
Ansible dynamic inventory script that reads any Ansible hosts file and transforms it into the JSON data structure.
#!/usr/bin/python2
#####
#
# Description
# -----------
#
# This is an Ansible dynamic inventory script that reads any Ansible hosts file
# and transforms it into the JSON data structure.
#

Keybase proof

I hereby claim:

  • I am developerinlondon on github.
  • I am nayeemsyed (https://keybase.io/nayeemsyed) on keybase.
  • I have a public key ASA_RMp_l4izzJXS1O-2cMRpMH0bAulm4daPvLy3IR5oMAo

To claim this, I am signing this object:

---
- name: Spring Example | Check if Project Exists
shell: oc projects | grep spring-example
register: project_exists
ignore_errors: yes
- block:
- name: Spring Example | Create Spring Project
command: oc new-project spring-example
require 'active_support/core_ext/hash/conversions'
require 'yaml'
file = File.open("data/mconvert.xml", "r")
hash = Hash.from_xml(file.read)
yaml = hash.to_yaml
File.open("data/mirador.yml", "w") { |file| file.write(yaml) }
@developerinlondon
developerinlondon / docker-machine-rename
Created December 13, 2017 10:34 — forked from alexproca/docker-machine-rename
Rename docker-machine
#!/usr/bin/env bash
#copy this in a folder from path ex: /usr/local/bin
#usage: docker-machine-rename default my-default
OLD_MACHINE_NAME=${1:-default};
NEW_MACHINE_NAME=${2:-my-default-2};
STORE_PATH=`docker-machine inspect $OLD_MACHINE_NAME | grep -m 1 StorePath | cut -d ':' -f 2 | cut -c 3- | rev | cut -c 3- | rev`;
mv "$STORE_PATH/machines/$OLD_MACHINE_NAME" "$STORE_PATH/machines/$NEW_MACHINE_NAME";
cp "$STORE_PATH/machines/$NEW_MACHINE_NAME/config.json" "$STORE_PATH/machines/$NEW_MACHINE_NAME/config.json.bak"