Skip to content

Instantly share code, notes, and snippets.

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

Kevin Edwards kedwards

🏠
Working from home
View GitHub Profile
@kedwards
kedwards / playbook.yml
Last active May 18, 2023 14:21
Sample Ansible playbook
- name: Doorbell
hosts: "{{ target | default('all')}}"
gather_facts: no
vars:
ansible_connection: community.aws.aws_ssm
ansible_aws_ssm_bucket_name: <REQUIRED-bucket-name>
ansible_aws_ssm_region: us-east-1
pre_tasks:
- name: Say Hello
@kedwards
kedwards / ansible-summary.md
Created March 12, 2022 15:23 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@kedwards
kedwards / screen.md
Last active February 26, 2022 16:07
Screen Quick Reference

Screen Quick Reference

Escape Key

All screen commands are prefixed by an escape key, by default Ctrl-a (that's Control-a, sometimes written ^a). To send a literal Ctrl-a to the programs in screen, use Ctrl-a a. This is useful when when working with screen within screen. For example Ctrl-a a n will move screen to a new window on the screen within screen.

Basic

Description Command
#!/bin/bash
export AWS_PROFILE=maison
export AWS_REGION=us-west-2
VPC_ID=$(aws ec2 create-vpc --cidr-block 10.0.0.0/16 --query "Vpc.VpcId" --output text)
@kedwards
kedwards / ec2-describe.sh
Last active February 15, 2023 18:55
aws cli stuff
#!/usr/bin/env bash
aws ec2 describe-instances \
| jq '.Reservations[].Instances[0] | {id: .InstanceId, ami: .ImageId, platfrom: .PlatformDetails, arch: .Architecture, az: .Placement.AvailabilityZone, ip: .PrivateIpAddress, name: [.Tags[] | select (.Key=="Name").Value]}'
ecs update-service --cluster rch-cf-kafka --service kafka-rest-proxy --desired-count 0
For anyone still having this issue what you can try doing is clearing the pending version and reattempting the rotation
@kedwards
kedwards / clean_repo.sh
Last active January 11, 2022 21:37
Clean repo w/ submodules
#! /bin/sh
git reset --hard --recurse-submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git submodule update --init --recursive
git submodule foreach --recursive git checkout main
git pull
git submodule foreach --recursive git pull
@kedwards
kedwards / import sql.gz file
Last active December 7, 2021 12:58
import mysql gzipped export
#!/usr/bin/env bash
DB_FILE=data.gz
TARGET_DB=sensmapserver
zcat ${DB_FILE} | mysql -u username -p ${TARGET_DB}
@kedwards
kedwards / docker-compose.yml
Created November 12, 2021 18:48 — forked from crapthings/docker-compose.yml
docker-compose rs init
version: '3'
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo
restart: always
expose:
- 27017
ports:
@kedwards
kedwards / build.sh
Last active October 25, 2021 15:14
Docker build script
#!/usr/bin/env sh
opts=':bc:d:f:s:t:p:h'
usage() {
echo "Error ${1}"
echo "Usage: ${script_name} options"
echo "options:"
echo " -b | use bump script"
echo " -c | container name (* required)"