Skip to content

Instantly share code, notes, and snippets.

View tom-henderson's full-sized avatar
🇳🇿

Tom Henderson tom-henderson

🇳🇿
View GitHub Profile
@rjamestaylor
rjamestaylor / docker-run-away.txt
Last active September 2, 2021 22:37
Replacing Docker Desktop on my MacBook in under an hour
When Darth Docker sent me the email changing the terms of use retroactively (!) I decided to start looking for alternatives.
About 30 minutes later I found Lima (and nerdctl).
Less than an hour later, I no longer use Docker Desktop.
Not even for retrieving container images in corportate repos that require credentials.
I just replaced Docker on my MacBook with Lima.
$ brew install lima
Then set up a default execution environment for nerdctl:
@shokoe
shokoe / aws_inspector_cron.sh
Last active April 14, 2023 11:39
Executes AWS Inspector run, export full findings csv file from last completed run, compile a concise counters report including severity and package aggregates by hostname. Full and aggregated report are uploaded to S3.
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/snap/bin
log="/var/log/aws_inspector/aws_inspector_export_rep.log"
template_arn='arn:aws:inspector:us-east-1:XXXXXXXXXXXX:target/xxxxxxxxxx/template/xxxxxxxxxx'
wait_sec='5400'
log_out(){
(($verifymon)) &&\
echo -e "`date +'%Y-%m-%d %H:%M:%S'` (pid $$) -- $1" >> $log ||\
echo -e "`date +'%Y-%m-%d %H:%M:%S'` (pid $$) -- $1" | tee -a $log
@ekreutz
ekreutz / ansible_variable_precedence.md
Last active April 25, 2024 17:43
Ansible variable precedence (order, hierarchy)
@gene1wood
gene1wood / role_arn_to_session.py
Created December 29, 2016 17:38
Simple python function to assume an AWS IAM Role from a role ARN and return a boto3 session object
import boto3
def role_arn_to_session(**args):
"""
Usage :
session = role_arn_to_session(
RoleArn='arn:aws:iam::012345678901:role/example-role',
RoleSessionName='ExampleSessionName')
client = session.client('sqs')
"""
@vcastellm
vcastellm / ecs-run
Last active April 15, 2024 17:55
Run task and wait for result in AWS ECS
#!/usr/bin/env bash
set -e
function usage() {
set -e
cat <<EOM
##### ecs-run #####
Simple script for running tasks on Amazon Elastic Container Service
One of the following is required:
Required arguments:
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 2, 2024 01:27
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@alces
alces / ansible_local_playbooks.md
Last active April 5, 2024 18:28
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local

HomeKit Service and Characteristic UUIDs

Thanks to HAP-NodeJS

Service UUID
Accessory Information 0000003E-0000-1000-8000-0026BB765291
Air Quality Sensor 0000008D-0000-1000-8000-0026BB765291
Battery Service 00000096-0000-1000-8000-0026BB765291
Bridging State 00000062-0000-1000-8000-0026BB765291
@andyshinn
andyshinn / Dockerfile
Created December 24, 2015 19:07
BusyBox cron container example
FROM gliderlabs/alpine:3.3
COPY myawesomescript /bin/myawesomescript
COPY root /var/spool/cron/crontabs/root
RUN chmod +x /bin/myawesomescript
CMD crond -l 2 -f
@kwilczynski
kwilczynski / route53
Last active October 2, 2023 08:34
EC2 automatic DNS entry in route53 for Auto Scaling Group
TTL=300
HOSTED_ZONE_ID=
REVERSE_HOSTED_ZONE_ID=
INSTANCE_ID=
REGION=