Skip to content

Instantly share code, notes, and snippets.

View jsenecal's full-sized avatar

Jonathan Senecal jsenecal

View GitHub Profile
@gdamjan
gdamjan / aiohttp-server.py
Last active October 2, 2021 15:29
Example: asyncio and aiohttp, handling longpoll, eventsource and websocket requests with a queue and background workers
from aiohttp import web
from threading import Thread
import asyncio
import time, uuid
loop = asyncio.get_event_loop()
def long_blocking_thing(sleep):
time.sleep(sleep)
return 42
@SeanSobey
SeanSobey / .gitattributes
Last active November 4, 2022 08:57
Git to diff zip (or any compressed) files. See this (https://tante.cc/2010/06/23/managing-zip-based-file-formats-in-git/) article.
*.[7z,xz,bzip2,gzip,tar,zip,wim,ar,arj,cab,chm,cpio,cramfs,dmg,ext,fat,gpt,hfs,ihex,iso,lzh,lzma,mbr,.msi,nsis,ntfs,qcow2,rar,rpm,squashfs,udf,uefi,vdi,vhd,vmdk,wim,xar,z] diff=archive
@smcveigh-phunware
smcveigh-phunware / test_mongodb_examples.py
Last active January 20, 2022 02:06
Test Shapely with MongoDB GeoJSON examples
#!/usr/bin/env python
# -*- coding: utf-8 -*
import pytest
import typing as typ
import pymongo as pm
import mongoengine as me
import shapely.geometry as geo
@dshoreman
dshoreman / slurp.md
Last active July 1, 2024 12:19
Swaymsg commands for listing windows and outputs

i3

Get Active Window ID

xdotool getactivewindow

Get Current Desktop ID

xdotool get_desktop_for_window "$(xdotool getactivewindow)"
@s3rj1k
s3rj1k / HowTo
Last active July 22, 2024 14:19
Ubuntu 20.04.3 AutoInstall
# For recent versions of Ubuntu:
- https://www.pugetsystems.com/labs/hpc/ubuntu-22-04-server-autoinstall-iso/
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
@santiagobasulto
santiagobasulto / server.py
Created April 4, 2021 13:21
A Python 3 debugging server based on http.server that logs every request. Use it to inspect incoming connections.
import time
from functools import partialmethod
from http.server import BaseHTTPRequestHandler, HTTPServer
import utils
class Request:
def __init__(self, method, path, headers, stream):
self.path = path
self.method = method.upper()
@kralicky
kralicky / harvester-gpu.md
Last active May 9, 2024 03:33
Harvester GPU Provisioning

Harvester GPU Provisioning

  1. Install Harvester, then SSH into the server.

  2. Edit /boot/grub/grub.cfg as follows:

 set default=0
 set timeout=10
 
blueprint:
name: ZHA - Moes Smart Knob for lights
description: 'Control lights with a Moes Smart Knob.
You can set functions for a single press. This allows you to assign,
e.g., a scene or anything else.
Rotating left/right will change the brightness smoothly of the selected light.
Not all functionality of the device is available at time of writing, e.g. double press, long press and press and rotate.'
@rosswf
rosswf / k3s.md
Last active July 10, 2024 12:24
Deploy HA k3s with kube-vip and MetalLB using k3sup

Prerequisites

kubectl

Install the required tools for deploying and controlling k3s.

Installation Docs:

# Download
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"