Skip to content

Instantly share code, notes, and snippets.

View anryko's full-sized avatar
🙃
I may be slow to respond.

Andrej Svenke anryko

🙃
I may be slow to respond.
View GitHub Profile
@wrunk
wrunk / jinja2_file_less.py
Last active September 19, 2023 15:05
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
@arilivigni
arilivigni / ci-workflow-defaults.yml
Last active May 6, 2024 19:16
Jenkins Job Builder Example
- defaults:
name: ci-workflow-provision
description: |
Managed by Jenkins Job Builder. Do not edit via web.
concurrent: true
scm:
- git:
url: 'https://code.engineering.redhat.com/gerrit/ci-ops-central'
branches:
- origin/master
@vasanthk
vasanthk / System Design.md
Last active July 20, 2024 11:09
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@olih
olih / jq-cheetsheet.md
Last active July 16, 2024 23:02
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@phizaz
phizaz / async.py
Last active April 3, 2024 15:44
Python turn sync functions to async (and async to sync)
import functools
def force_async(fn):
'''
turns a sync function to async function using threads
'''
from concurrent.futures import ThreadPoolExecutor
import asyncio
pool = ThreadPoolExecutor()
@kwilczynski
kwilczynski / ec2.sh
Created November 20, 2017 13:04
Lock down EC2 meta-data to root (or others) only.
iptables -t filter -I OUTPUT -d 169.254.169.254 -j EC2
iptables -N EC2
iptables -A EC2 -m owner --uid-owner root -d 169.254.169.254 -j ACCEPT
iptables -A EC2 -j REJECT --reject-with icmp-host-unreachable