Skip to content

Instantly share code, notes, and snippets.

View res0nat0r's full-sized avatar
🤗

Stefhen Hovland res0nat0r

🤗
  • Austin, TX
View GitHub Profile
#!/usr/bin/env python
from ipaddress import ip_network, ip_address
import sys
cidrs = []
with open(sys.argv[1], "r") as f:
for line in f:
@res0nat0r
res0nat0r / colima.md
Last active September 24, 2024 02:08
Set proxy in Colima Docker container

abiosoft/colima#294 (comment)


Note: this assumes Colima v0.4.0 or newer.

SSH into the VM colima ssh

Edit docker init script sudo vi /etc/init.d/docker.

@res0nat0r
res0nat0r / lambda.js
Created October 4, 2022 18:50
Lambda network connectivity tester
const http = require('https');
exports.handler = async (event, context) => {
return new Promise((resolve, reject) => {
const options = {
host: 'httpbin.org',
path: '/uuid',
port: 443,
method: 'GET'
};
const req = http.request(options, (res) => {
@res0nat0r
res0nat0r / multiple-repository-and-identities-git-configuration.md
Created December 8, 2021 17:54 — forked from bgauduch/multiple-repository-and-identities-git-configuration.md
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@res0nat0r
res0nat0r / ecr.json
Last active September 15, 2021 20:45
EventBridge + ECR
{
"detail-type": [
"ECR Image Scan"
],
"source": [
"aws.ecr"
],
"detail": {
"finding-severity-counts": {
"CRITICAL": [{
@res0nat0r
res0nat0r / resident_advisor.txt
Created June 18, 2021 05:50
Resident Advisor Podcast URLs
http://audio.ra.co/podcast/RA586_170821_Zadig-residentadvisor.net.mp3
http://audio.ra.co/podcast/RA590_170918_Jon-K-residentadvisor.net.mp3
http://audio.ra.co/podcast/RA591_170925_Noncompliant-residentadvisor.net.mp3
http://audio.ra.co/podcast/RA592_171002_DJ-Minx-residentadvisor.net.mp3
http://audio.ra.co/podcast/RA593_171009_Phase-Fatale-residentadvisor.net.mp3
http://audio.ra.co/podcast/RA595_171023_MESH-residentadvisor.net.mp3
http://audio.ra.co/podcast/RA596_171030_Oscar-Mulero-residentadvisor.net.mp3
http://audio.ra.co/podcast/RA597_171106_Mafalda-residentadvisor.net.mp3
http://audio.ra.co/podcast/RA598_171113_Anastasia-Kristensen-residentadvisor.net.mp3
http://audio.ra.co/podcast/RA599_171120_Partok-residentadvisor.net.mp3
#!/usr/bin/env python
with open('plugins.txt', 'r') as f:
for line in f.readlines():
plugin, version = line.split(':')
version = version.strip()
print("- name: %s\n version: \"%s\"" % (plugin, version))
@res0nat0r
res0nat0r / hello-deployment.yml
Last active November 13, 2024 21:09
Internal / External Kubernetes Service Example
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: hello-world
@res0nat0r
res0nat0r / ps1.sh
Created November 18, 2020 15:32
updated ps1
export PS1="$(hr '━')\n\$(kube_ps1)\n\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[0;31m\]\$(__git_ps1)\n\$\[\033[00m\] "
@res0nat0r
res0nat0r / delete-old-versions.py
Last active November 10, 2021 18:44
Delete all non latest s3 objects
#!/usr/bin/env python
import json
import sys
# https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html
# USAGE:
# aws s3api list-object-versions --bucket > versions.json
# ./delete-old-versions.py ./versions.json > delete.json