some python scripts that are sometimes helpful to me
run a script#
only general requirement is uv
chmod +x <script-name>
./<script-name> <...>
scripts#
analyze-github-followerscheck-files-for-bad-linksdm-me-when-a-flight-passes-overfind-longest-bsky-threadfind-stale-bsky-followskill-processespredict-github-starsupdate-lightsupdate-readme
analyze-github-followers#
analyze your github followers and following.
usage: ./analyze-github-followers ./analyze-github-followers --summary-only # skip detailed analysis
details:
- uses github rest api to fetch followers/following
- shows rich tables with follower stats
- identifies mutual follows, notable followers, etc.
- requires GITHUB_TOKEN in .env file
check-files-for-bad-links#
Check files for bad links.
Usage:
./check-files-for-bad-links *.md
Details:
- uses
httpxto check links - uses
anyioto run the checks concurrently - pass include globs to scan (e.g.
*.md) - pass exclude globs to skip (e.g.
*.md) - pass ignore-url prefixes to ignore (e.g.
http://localhostorhttps://localhost) - pass concurrency to run the checks concurrently (default is 50)
dm-me-when-a-flight-passes-over#
Monitor flights passing overhead and send BlueSky DMs.
Usage: # Single user mode (backward compatible) ./dm-me-when-a-flight-passes-over
# Multi-subscriber mode with JSON file
./dm-me-when-a-flight-passes-over --subscribers subscribers.json
# Multi-subscriber mode with stdin
echo '[{"handle": "user1.bsky.social", "latitude": 41.8781, "longitude": -87.6298, "radius_miles": 5}]' | ./dm-me-when-a-flight-passes-over --subscribers -
This script monitors flights within a configurable radius and sends DMs on BlueSky when flights pass overhead. Supports multiple subscribers with different locations.
Future Architecture Ideas#
Web App Deployment Options#
-
FastAPI + Fly.io/Railway/Render
- REST API with endpoints:
- POST /subscribe - Register user with BlueSky handle
- DELETE /unsubscribe - Remove subscription
- POST /update-location - Update user's location
- GET /status - Check subscription status
- Background worker using Celery/RQ/APScheduler
- PostgreSQL/SQLite for subscriber persistence
- Redis for caching flight data & deduplication
- REST API with endpoints:
-
Vercel/Netlify Edge Functions
- Serverless approach with scheduled cron jobs
- Use Vercel KV or Upstash Redis for state
- Challenge: Long-running monitoring needs workarounds
- Solution: Trigger checks via cron every minute
-
Self-Hosted with ngrok/Cloudflare Tunnel
- Quick prototype option
- Run this script as daemon
- Expose simple Flask/FastAPI wrapper
- Security concerns: rate limiting, auth required
Mobile/Browser Integration#
-
Progressive Web App (PWA)
- Service worker for background location updates
- Geolocation API for current position
- Push notifications instead of/alongside DMs
- IndexedDB for offline capability
-
iOS Shortcuts Integration
- Create shortcut that gets location
- Calls webhook with location + BlueSky handle
- Could run automatically based on focus modes
-
Browser Extension
- Background script polls location
- Lighter weight than full app
- Cross-platform solution
Architecture Components#
-
Location Services Layer
- Browser Geolocation API
- IP-based geolocation fallback
- Manual location picker UI
- Privacy: Only send location when checking flights
-
Notification Options
- BlueSky DMs (current)
- Web Push Notifications
- Webhooks to other services
- Email/SMS via Twilio/SendGrid
-
Subscription Management
- OAuth with BlueSky for auth
- User preferences: radius, notification types
- Quiet hours/Do Not Disturb
- Rate limiting per user
-
Data Optimization
- Cache FlightRadar API responses
- Batch location updates
- Aggregate nearby users for efficiency
- WebSocket for real-time updates
Implementation Approach#
Phase 1: Web API Wrapper
- FastAPI with /subscribe endpoint
- SQLite for subscribers
- Run monitoring in background thread
- Deploy to Fly.io free tier
Phase 2: Web UI
- Simple React/Vue form
- Geolocation permission request
- Show nearby flights on map
- Subscription management
Phase 3: Mobile Experience
- PWA with service workers
- Background location updates
- Local notifications
- Offline support
Security Considerations#
- Rate limit FlightRadar API calls
- Authenticate BlueSky handles
- Validate location bounds
- Prevent subscription spam
- GDPR compliance for location data
find-longest-bsky-thread#
Find the longest reply thread from a Bluesky post.
Usage:
./find-longest-bsky-thread https://bsky.app/profile/nerditry.bsky.social/post/3lnofix5nlc23
Details:
find-stale-bsky-follows#
Find stale/inactive accounts among those you follow on Bluesky.
Usage:
./find-stale-bsky-follows
# or with custom inactivity threshold (days)
./find-stale-bsky-follows --days 180
Details:
- uses
atprototo fetch following list - uses
richfor pretty output - identifies accounts with no recent posts
kill-processes#
AI-powered TUI for killing processes.
Usage:
./kill-processes
Details:
- uses
textualfor the TUI - uses
marvin(built onpydantic-ai) to annotate processes
predict-github-stars#
Predict when a GitHub repository will reach a target number of stars.
Usage: ./predict-github-stars owner/repo 10000
Details:
- Uses GitHub REST API to fetch star history (with timestamps).
- Fits polynomial regression (degree 1–3) to full history.
- Falls back to recent‑trend linear extrapolation if the polynomial cannot reach the target within ten years.
- Shows recent growth rate and a caution for long‑range estimates.
- Requires
GITHUB_TOKENin the environment for higher rate limits (optional).
update-lights#
Make some change to my phillips hue network of lights via agent + MCP server.
Usage:
./update-lights -m "turn on sahara in the living room and nightlight in the kitchen"
Details:
- uses a
marvin(built onpydantic-ai) agent - the agent spins up a
fastmcpMCP server that talks to myphuebridge - set
HUE_BRIDGE_IPandHUE_BRIDGE_USERNAMEin.envor otherwise in environment - uses
OPENAI_API_KEYby default, but you can setAI_MODELin.envor otherwise in environment to use a different model
update-readme#
Update the README.md file with a list of all the scripts in the current directory.
Usage:
./update-readme