Skip to content

Instantly share code, notes, and snippets.

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

Krzysztof Szyper ChristophShyper

🏠
Working from home
View GitHub Profile
@ChristophShyper
ChristophShyper / keybase.md
Last active March 12, 2020 09:06
My Keybase proof on GitHub

Keybase proof

I hereby claim:

  • I am ChristophShyper on github.
  • I am biotyk (https://keybase.io/biotyk) on keybase.
  • I have a public key whose fingerprint is 7B58 8495 C657 E51B 054B 2085 C9A1 2AA4 E28D AFF1

To claim this, I am signing this object:

@ChristophShyper
ChristophShyper / Timeouts.md
Last active July 19, 2020 21:12
Terraform timeouts

Terraform timeouts

Resource

Will be executed only on trigger change

resource "null_resource" "first" {
}

resource "null_resource" "sleep" {
 provisioner "local-exec" {
@ChristophShyper
ChristophShyper / Metadata_S3.md
Last active November 13, 2020 17:51
Pass metadata between Terraform modules using S3. Much faster than remote state.

Save outputs from a resource to a YAML file:

# Module Alpha
# https://www.terraform.io/docs/providers/aws/r/s3_bucket_object.html
resource "aws_s3_bucket_object" "outputs" {
  bucket = local.metadata_bucket
  key    = "${local.key_path}/organization.yml"
  content = yamlencode({
    "organization_arn" : aws_organizations_organization.default.arn
 "organization_id" : aws_organizations_organization.default.id
@ChristophShyper
ChristophShyper / Metadata_DynamoDB.md
Last active February 17, 2021 12:24
Pass metadata between Terraform modules using DynamoDB. Only scalar values are possible. Maps or sets will cause issues. Much faster than remote state.

Save metadata in DynamoDB

resource "aws_dynamodb_table_item" "organization" {
  table_name = "my-dyn-db-table"
  hash_key = "KeyName"
  item = jsonencode({
    KeyName = {
      S = "organization"
    }
    Outputs = {
@ChristophShyper
ChristophShyper / Account_details.md
Last active February 17, 2021 12:28
Filter AWS accounts for Terraform

Reading and fitlering AWS accounts' attributes with Terraform

To fix hashicorp/terraform-provider-aws#17656 I created a simple script using external data source for Terraform.

Using it I'm able, for example, to list all ACTIVE accounts with IDs or emails.

Usage

local {
  accounts_emails = split(",", data.external.accounts.result.Outputs)
@ChristophShyper
ChristophShyper / NikCollection.cfg
Last active June 23, 2022 20:38
NIK Collection config file with horrific update prompt disabled
<configuration>
<group name="Instrumentation">
<key name="AllowSending" type="bool" value="0"/>
<key name="ShowInstrumentationScreen" type="bool" value="0"/>
</group>
<group name="Update">
<key name="Version" type="string" value="4.3.4"/>
</group>
<group name="Activation">
@ChristophShyper
ChristophShyper / UBC125XLT-Polish-Aviation.txt
Last active January 3, 2023 21:30
UBC125XLT - Scan125 Scanner Data File - Polish aviation - more at https://shyper.pro/ubc125xlt.html
! Scan125 Scanner Data File - #scan125# - #full#
! Scan125 Control Program © Nick Bailey 2013-2020 V3.3.0.0 http://www.nick-bailey.co.uk
! Comments added To this file will be removed!
! PLEASE Do Not EDIT Or MESS With THIS FILE
MDL=UBC125XLT
VER=!Version 1.01.00
VOL=12
SQL=3
CNT=8
BLT=AF
@ChristophShyper
ChristophShyper / wsl2-docker.md
Last active January 10, 2023 20:36
Instruction how to set up WSL2 to work with Docker in Windows 10

On Windows 10 build 18917 or higher

Win / Enable WSL and VMP

PowerShell:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

Win / Set WSL 2 as default

@ChristophShyper
ChristophShyper / interesting_repos.md
Last active February 8, 2023 04:14
List of some repos I find interesting
Repo Description Link
alphagov/aws-auth AWS authentication wrapper to handle MFA and roles https://github.com/alphagov/aws-auth
beezz/elastalert-lambda Lambda handler for Yelp's ElastAlert https://github.com/beezz/elastalert-lambda
blueimp/aws-lambda Collection of functions for AWS Lambda https://github.com/blueimp/aws-lambda
cloudposse/tfmask Terraform utility to mask select output from terraform plan and terraform apply https://github.com/cloudposse/tfmask
cytopia/awesome-ci Awesome Continuous Integration - Lot's of tools for git, file and static source code analysis. https://github.com/cytopia/awesome-ci
cytopia/docker-terraform-docs Alpine-based multistage-build version of terraform-docs and terraform-docs-replace in multiple versions to be used for CI and other reproducible automations https://github.com/cytopia/docker-terraform-docs
cytopia/docker-terragrunt Alpine-based multistage-build version of Terragrunt and Terr
@ChristophShyper
ChristophShyper / aws_get_public_ips.py
Last active November 22, 2023 17:07
Script returning all public IPs associated with ENI in whole AWS Organization
#!/usr/bin/env python3
import boto3
import botocore.exceptions
"""
Script for counting current usage of public IPv4 across all accounts and regions.
Showing average spent starting January 2024
More info https://aws.amazon.com/blogs/aws/new-aws-public-ipv4-address-charge-public-ip-insights/