Skip to content

Instantly share code, notes, and snippets.

View Angelin01's full-sized avatar

Angelo Ross Angelin01

View GitHub Profile
@Angelin01
Angelin01 / twitter_getter.py
Created May 2, 2022 16:14
Twitter 2 Discord
# Old script I made and had laying around, it's not really adequate corpared to something I'd create
# these days, but it works
# Simple script to poll Twitter for tweets and route them to a Discord webhook
# Run it periodically, using something like Cron
# Requires the following environment variables, can also be read from a file `.env` in the same
# directory as this one:
# USERNAME: Case insensitive twitter handle without the @
# LAST_TWEET: File name to store the last tweet ID, must have read/write permissions
# BEARER: Bearer token for twitter API
# WEBHOOK: Discord's webhook URL
@Angelin01
Angelin01 / interrupt-monitor.sh
Created November 29, 2021 13:09
AWS EC2 Spot Instance Interrupt Monitor for Graceful Stop
#!/bin/bash
set -o nounset -o pipefail
IMDS_ENDPOINT=${IMDS_ENDPOINT:-"http://169.254.169.254"}
IMDS_VERSION=${IMDS_VERSION:-latest}
MONITOR_INTERVAL=${MONITOR_INTERVAL:-5}
check_dependencies() {
local dependencies=("jq" "curl")