Skip to content

Instantly share code, notes, and snippets.

@kisst
kisst / ssm-dependency-endpoints.py
Last active November 7, 2024 09:58
Quick script for quick debugging
import boto3
import os
import sys
# Initialize boto3 clients
ec2_client = boto3.client('ec2')
# Required VPC endpoint services
ENDPOINT_SERVICES = {
"com.amazonaws.{region}.ssm": "Interface",
@kisst
kisst / pyq.py
Created October 8, 2024 15:00
minimal python yaml query script
#!/usr/bin/env python3
import sys
import yaml
import os
def include_yaml(loader, node):
# Get the path of the file to include
file_path = os.path.join(os.path.dirname(loader.name), node.value)
@kisst
kisst / generate.sh
Last active September 23, 2024 10:03
AWS CloudShell Steampipe config generator for AWS Orgs
#!/bin/bash
# Ensure Steampipe is installed
if ! command -v steampipe >/dev/null; then
sudo /bin/sh -c "$(curl -fsSL https://steampipe.io/install/steampipe.sh)"
steampipe plugin install steampipe
steampipe plugin install aws
steampipe plugin update --all
fi
@kisst
kisst / fetch.py
Created March 26, 2023 11:38
timeanddata weather history scraper
#!/usr/bin/env python3
"""
Fetch weather data from timeanddate
"""
import re
import json
from datetime import date
import html
import pprint
import requests
@kisst
kisst / typeit.py
Last active October 3, 2022 13:14
One directional VDI proof "copy/paste"
#!/usr/bin/env python3
"""
Type the content of the file given in parameter
"""
import time
import sys
import pyautogui
# validate that we have something to type
if not len(sys.argv) == 2:
@kisst
kisst / im.list
Created October 23, 2021 13:51
active IM solutions
aim
band
bbmenterprise
bitmessage
cryptocat
discord
facebookmessanger
facetime
firechat
gadugadu
@kisst
kisst / code.py
Created August 24, 2021 10:21
rpi pico circuitpython demo
import board
import digitalio
import time
led = digitalio.DigitalInOut(board.GP25)
led.direction = digitalio.Direction.OUTPUT
def blink(count=1, delay=0.5):
for cv in range(count):
led.value = True
@kisst
kisst / aws_region_check.py
Created March 24, 2021 11:07
Recover the old view in the regional supported service table
#!/usr/bin/env python3
"""
The missing function for AWS region support
"""
from collections import defaultdict
import requests
import pandas as pd
list_of_regions = []
list_of_services = []
@kisst
kisst / usbg
Last active October 2, 2022 00:54
usbguard "gui"
#!/usr/bin/env python
import os
import re
import sys
DEVICE_LIST_RE = r"(\d{1,3}):\s(allow|block)\sid\s([0-9abcdef]{4}:[0-9abcdef]{4})\sserial\s\"(.*)\"\sname\s\"(.*)\"\shash\s\"([a-zA-Z0-9=+\/]{44})\"\sparent-hash\s\"([a-zA-Z0-9=+\/]{44})\"\svia-port\s\"(.{1,8})\"\swith-interface\s([^\"]*)\s\"(.*)\""
stream = os.popen('usbguard list-devices')
list = stream.read().strip().splitlines()
@kisst
kisst / lambda-offload.py
Created August 3, 2019 15:47
Medium ...
import lambdalayer.mymodule
def lambda_handler(event, context)
mymodule.offloadedcode(event, context)