Skip to content

Instantly share code, notes, and snippets.

@progvp
progvp / README.aws_fingerprint_key.md
Last active March 2, 2021 17:43
Calculate AWS key fingerprint

Calculate AWS fingerprint from SSH private key
Note that fingerprint you can see on AWS Key pairs tab in AWS console is not the same as fingerprint that ssh-keygen gives.

If key was uploaded:

ssh-keygen -f <myprivatekey> -e -m PKCS8 | openssl pkey -pubin -outform DER |openssl md5 -c

If key was generated by AWS:

@progvp
progvp / 0_article.md
Created May 22, 2020 23:01 — forked from hemebond/0_article.md
A SaltStack AWS Auto Scaling Solution

A SaltStack AWS Auto Scaling Solution

Overview

The AWS Auto Scaling Goup, configured with a customised Cloud-Init file, sends a notification to an SNS Topic, which in turn passes it onto an SQS queue that the Salt Master is subscribed to. A Reactor watches for the auto scaling events and pre-approves the new minion based on its Auto Scaling group name and instance ID.

Salt Master Configuration

@progvp
progvp / debugAwsLambda.txt
Created October 13, 2018 00:38 — forked from alchen99/debugAwsLambda.txt
Debugging AWS Lambda Python scripts
import json
logger.info('Event: %s' % json.dumps(event, indent=2))
See https://gist.github.com/gene1wood/24e431859c7590c8c834
time aws lambda invoke --invocation-type RequestResponse --function-name reportUntaggedInstances --region us-west-2 --log-type Tail --payload '{"region": "us-west-2"}' lambda.log
awslogs groups
awslogs get /aws/lambda/reportUntaggedInstances --no-group --no-stream -s '15 min ago'
@progvp
progvp / log_aws_lambda_event_and_context.py
Created October 13, 2018 00:38 — forked from gene1wood/log_aws_lambda_event_and_context.py
A python AWS Lambda function which logs the contents of the event and context variables passed into the function.
import logging
import json
logger = logging.getLogger(__name__)
logging.getLogger().setLevel(logging.INFO)
class PythonObjectEncoder(json.JSONEncoder):
"""Custom JSON Encoder that allows encoding of un-serializable objects
For object types which the json module cannot natively serialize, if the
@progvp
progvp / strapwrap.sh
Created October 4, 2018 14:19 — forked from DazWorrall/strapwrap.sh
Little script to create a minimal ubuntu using debootstrap and bring it up to date
#!/bin/bash
set -e
DEFAULT_PACKAGES=ssh,language-pack-en-base
DEFAULT_COMPONENTS=main,universe
DEBOOTSTRAP=/usr/sbin/debootstrap
DEFAULT_MIRROR=http://archive.ubuntu.com/ubuntu
DEFAULT_VARIANT=minbase
MIRROR=${STRAP_MIRROR:-$DEFAULT_MIRROR}
ROOTFS=$1
@progvp
progvp / README.md
Created September 30, 2018 01:34 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@progvp
progvp / .gitignore
Created April 12, 2018 17:37 — forked from aussielunix/.gitignore
jenkins configs to github
*
!/.gitignore
!/*.xml
!/nextBuildNumber
!/jobs
!/jobs/*
!/jobs/*/*.xml
/jobs/*/disk-usage.xml
/jobs/*/builds
@progvp
progvp / Efficient Encrypted UEFI-Booting Arch Installation
Created March 23, 2018 08:28 — forked from HardenedArray/Efficient Encrypted UEFI-Booting Arch Installation
An effcient method to install Arch Linux with encrypted root and swap filesystems and boot from UEFI. Multi-OS, and VirtualBox, UEFI-booting are also supported.
# OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI.
# Note: This method supports both dedicated Arch installs and those who wish to install Arch on a multi-OS-UEFI booting system.
# External USB HDD/SSD Installers Notes: Encrypted Arch installs can be booted and run from an external USB HDD or SSD, but
# only when the installation is correctly set up. There are several necessary changes to my standard procedure you'll want
# to make during the install process. Read my External USB HDD/SSD Installation section below before proceeding.