Skip to content

Instantly share code, notes, and snippets.

@spensireli
spensireli / GitHub Example
Created January 4, 2023 19:49
SSM Send Command for GitHub and S3
source_info = {"owner":"spensireli","repository":"ssm-test","path":"ssm-test","tokenInfo":"{{ssm-secure:git-token}}", "getOptions":"branch:main"}
json_encoded_source_info = json.dumps(source_info)
try:
send_command = ssm_client.send_command(
InstanceIds=[resource_id],
DocumentName="AWS-ApplyAnsiblePlaybooks",
Parameters={"SourceType": ["GitHub"], "SourceInfo": [json_encoded_source_info], "PlaybookFile": ["someteam.yml"], "InstallDependencies": ["True"]}
)
@spensireli
spensireli / Cordon-All-Nodes.md
Created September 20, 2022 17:13
Handy Kubernetes Gists

Cordon all nodes.

for i in $(kubectl get nodes | grep ip |awk '{print $1}'); do kubectl cordon $i; done
@s0enke
s0enke / cdk_with_service_catalog.ts
Last active May 24, 2022 00:14
Generate AWS Service Catalog Products from CDK Constructs
// Possible since https://github.com/aws/aws-cdk/pull/17144
class VpcProduct extends servicecatalog.ProductStack {
vpc: aws_ec2.Vpc;
constructor(scope: Construct, id: string) {
super(scope, id);
this.vpc = new aws_ec2.Vpc(this, 'Vpc', {
@djfdyuruiry
djfdyuruiry / README.md
Last active April 28, 2024 08:34
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@r00tdaemon
r00tdaemon / BurpDock
Last active March 15, 2022 14:29
How to setup Burp Suite inside a docker container. (https://ujjwal96.github.io/blog/2019/06/02/burpdock)
How to setup Burp Suite inside a docker container.
@npearce
npearce / install-docker.md
Last active July 19, 2024 06:12
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@kwilczynski
kwilczynski / disable-ipv6.sh
Last active April 11, 2024 11:09
Amazon Linux OS tweaks
#!/bin/bash
set -u
set -e
set -o pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cat <<'EOF' > /etc/modprobe.d/blacklist-ipv6.conf