Skip to content

Instantly share code, notes, and snippets.

View phwelo's full-sized avatar
🌈

Daniel Agans phwelo

🌈
View GitHub Profile
@phwelo
phwelo / README.md
Created December 17, 2024 01:44
This is an action schema for ChatGPT Custom GPT Actions to read all text files from a Github repo.
  • replace "phwelo" with your username
  • replace "parenting-gpt" with your repo name
  • i use a query like this to verify it's got the data:
  • Load all text files from my repository. Give an overall impression of the data imported.
@phwelo
phwelo / README.md
Created December 17, 2024 01:34
This is an action schema for ChatGPT Custom GPT Actions to read all text files from a Github repo.

replace "phwelo" with your username replace "parenting-gpt" with your repo name i use a query like this to verify it's got the data: Load all text files from my repository. Give an overall impression of the children described.

You probably aren't describing children. Change that to your thing

### Keybase proof
I hereby claim:
* I am phwelo on github.
* I am danielagans (https://keybase.io/danielagans) on keybase.
* I have a public key ASDaF1ApciS6XJOX4e9-o8LXVl-YYW3-pOUWu4xSB1Ezqgo
To claim this, I am signing this object:
@phwelo
phwelo / public_instances.py
Created August 11, 2022 14:43
Public Instances - List any EC2 instances that have a public address associated
#!/usr/bin/env python3
import boto3
import json
client = boto3.client('ec2')
ec2_result = client.describe_instances()
results = []
for result in ec2_result["Reservations"]:
@phwelo
phwelo / inline_policies.py
Created August 11, 2022 14:42
List any inline IAM policies
#!/usr/bin/env python3
import boto3
client = boto3.client('iam')
# three different calls to get inline-policy on all IAM items:
# list_groups - get_group_policy
# list_roles - get_role_policy
# list_users - get_user_policy
@phwelo
phwelo / imdsv2_all_instances.py
Created August 11, 2022 14:41
IMDSv2 for everything - Set metadata to IMDSv2 for all of your ec2 instances
#!/usr/bin/env python3
import boto3
client = boto3.client('ec2')
def set_imdsv2_required(instance_id):
client.modify_instance_metadata_options(
InstanceId=instance_id,
HttpTokens='required',
@phwelo
phwelo / higlight.py
Created August 11, 2022 14:39
Highlight - Simple grep tool that highlights instead of displaying only results
#!/usr/bin/env python3
from colorama import init, Fore, Back, Style
import sys
import argparse
init(autoreset=True)
what_color = Fore.BLACK + Back.WHITE
parser = argparse.ArgumentParser(exit_on_error=False)
@phwelo
phwelo / space_heater.py
Created January 12, 2022 22:36
Low is too high, so I'll try and turn it on and off at a frequency that leaves me comfortable...
#!/usr/bin/env python3
import argparse, atexit, os, subprocess, time
from datetime import datetime
tmpfile = "/tmp/heaterstate"
# it's going to be nicer to have this switch off when the script is killed
def exit_handler():
set_switch(args.ip, "off")
#!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
import json
import sys
import transposer
import argparse
# transpose(source_chord, direction, to_key)
@phwelo
phwelo / rando.py
Created October 25, 2021 19:53
Random Curseforge Modpack Chooser, Static Minecraft Version 17.1, static pages count of 10
#!/usr/bin/env python3
import requests
import json
import random
import webbrowser
import sys
# This is a query for 1.17.1 modpacks
base_searchpage = "https://www.modpackindex.com/api/v1/minecraft/version/71/modpacks?limit=100&page="