Skip to content

Instantly share code, notes, and snippets.

View mdeeks's full-sized avatar

Mike Deeks mdeeks

  • San Francisco, CA
View GitHub Profile
@mdeeks
mdeeks / Bard.md
Last active May 10, 2023 22:57
Bard: Build a script with Bard to delete excess Bento Remote AMIs

👱 Show me how to delete all AMIs older than two weeks and tagged with role=bento-remote

🤖 Sure, here are the steps on how to delete all AMIs older than two weeks and tagged with role=bento-remote:

  1. Install the AWS CLI.
  2. Configure the AWS CLI with your AWS credentials.
  3. Run the following command to list all AMIs older than two weeks and tagged with role=bento-remote:
@mdeeks
mdeeks / ChatGPT4.md
Last active May 12, 2023 00:56
ChatGPT: Build a script with ChatGPT to delete excess Bento Remote AMIs

👱 detect and remove unused AWS AMIs

🤖 As a helpful assistant, I can provide you with the steps to detect and remove unused Amazon Machine Images (AMIs) in your AWS account. However, I cannot perform the actions for you. Follow these steps to detect and remove unused AMIs:

  1. Install and configure AWS CLI: If you haven't already, install the AWS Command Line Interface (CLI) and configure it with your AWS account credentials. You can find the instructions in the AWS documentation: Installing, updating, and uninstalling the AWS CLI and Configuration basics.

  2. List all AMIs: Use the following command to list all the AMIs owned by your AWS account:

@mdeeks
mdeeks / podman install
Last active October 26, 2022 22:29
Podman to replace Docker Desktop
brew install podman-desktop
brew install podman
podman machine init --cpus 4 --memory 2048
podman machine start
sudo podman-mac-helper install
@mdeeks
mdeeks / gist:1925cbb65f24a95b2f75dd9cdc0f0843
Created March 4, 2022 00:29
Find NVMe EBS mount name
# https://github.com/oogali/ebs-automatic-nvme-mapping/blob/master/README.md
sudo nvme id-ctrl --output binary /dev/nvme0n1 | cut -c3073-3104 | tr -d '[:space:]'
@mdeeks
mdeeks / generic_init.sh
Created November 13, 2013 22:57
Generic bash init script. Should work on both OS X and *nix. Probably won't support apps that fork. Works great for daemonizing things like python or ruby scripts.
#!/bin/bash
BasePath="$(cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)" # Absolute path. Will be CWD when run.
AppName="SomeApp"
Command="$BasePath/bin/your_script.sh"
LogFile="$BasePath/logs/run.log"
PidFile="$BasePath/pid"
ReloadSignal="USR1" # Leave this blank if your app doesn't support reloading
StopTimeout=10 # Max seconds to wait for process to terminate
@mdeeks
mdeeks / jmx.yaml
Created November 13, 2013 05:07
DataDog agent JMX config to monitor all java garbage collector types. Bucketed as "major" and "minor" collections.
init_config:
instances:
- host: localhost
port: 9999
conf:
# Young Gen Collectors (Minor Collections)
- include:
domain: java.lang
type: GarbageCollector