Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / keymap.json
Last active May 15, 2025 18:48
zed config
// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
// Standard bindings
{
@pythoninthegrass
pythoninthegrass / kestra-python.yml
Created August 29, 2024 21:18
Use namespace files to run a basic python script on the kestra host
id: editor
namespace: company.team
tasks:
- id: hello
type: io.kestra.plugin.scripts.python.Script
namespaceFiles:
enabled: true
script: "{{ read('scripts/hello.py') }}"
@pythoninthegrass
pythoninthegrass / hello-ansible.yml
Created August 29, 2024 21:16
Kestra mvp for inline ansible inventory and playbook. Alternative is namespace files or the git plugin
id: ansible
namespace: company.team
tasks:
- id: ansible_task
type: io.kestra.plugin.ansible.cli.AnsibleCLI
inputFiles:
inventory.ini: |
localhost ansible_connection=local
myplaybook.yml: |
@pythoninthegrass
pythoninthegrass / ticktick_to_obsidian.py
Created August 23, 2024 19:11
Generate markdown files from TickTick backup CSV for use with Obsidian + Python Scripter plugin
#!/usr/bin/env python
import sys
import csv
import re
from pathlib import Path
python_script = Path(sys.argv[0])
vault_path = Path(sys.argv[1] if len(sys.argv) > 1 else "../../..").resolve()
file_path = Path(sys.argv[2] if len(sys.argv) > 2 else ".").resolve()
services:
cosmos-server:
image: azukaar/cosmos-server:latest
container_name: cosmos-server
hostname: cosmos-server
restart: on-failure:3
# ports:
# - 80:80
# - 443:443
# - 4242:4242/udp
@pythoninthegrass
pythoninthegrass / backup.sh
Last active August 9, 2024 21:57
rsync backup script with logging and crontab usage
#!/usr/bin/env bash
set -euo pipefail
# trap exit signals 2, 1, 15
trap "exit" SIGINT SIGHUP SIGTERM
cat << 'DESCRIPTION' >/dev/null
USAGE:
backup.sh [SRC] [DEST] [EXT] [TLD] [SUB_DIR] [LOG_PATH]
@markuman
markuman / README.md
Last active February 11, 2025 11:30
🗺️ OSM - self host the entire planet 🌎 in ~30 minutes 🚀

🗺️ OSM - self host the entire planet 🌎 in ~30 minutes 🚀

TL;DR

mkdir osm
wget -O osm/planet.mbtiles https://hidrive.ionos.com/api/sharelink/download?id=SYEgScrRe
podman run -ti --rm -p 9000:9000 --name sms -v $(pwd)/osm/:/data/ registry.gitlab.com/markuman/sms:latest
firefox http://localhost:9000
@fliepeltje
fliepeltje / app.py
Created July 25, 2024 10:28
FastAPI with boto3 on Fly.io
import os
import boto3
from fastapi import FastAPI
S3_URL = os.getenv("AWS_ENDPOINT_URL_S3")
svc = boto3.client('s3', endpoint_url=S3_URL)
app = FastAPI()
@app.get("/")
@pythoninthegrass
pythoninthegrass / bootstrap_acme
Last active October 24, 2024 20:31
acme.sh wrapper for godaddy (migrated from certbot)
#!/usr/bin/env bash
# shellcheck disable=SC2120
# exit on signals: 2, 1, 15
trap 'exit' SIGINT SIGHUP SIGTERM
# $USER
[[ -n $(logname >/dev/null 2>&1) ]] && logged_in_user=$(logname) || logged_in_user=$(whoami)
@jph00
jph00 / fasthtml-eg.sml.md
Last active July 8, 2025 04:35
FastHTML by example (small)

FastHTML By Example

An alternative introduction

There are lots of non-FastHTML-specific tricks and patterns involved in building web apps. The goal of this tutorial is to give an alternate introduction to FastHTML, building out example applications to show common patterns and illustrate some of the ways you can build on top of the FastHTML foundations to create your own custom web apps. A secondary goal is to have this be a useful document to add to the context of an LLM to turn it into a useful FastHTML assistant - in fact, in some of the examples we’ll see this kind of assistant in action, thanks to this custom GPT.

Let’s get started.

FastHTML Basics