Sometimes, you need to use your EC2 instance's credentials to access the AWS resources, for testing, development, etc.. This is how you do it.
create 169.254.169.254
on loopback interface
sudo ip a add 169.254.169.254 dev lo
#!/usr/bin/env python | |
# details on rabbitMQ password hashing | |
# https://www.rabbitmq.com/passwords.html#computing-password-hash | |
from __future__ import print_function | |
import base64 | |
import os | |
import hashlib | |
import struct | |
import getpass |
#!/usr/bin/env bash | |
# | |
# K8s-Vault, like AWS-Vault is a helper for AWS related CLI tools | |
# is a helper for CLI tools using kubectl config and K8s API. | |
# Unlike AWS-Vault, vault here is used as a verb, | |
# synonymous to leap, jump, spring, etc.. | |
# Copyright (C) 2019-2020 Anastas Dancha (aka @anapsix) | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
#!/usr/bin/env sh | |
for dep in curl jq grep awk; do | |
if ! which ${dep} >&/dev/null; then | |
echo >&2 "ERROR: required ${dep} binary is not found, exiting.." | |
exit 1 | |
fi | |
done | |
TOKEN=$( |
--- | |
apiVersion: batch/v1beta1 | |
kind: CronJob | |
metadata: | |
name: do-something-job | |
namespace: scheduled-tasks | |
spec: | |
schedule: "*/2 * * * *" | |
successfulJobsHistoryLimit: 3 | |
failedJobsHistoryLimit: 3 |
#!/usr/bin/env bash | |
# | |
# K8s-OIDC-LOGIN helper to simplify configuration of OIDC authentication for kubectl | |
# | |
# Heavily influenced by oidckube project by @mrbobbytables | |
# https://github.com/mrbobbytables/oidckube | |
# | |
# Copyright (C) 2019 Anastas Dancha (aka @anapsix) | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
#!/bin/bash | |
# | |
# Implementation of BASH + NCAT chat server | |
# | |
# Author: Anastas Dancha <anapsix@random.io> | |
# Contact: anapsix@random.io | |
# | |
#debug="true" |
#!/usr/bin/env bash | |
# | |
# RKIND is a naive helper script to start KIND and Rancher Management Server | |
# | |
set -u | |
set -o pipefail | |
RANCHER_CONTAINER_NAME="rancher-for-kind" | |
RANCHER_HTTP_HOST_PORT=$[$[RANDOM%9000]+30000] |
#!/usr/bin/env bash | |
# | |
## example running it from cron | |
# MAILTO="" | |
# SHELL=/bin/bash | |
# VERBOSE=1 | |
# CMD_ON_FAILURE='/etc/init.d/nginx reload' | |
# * * * * * root timeout -k 2 5 /tmp/check_dns.sh upstream.server.com 2>>/var/log/check_dns.log | |
# * * * * * root sleep 10 && sed -e :a -e '$q;N;501,$D;ba' -i /var/log/check_dns.log | |
# |
#!/usr/bin/env python | |
# I didn't write this | |
# many examples exist on StackOverflow, etc.. | |
# | |
# Note: you'll need python-xlib, python-gtk | |
# sudo apt-get install python-xlib python-gtk2 | |
# | |
import sys | |
import os |