Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View marcelaraujo's full-sized avatar

Marcel Araujo marcelaraujo

View GitHub Profile
@roib20
roib20 / apt-repo-playbook.yaml
Last active March 30, 2024 17:39
Example usages of the new `deb822_repository` Ansible module
---
- hosts: localhost
connection: local
gather_facts: true
tasks:
- name: Add APT repositories
when: ansible_os_family == 'Debian'
become: true
block:
@superseb
superseb / create-nginx-in-front-of-github.sh
Last active June 5, 2023 09:04
Front github.com with self signed certificate to test custom CA in tooling
#!/bin/bash
while true; do
docker ps && break
echo "waiting for docker to respond"
sleep 3
done
echo "Generating nip.io based on found external IP"
FOUNDIP=$(docker run --rm --net=host appropriate/curl https://api.ipify.org)
FQDN="git.${FOUNDIP}.nip.io"
@mhmdio
mhmdio / data.tf
Last active April 9, 2024 08:53
terraform data account_id and region
data "aws_caller_identity" "current" {} # data.aws_caller_identity.current.account_id
data "aws_region" "current" {} # data.aws_region.current.name
output "account_id" {
description = "Selected AWS Account ID"
value = data.aws_caller_identity.current.account_id
}
output "region" {
description = "Details about selected AWS region"
# Source: https://gist.github.com/820aecf0799d679d9082eef00d07b515
#############################################################################
# Bitnami Sealed Secrets #
# How To Store Kubernetes Secrets In Git Repositories Without Getting Fired #
# https://youtu.be/xd2QoV6GJlc #
#############################################################################
# Referenced videos:
# - What Is GitOps And Why Do We Want It?: https://youtu.be/qwyRJlmG5ew
@Kestrer
Kestrer / how-to-write-hygienic-macros.md
Created October 17, 2020 05:35
A guide on how to write hygienic Rust macros

How to Write Hygienic Rust Macros

Macro hygiene is the concept of macros that work in all contexts; they don't affect and aren't affected by anything around them. Ideally all macros would be fully hygienic, but there are lots of pitfalls and traps that make it all too easy to accidentally write unhygienic macros. This guide attempts to provide a comprehensive resource for writing the most hygienic macros.

Understanding the Module System

First, a little aside on the details of Rust's module system, and specifically paths; it is

@xandout
xandout / README.md
Last active March 9, 2024 17:42
Kubernetes DaemonSet that enables a direct shell on each Node using SSH to localhost

Getting a shell on each node

I run several K8S cluster on EKS and by default do not setup inbound SSH to the nodes. Sometimes I need to get into each node to check things or run a one-off tool.

Rather than update my terraform, rebuild the launch templates and redeploy brand new nodes, I decided to use kubernetes to access each node directly.

Alternative option

https://github.com/alexei-led/nsenter

GPG Cheat Sheet

Written for GPG versions 2.x only.

List keys

List public keys

gpg --list-keys
@peterwwillis
peterwwillis / LINUX_ACTIVE_DIRECTORY_SSSD_HOWTO.md
Created July 13, 2020 12:09
How to set up an Ubuntu 18.04 Linux system to use sssd to authenticate users using Active Directory without joining a domain

Set up Ubuntu Linux to use Active Directory for user authentication + authorization

This guide will step you through setting up an Ubuntu 18.04 Linux system so that you can login to it using an Active Directory server for authentication and authorization. NOTE: You do not need to join a domain to use this method!!

The net effect of this guide is that you do not need to ever set up a user on your Linux host. Its home directory will be automatically created at log-in time, and its password is checked (along with account expiration) against the Active Directory server.

@steven-terrana
steven-terrana / kill_all.groovy
Created September 10, 2019 17:48
[Kill All Builds] kill all queued and running jobs #Jenkins
import java.util.ArrayList
import hudson.model.*;
// Remove everything which is currently queued
def q = Jenkins.instance.queue
for (queued in Jenkins.instance.queue.items) {
q.cancel(queued.task)
}
// stop all the currently running jobs
@gregjhogan
gregjhogan / base64-decode-file-names.sh
Created August 15, 2019 20:17
base64 decode file names in directory that have base64 encoded names
find <dir> -type f | xargs -L 1 -I {} basename {} | xargs -L 1 -I {} printf "{}\nCg==" | base64 -d