Skip to content

Instantly share code, notes, and snippets.

@pims
pims / app.py
Last active January 3, 2024 20:26
Example of running a python script via python-wasi using the wasmtime wasm runtime
print("hello from a python script")
@eyeseast
eyeseast / python.md
Last active November 6, 2023 01:32
How to set up Python in 2022

I have an updated version of this on my blog here: https://chrisamico.com/blog/2023-01-14/python-setup/.

Python

This is my recommended Python setup, as of Fall 2022. The Python landscape can be a confusing mess of overlapping tools that sometimes don't work well together. This is an effort to standardize our approach and environments.

Tools and helpful links:

  • Python docs: https://docs.python.org/3/
  • Python Standard Library:  - Start here when you're trying to solve a specific problem
@BigNerd
BigNerd / k9s.txt
Last active May 1, 2024 03:56
K9s column descriptions
View: Pods(<namespace>)[number of pods listed]
NAME pod name
READY number of pods in ready state / number of pods to be in ready state
RESTARTS number of times the pod has been restarted so far
STATUS state of the pod life cycle, such as Running | ... | Completed
CPU current CPU usage, unit is milli-vCPU
MEM current main memory usage, unit is MiB
%CPU/R current CPU usage as a percentage of what has been requested by the pod
%MEM/R current main memory usage as a percentage of what has been requested by the pod
@kevwan
kevwan / dockerfile.md
Last active November 5, 2022 01:26
The simplest way to write Dockerfile!

1. choose a simple linux image

For example alpine, it's only about 5MB.

2. set timezone if necessary

RUN apk add --no-cache tzdata
ENV TZ America/New_York
@zh4n7wm
zh4n7wm / generate-signed-urls-and-cookies-for-cloudfront-with-python-and-golang.md
Last active July 12, 2023 21:27
AWS CloudFront generate signed urls and cookies with Python and Golang
@Plecra
Plecra / proxy.rs
Created May 3, 2020 17:00
A smol proxy server
use anyhow::*;
use futures::io::{copy, AsyncReadExt, AsyncWriteExt};
use futures::stream::StreamExt;
use log::*;
use smol::Async;
use std::net;
const PORT: u16 = 5000;
@airalcorn2
airalcorn2 / make_dicom_gifs.py
Last active September 14, 2023 11:08
Convert DICOM data to GIFs.
# Derived from: https://github.com/pydicom/pydicom/blob/master/examples/input_output/plot_read_dicom_directory.py.
import imageio
import matplotlib.pyplot as plt
import numpy as np
import pydicom
from os import mkdir
from os.path import join
from PIL import Image
@RagedUnicorn
RagedUnicorn / cloud_init_debugging.md
Last active May 2, 2024 14:38
Debugging tipps when working with cloud-init

Cloud-Init Debugging

Cloud-init combined with terraform can be a powerful tool to provision instances on startup. Debugging scripts that are run by cloud-init however are not the easiest to debug.

Logs

Usually on an Ubuntu machine a lot of what is happening can be found in the syslog

cat /var/log/syslog
@mneedham
mneedham / app.py
Last active February 9, 2024 18:26
Mapping Strava runs using Leaflet and Open Street Map
from flask import Flask
from flask import render_template
import csv
import json
app = Flask(__name__)
@app.route('/')
def my_runs():
runs = []
@maxvt
maxvt / infra-secret-management-overview.md
Last active February 28, 2024 20:53
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.