Skip to content

Instantly share code, notes, and snippets.

Ghostty Keyboard Shortcuts

Default keyboard shortcuts for Ghostty terminal emulator. Platform-specific differences are noted where applicable.

Window Management

Action Windows/Linux macOS
New window Ctrl+Shift+N Cmd+N
Close window Alt+F4 Cmd+Shift+W
@yorickdowne
yorickdowne / HallOfBlame.md
Last active May 30, 2025 05:57
Great and less great SSDs for Ethereum nodes

Overview

Syncing an Ethereum node is largely reliant on latency and IOPS, I/O Per Second, of the storage. Budget SSDs will struggle to an extent, and some won't be able to sync at all. IOPS can roughly be used as proxy of / predictor for latency. Measuring latency directly is arguably better.

This document aims to snapshot some known good and known bad models.

The drive lists are ordered by interface and then by capacity and alphabetically by vendor name, not by preference. The lists are not exhaustive at all. @mwpastore linked a filterable spreadsheet in comments that has a far greater variety of drives and their characteristics. Filter it by DRAM yes, NAND Type TLC, Form Factor M.2, and desired capacity.

For size, 4TB is a very conservative choice. The smaller 2TB drive should last an Ethereum full node until at least sometime 2026, with [pre-merge history expiry](https://hackmd.io/@hBXHLw_9Qq2va4pRtI4bI

@hungdoansy
hungdoansy / main.ts
Created July 5, 2022 06:02
Call a contract method at a specific block using ethers.js
// Example of using ethers.js to interact with a smart contract
// Call a contract method at a specific block
// This example is to get rate of a token at a block
import { ethers } from "ethers"
import BigNumber from "bignumber.js"
// prettier-ignore
const oracleABI = '[{"inputs":[{"internalType":"contract MultiWrapper","name":"_multiWrapper","type":"address"},{"internalType":"contract IOracle[]","name":"existingOracles","type":"address[]"},{"internalType":"enum OffchainOracle.OracleType[]","name":"oracleTypes","type":"uint8[]"},{"internalType":"contract IERC20[]","name":"existingConnectors","type":"address[]"},{"internalType":"contract IERC20","name":"wBase","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IERC20","name":"connector","type":"address"}],"name":"ConnectorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IERC20","name":"connector","type":"address"}],"name":"
@wosc
wosc / README.md
Created July 8, 2021 07:49
Creating tracing data from an haproxy access log via fluent bit and opentelemetry collector

Creating opentelemetry tracing data from an haproxy access log

Approach

Unfortunately, otelcol currently has no receiver for logfiles that produces tracing data. There is log tailing functionality, and e.g. a fluent forward protocol receiver, but they all create "log" data, not tracing. I've seen this proof of concept to implement a forward receiver that creates tracing data, but that seems to have no traction and no relation to the upstream project at all (not even git history.

Thus, we've settled on this approach:

@mskyttner
mskyttner / duckdb-load.sh
Created February 14, 2021 20:07
Bash script to bulk load a tsv file into a duckdb database file
#!/bin/bash
# usage: ./duckdb-load.sh data.tsv duckdb tablename
# for example:
# ./duckdb-load.sh ark/hcaf_species_native.tsv duckdb_database hcaf_species_native
# TODO set pragma journal_mode=off or equiv settings
# if using .import and .sep '\t', an error appears:
# Error: multi-character column separators not allowed for import
@frank-dspeed
frank-dspeed / 2018-https-localhost.md
Last active February 4, 2025 17:41 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

Create a own domain (1-10 Domains No Wildcards)

edit /etc/hosts add my.

@mill1000
mill1000 / README.md
Last active May 10, 2025 08:02
Headless A2DP Audio Streaming on Raspbian Stretch

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date - As of December 2017. Written for Raspbian Stretch & Bluez 5.43

Prerequisites

@matthewzring
matthewzring / markdown-text-101.md
Last active June 3, 2025 20:36
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active June 2, 2025 03:37
Hyperlinks in Terminal Emulators