Skip to content

Instantly share code, notes, and snippets.

View bretton's full-sized avatar

bretton bretton

  • Cape Town, South Africa
View GitHub Profile
@bretton
bretton / repair-dude.md
Last active April 25, 2024 08:24
Repair Mikrotik Dude database

If you run a Mikrotik Dude instance on CHR, have a lot of devices and years of activity, problems start to arise with errors like:

server status: db failure: disk image is malformed. stop
server status: db failure: database disk image is malformed. stop

The problem might temporarily be resolved by running

#!/bin/bash
@bretton
bretton / inbound-liquidity-ln.md
Last active April 5, 2024 17:38
How to get Inbound Liquidity on the Lightning Network

How to get Inbound Liquidity on the Lightning Network

There are several ways you can find inbound liquidity on LN.

1. Wait

If your node is up 24x7 and you have some outgoing channels, the network will connect to you if you simply wait.

However, it might take a couple of weeks to get a significant amount of incoming liquidity, and ideally you want your outgoing liquidity to match too.

@bretton
bretton / forex-scrape.md
Last active March 19, 2024 19:36
Scraping Forex Data

Scraping Forex Data

I was looking for ways to scrape forex data after fixer.io switched to a subscription model with rate-limiting, making their API useless for lots of queries.

1. Use an alternative API

One alternative API which is still free is https://exchangeratesapi.io/

It's basically a drop-in replacement for fixer.io and can be used to get all forex rates in json format at

@bretton
bretton / self-hosted-ai.md
Last active January 5, 2024 11:05
Self-hosted AI toolsets

Self-hosted AI toolsets

TabbyML is a self-hosted AI coding assistant, offering an open-source and on-premises alternative to GitHub Copilot.

jan.ai is a self-hosted tool to run different LLMs. github releases

Apple's mlx is an array framework for machine learning on Apple silicon

AUTOMATIC1111's Stable Diffusion web UI is a browser interface for Stable Diffusion.

@bretton
bretton / lightning-maps.md
Last active December 29, 2023 02:59
Visualisers of the Lightning Network (and some other explorers)

A (mostly) visual collection of the Lightning Network

Disclaimer

Network views tend to be the view of the network from a single node, or small selection of nodes. They are not complete views of the network. This is impossible to achieve. Even if many node views were combined, it would still be incomplete.

These network views, or network maps, have been termed 'visualisers' by the LN community.

Screenshots may reflect older visual styles, and are dated accordingly.

@bretton
bretton / merge-ant-network-theory.md
Last active December 17, 2023 19:03
Merging Actor-Network Theory with Network Graph Theory for the purposes of Regulatory engagement

Merging Actor-Network Theory with Network Graph Theory for the purposes of Regulatory engagement

Actor-Network Theory

ANT holds that social forces do not exist in themselves, and therefore cannot
be used to explain social phenomena. Instead, strictly empirical analysis
should be undertaken to "describe" rather than "explain" social activity.
Only after this can one introduce the concept of social forces, and only as
an abstract theoretical concept, not something which genuinely exists in the
world. The fundamental aim of ANT is to explore how networks are built or
assembled and maintained to achieve a specific objective.
@bretton
bretton / haproxy-sni.md
Last active December 6, 2023 20:39
haproxy SNI configuration with SSL pass through

This comes from this forum post and adapted with info from this gist

A sample HAproxy configuration using SNI. Using SNI has the advantage that you don't have to mess with the certificates on the HAproxy server itself. Useful with many servers and / or many fast-expiring certificates (letsencrypt).

global
        maxconn         5000
        ulimit-n        16384
        log             127.0.0.1 local0
        uid             99
@bretton
bretton / apple-m2-qemu-libvirt.md
Last active September 10, 2023 21:50
Virtual machines on Apple M2 chips, with Ventura

Virtual machines on Apple M2 chips, with Ventura

Version

This is version 0.1

Requirements

I want to run VMs with custom networking over a bridge.

@bretton
bretton / unix-disk-usage-tools.md
Last active September 3, 2023 17:33
Unix Disk Usage Tools
@bretton
bretton / README.md
Last active July 5, 2023 01:16 — forked from tyzbit/README.md
The Lightning Network (Testnet)

Forked from vasturiano, with dataset and minor other changes.

Forked from tyzbit, with new dataset from four hosts, initial jq combine command added

Latest

The Lightning Network as seen from my three nodes, with tyzbit node, at about 22:00 UTC on Feb 20 2018. This data is updated manually when I feel like it.

view