Skip to content

Instantly share code, notes, and snippets.

@alfonsrv
alfonsrv / find_administrator.yml
Last active April 15, 2023 12:23
Ansible – Find Domain Administrator used in Services, Processes and Scheduled Tasks using Ansible and PowerShell
---
# RAUSYS 2023, Leistungsstarker IT-Partner
# www.rausys.de
- name: Find all Services, Processes and Scheduled Tasks using the Domain Administrator
hosts: all
gather_facts: no
strategy: free
tasks:
- name: Domain Administrator Inspection via PowerShell
@snipe
snipe / fartgun.txt
Last active July 26, 2023 17:37
Pre-commit hook to prevent dummy text from being committed
#!/bin/sh
#
# This git hook should let us prevent commits from containing words that we sometimes use
# as "sky is blue" proof that a method is working when it's behaving strangely.
disallowed="poop fart poopy farty shit fuck"
git diff --cached --name-status | while read x file; do
if [ "$x" == 'D' ]; then continue; fi
for word in $disallowed
@ramimac
ramimac / Cloud Security Orienteering Checklist.md
Last active April 24, 2024 03:54
A Checklist of Cloud Security Orienteering

Cloud Security Orienteering: Checklist
by Rami McCarthy
via TL;DR sec

How to orienteer in a cloud environment, dig in to identify the risks that matter, and put together actionable plans that address short, medium, and long term goals.

Based on the Cloud Security Orienteering methodology.

Checklist

@krisek
krisek / alert.rules.yml
Last active July 16, 2024 07:49
Prometheus alert rules for node exporter
groups:
- name: node_exporter_alerts
rules:
- alert: Node down
expr: up{job="monitoring-pi"} == 0
for: 2m
labels:
severity: warning
annotations:
title: Node {{ $labels.instance }} is down
@xirkus
xirkus / terraform_the_missing_manual.md
Last active July 8, 2023 11:00
Terraform - The Missing Manual

Terrafrom Logo

Terraform - The Missing Manual

Infrastructure-as-Code is a principal that drives modern DevOps practice. I discuss the current state of Terraform and provide some basic guidelines/principles regarding how to structure it's usage for your project.

Tables of Contents

@ejlp12
ejlp12 / eks_best_practice.md
Last active February 8, 2024 18:42
EKS Best Practice

Please check https://aws.github.io/aws-eks-best-practices/ for more comprehensive EKS best practice!

Architecture

  • Think about multi-tenancy, isolation for different environment or different workload
    • Isolation at account level using AWS organization
    • Isolation at the network layer ie. different VPC & different cluster
    • Use different Nodes Group (Node pool) for different purpose/category e.g. create dedicated node groups for Operational tools such as CI/CD tool, Monitoring tool, Centralize logging system.
    • Separate namespace for different workload

Reliability | Principles

@swade1987
swade1987 / gist:b6c1ccd01b9830aef4ecc06c73373ee1
Created April 15, 2020 15:30
Upgrade from Helm 2 to Helm 3
#!/usr/bin/env bash
# Print v2 and v3 release counts
helm2_release_count=$(helm2 ls | cut -d " " -f 1 | tail -n +2 | wc -l)
helm3_release_count=$(helm3 ls --all-namespaces | cut -d " " -f 1 | tail -n +2 | wc -l)
printf "======================================================================\n"
printf "Helm v2 release count: %d\n" "${helm2_release_count}"
printf "Helm v3 release count: %d\n" "${helm3_release_count}"
printf "======================================================================\n\n"
@mikaelvesavuori
mikaelvesavuori / aws-things-attached-to-vpc.sh
Created January 10, 2020 15:10
AWS: See things connected to a VPC
#!/bin/bash
vpc="vpc-0000000000000000"
aws ec2 describe-internet-gateways --filters 'Name=attachment.vpc-id,Values='$vpc | grep InternetGatewayId
aws ec2 describe-subnets --filters 'Name=vpc-id,Values='$vpc | grep SubnetId
aws ec2 describe-route-tables --filters 'Name=vpc-id,Values='$vpc | grep RouteTableId
aws ec2 describe-network-acls --filters 'Name=vpc-id,Values='$vpc | grep NetworkAclId
aws ec2 describe-vpc-peering-connections --filters 'Name=requester-vpc-info.vpc-id,Values='$vpc | grep VpcPeeringConnectionId
aws ec2 describe-vpc-endpoints --filters 'Name=vpc-id,Values='$vpc | grep VpcEndpointId
aws ec2 describe-nat-gateways --filter 'Name=vpc-id,Values='$vpc | grep NatGatewayId
aws ec2 describe-security-groups --filters 'Name=vpc-id,Values='$vpc | grep GroupId
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active July 17, 2024 07:58
Conventional Commits Cheatsheet

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

Dashboard

Create, remove, edit interviews. alt dashboard

Environment

Select the environment stack that matches your company production environment (frameworks, languages, databases, utilities)

  • Backend frameworks: Django, Flask, Spring, SpringBoot, Play Framework, Ruby on Rails, NodeJS
  • Frontend frameworks: React, VueJS, Angular
  • languages: Python, JS, Ruby, Erlang, C, C++, Java, Scala
  • databases: MongoDB, PostgreSQL, MySQL, SQLite, Redis