Skip to content

Instantly share code, notes, and snippets.

@hacklschorsch
hacklschorsch / FileChangeNotifier.java
Last active July 15, 2019 22:12
Java observable that notifies on changes to a File using Java 7 NIO and a separate thread.
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.nio.file.*;
import java.util.Observable;
import static java.nio.file.StandardWatchEventKinds.*;
/**
* FileChangeNotifier notifies its observers when @file has changed.
* It uses Java 7 NIO and runs in a separate thread (since the NIO call blocks).
@hacklschorsch
hacklschorsch / Lightweight-Design-Template.md
Created December 20, 2024 01:10
Lightweight Design Template

Lightweight Design: Subject

The goal here is to do the minimum amount of design we can get away with while still making a quality product. Think of this as a tool to help define the problem, analyze solutions and share results. Feel free to skip sections that you don’t think are relevant (but say that you are doing so). Delete the bits in italics.

Contacts: The primary contacts for this spec.
Date: YYYY-MM-DD

Short description of feature. Consider clarifying by describing what it is not.

Rationale

@hacklschorsch
hacklschorsch / gist:16fbbf63a902b75e9112a4a7d0bfe29e
Created January 14, 2025 00:01
Tahoe log starting up and shutting down again
2025-01-13T23:50:18+0000 [twisted.scripts._twistd_unix.UnixAppLogger#info] twistd 24.7.0 (/nix/store/fpjwp47y9w44i2fx01dq9ywv3xhqsm9y-python3-tahoe-lafs/bin/python3.12 3.12.7) starting up.
2025-01-13T23:50:18+0000 [twisted.scripts._twistd_unix.UnixAppLogger#info] reactor class: twisted.internet.epollreactor.EPollReactor.
2025-01-13T23:50:34+0000 [-] Unable to write to plugin cache /nix/store/fpjwp47y9w44i2fx01dq9ywv3xhqsm9y-python3-tahoe-lafs/lib/python3.12/site-packages/twisted/plugins/dropin.cache: error number 30
2025-01-13T23:50:34+0000 [-] Foolscap logging initialized
2025-01-13T23:50:34+0000 [-] Note to developers: twistd.log does not receive very much.
2025-01-13T23:50:34+0000 [-] Use 'flogtool tail -c NODEDIR/private/logport.furl' instead
2025-01-13T23:50:34+0000 [-] and read docs/logging.rst
2025-01-13T23:50:34+0000 [-] Unable to write to plugin cache /nix/store/fpjwp47y9w44i2fx01dq9ywv3xhqsm9y-python3-tahoe-lafs/lib/python3.12/site-packages/twisted/plugins/dropin.cache: error number 30
2025-01-13T23