Skip to content

Instantly share code, notes, and snippets.

View st3fan's full-sized avatar

Stefan Arentz st3fan

View GitHub Profile
import asyncio
import json
from agno.agent.agent import Agent
from aiodns import DNSResolver
async def query_address_records(hostname: str) -> str:
"""
Use this function to find the A and AAAA records for a given hostname.
It looks like I encountered an issue resolving the MX records for some domains. "proteinpowdershake.com" could not be found. I'll try checking the rest and summarize the results.
I checked the MX records for the domains in the provided file. Here is the summary:
Domains using **Google Workspace**:
1. memeburn.com
2. eileenanddogs.com
3. muledesign.com
4. satoshidisk.com
@st3fan
st3fan / Notes.md
Created January 11, 2025 21:28
SSH & Tmux

This is ~/.ssh/rc

#!/bin/sh

if [ -n "$SSH_AUTH_SOCK" -a -n "$XDG_RUNTIME_DIR" ]; then
  ln -sf "$SSH_AUTH_SOCK" "$XDG_RUNTIME_DIR/.ssh-agent.socket"
fi
env:
REGISTRY: ghcr.io
IMAGE_NAME: "${{ github.repository }}"
...
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
Notering Titel Artiest Jaartal
1 Bohemian Rhapsody Queen 1975
2 Fix You Coldplay 2005
3 Hotel California Eagles 1977
4 Roller Coaster Danny Vera 2019
5 Piano Man Billy Joel 1973
6 Better Days Dermot Kennedy 2021
7 Stairway To Heaven Led Zeppelin 1971
8 Avond Boudewijn de Groot 1997
9 Love Of My Life Queen 1975
defmodule WeatherWeb.WeatherLive do
use WeatherWeb, :live_view
@owm_url "https://api.openweathermap.org/data/2.5/weather?units=metric&lat=43.8999464&lon=-78.9408778&appid=XXX"
defmodule WeatherWeb.WeatherLive.WeatherSummary do
defstruct [:temperature, :name, :description, :icon]
end
alias WeatherWeb.WeatherLive.WeatherSummary
takahe-takahe-stator-1 | Traceback (most recent call last):
takahe-takahe-stator-1 | File "/usr/local/lib/python3.11/site-packages/asgiref/sync.py", line 486, in thread_handler
takahe-takahe-stator-1 | raise exc_info[1]
takahe-takahe-stator-1 | File "/takahe/stator/models.py", line 172, in atransition_attempt
takahe-takahe-stator-1 | next_state = await current_state.handler(self) # type: ignore
takahe-takahe-stator-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
takahe-takahe-stator-1 | File "/takahe/users/models/password_reset.py", line 41, in handle_new
takahe-takahe-stator-1 | await sync_to_async(send_mail)(
takahe-takahe-stator-1 | File "/usr/local/lib/python3.11/site-packages/asgiref/sync.py", line 448, in __call__
takahe-takahe-stator-1 | ret = await asyncio.wait_for(future, timeout=None)
@st3fan
st3fan / ivory-check.py
Created December 22, 2022 19:51
Cron job to check if the Ivory TestFlight Beta is available
#!/usr/bin/env python3
import requests
if __name__ == "__main__":
r = requests.get("https://testflight.apple.com/join/2bauS53v")
r.raise_for_status()
if "This beta is full" not in r.text:
r = requests.post("https://api.pushover.net/1/messages.json", data={
"token": "PUSHOVER_TOKEN_HERE",
@st3fan
st3fan / day6.c
Last active December 7, 2022 01:50
char*I="zcncrcnrrlccmhchssgqsqrsstfffnqfnfsswgwjjcmcnnvjvwjvwvfvnvwwhvv"
"wmwhmwwwhbhhldhdmhhdfdbdfbdblllnfllgslllqhlhfhlhqllncnfnsffwmwzzlglzlw"
"lhwwmvmddpvvbrvrdvrdvdhhzdhdpdzzbgbsssrpsrshrshhbqbgbmmtwwcbcrbbvnvhnn"
"cscwcwlcwlwnwswbbnwntthzzdlzdzffvqvdqvvtptdptphpddzzvhzvzwwqgqjjjvsspv"
"spsbsffvpvcvjcvjvrvjjgmjjhrrdhhdvhvttjttzptpssnlnjjlnnhmnndjnjwwtjjtbb"
"fflwfwgwvvpjpwpcwcgglmgmdmnmbbqtqctcwcmwwvmvlmvmdvdvhvlhlzhzttghttnvnj"
"ntnqqtmtwwhvhrhfhchqchhdrdllnwnfwfjjmsmmnhhshnhpptstjjpnpzzhmmpssgrsrz"
"srrffzjjhvjhjcjcpcvpccfnfjnfjfllssrdsdnnmffldldppcctcmtctffprpsrrrfhfm"
"flldccnpppvsswppdgpgjpgpqgpqpjppclcjczcnzzzqvzzwlzzqfzffsqqphqhvqqbccc"
"stsdttwcwcvvmjjhqqmllpglgtgwgnnbnrbnnjdndhhbrbvrvwwwblwwwppmdmttztqzqr"
class _NoPadding: pass
_Chunk_T = TypeVar("_Chunk_T")
def _windowed(iterable: Iterable[_Chunk_T], size: int, step: int = 1, padding: _NoPadding|Any = _NoPadding()) -> Iterable[Iterable[_Chunk_T|None]]:
it = iter(iterable)
chunk: List[_Chunk_T|Any] = []
while True:
# Pop step items from the buffer
if chunk: