Skip to content

Instantly share code, notes, and snippets.

@dsully
dsully / png-info.py
Created April 4, 2023 13:15
Script to pull PNG Info from Stable Diffusion generated images.
#!/usr/bin/env python3
import click
import json
from PIL import Image
@click.command()
@click.argument("filename")
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd073]
[ 0.000000] Linux version 4.19.152-al-linux-v10.2.0-v1.10.0-13.3677-0ebe4e7 (builder@xenial-builder) (gcc version 6.4.0 (Buildroot 0.9.0.0)) #1 SMP Wed Jun 9 10:49:47 UTC 2021
[ 0.000000] Machine model: Annapurna Labs Alpine V2 UBNT
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] On node 0 totalpages: 1048575
[ 0.000000] DMA32 zone: 12288 pages used for memmap
[ 0.000000] DMA32 zone: 0 pages reserved
[ 0.000000] DMA32 zone: 786431 pages, LIFO batch:63
[ 0.000000] Normal zone: 4096 pages used for memmap
@dsully
dsully / bootstrap-osx
Created September 3, 2018 04:33
Script to bring up a new Mac
#!/bin/bash
PACKAGES=(
clipper
cloc
direnv
direnv
dnstracer
fd
git
/Users/dsully/Library/PreferencePanes/Choosy.prefPane/Contents/Resources/Choosy.app 465G 367G 98G 79% /private/var/folders/51/7sc4znjd4kd2lfqjb50jt_hw0003dm/T/AppTranslocation/0E50FB75-BDEF-4115-8025-4FB34894D2C7
class ConnectionRefusedCacheControlAdapter(CacheControlAdapter):
def send(self, request, **kw):
try:
resp = super(ConnectionRefusedCacheControlAdapter, self).send(request, **kw)
except Exception as e:
cache_url = self.controller.cache_url(request.url)
cache_data = self.controller.cache.get(cache_url)
cached_response = self.controller.serializer.loads(request, cache_data)
@dsully
dsully / generate-radiora2-config
Last active November 19, 2016 21:06
Generate JSON config suitable for use with homebridge-radiora
#!/usr/bin/env python3
"""
Generate JSON config suitable for use with homebridge-radiora:
https://github.com/djMax/homebridge-radiora/
Copyright 2016 Dan Sully
MIT Licensed.
"""

Keybase proof

I hereby claim:

  • I am dsully on github.
  • I am dsully (https://keybase.io/dsully) on keybase.
  • I have a public key whose fingerprint is 7DCA 4D76 6546 BD3E D36B 1F65 2B5D 0950 ABBB 7983

To claim this, I am signing this object:

As for the issues, the LEDs are electronically driven by a ballast/driver.
The challenge is in sending a signal to the driver that it can understand
and this manipulate it's load properly. Sometimes the unlatching of a triac
can be misinterpreted as a voltage fluctuation and, if the driver sees
voltage input changes as an indication to vary the output intensity, the
driver will change the lamps light level quickly only to go back to the
normal level as the triac latches again and begins to conduct. This is an
effect known as shimmering. FETs are more desirable in these instances but
the real issue is that no two drivers are really the same. Some are
perfectly ok with triac based, forward phase dimmers.