Skip to content

Instantly share code, notes, and snippets.

# created 2024-04-25 by Noah Coad ncoad@amazon.com
# demo video at https://youtu.be/9UkoTsXMnlQ
import streamlit as st, boto3
# setup app
amazon_q = boto3.client('qbusiness', 'us-west-2')
st.title("Amazon Q Chatbot") #page title
# created 2024-04-25 by Noah Coad ncoad@amazon.com
# demo video at https://youtu.be/9UkoTsXMnlQ
import streamlit as st, boto3
# parameters
aws_region = 'us-west-2'
q_app_id = 'be05d006-3c25-439e-b25d-781ad5b2xxxx'
q_user_id = 'AmazonQ-Administrator'

Creating an AWS IoT Thing from Command Line

Use this script to create a new AWS IoT Thing from the command line.

@noahcoad
noahcoad / readme.md
Last active March 2, 2024 22:02
Code Minecraft with Python on Mac OSX

Code Minecraft with Python on Mac OSX

Here's a step-by-step to get started scripting Minecraft with Python on Mac OSX

@noahcoad
noahcoad / noah_new_computer_setup.md
Last active February 12, 2024 05:30
New Computer Setup

New Computer Setup for Mac

The steps I use to restore a new mac to the settings and apps I like to use.

@noahcoad
noahcoad / easily-switch-accounts-in-aws.md
Last active December 13, 2023 06:40
Easily Switch Accounts in AWS with Role Switcher

Easily Switch Accounts in AWS

When working with multiple AWS accounts, it can be a pain to keep signing out and signing back in. I work with a number of accounts, my own, customer accts, burner accts, etc. It was a pain to keep logging in and out of the AWS Console. Thankfully the AWS Console has a "Role Switcher" that lets you quickly switch between accounts built-in. It does this by assuming a role from another account. Here's how to set that up...

@noahcoad
noahcoad / json2yaml.py
Last active November 3, 2023 11:40
Python to convert json to yaml
#!/usr/bin/env python3
# convert json to yaml
# http://pyyaml.org/wiki/PyYAMLDocumentation
# python3 json2yaml.py < ~/code/manpow/moneybug/mbuploader/support/offices.json
# gist https://gist.github.com/noahcoad/46909253a5891af3699580b8f17baba8
import yaml, json, sys
sys.stdout.write(yaml.dump(json.load(sys.stdin)))
@noahcoad
noahcoad / aws_iot_use_custom_root_ca.md
Last active September 27, 2023 10:56
AWS IoT: Use a Custom Root CA
@noahcoad
noahcoad / GoAwayModalDialogs.ahk
Created January 3, 2013 21:04
Automates away pesky modal dialogs.
; ==========================================================================================
; == Modal Dialog Automation
; ==
; == Automates away pesky modal dialogs by applying a default response when they pop up
; == Helper functions are at the bottom
; ==========================================================================================
; Defaults to fast no-regex title matching
SetTitleMatchMode, 2
//
// Example of using ESP32 Arudino mbed library to
// Encrypt and Decrypt using an asyncronous RSA 2048 bit public and private key pair
// created 2020-07-05 by Noah Coad
//
// Inside a "data" directory, run these commands to generate a key pair
// then use the ESP32 Sketch Data Uploader to upload files to ESP32 SPIFFS files
//
// openssl genrsa -out private-rsa 2048
// openssl pkcs8 -topk8 -inform pem -in private-rsa -outform pem -nocrypt -out private