Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
# http://linuxcommand.org/wss0150.php
function error_exit
{
echo "$1" 1>&2
exit 1
}
# http://unix.stackexchange.com/questions/70859/why-doesnt-sudo-su-in-a-shell-script-run-the-rest-of-the-script-as-root
@yorickdowne
yorickdowne / README.md
Last active April 11, 2023 08:31
Verify a public GPG signature - example Lighthouse

Eh?

So a FOSS project might have signed releases with a GPG sig. How do you verify it on a Linux machine?

Example sigp/lighthouse, but same idea for any project.

Install gpg: sudo apt install gpg

Grab their PGP key ID from their download page and gpg --keyserver pgp.mit.edu --recv THEIRKEYID and wait

@yorickdowne
yorickdowne / eth-docker-audit.md
Created November 13, 2022 14:07
Eth-docker audit notes

eth-docker informal specification

User behavior and threat model

A typical user of eth-docker is someone who wants to become a validator on the Ethereum network, also known as staking or staker, or someone who is already a validator on the Ethereum network and wants to add more validators to their setup. They can be someone who is going to setup their machine at home, someone who is going to use some kind of VPS to host their setup, or some kind of institutional staker working for large staking services or large investors.

eth-docker is an automation wrapper to run an "Ethereum node", consisting of a consensus layer client, execution layer client, and validator client.

@yorickdowne
yorickdowne / TRIMmed.md
Last active September 14, 2023 10:42
Move Dell server from hardware RAID to software RAID

Overview

I was looking after a Dell PowerEdge R420 server with a hardware RAID card in it, a PERC8 H710P Mini. Connected to this were two WD Blue 3D NAND SATA SSDs in RAID-1, that were handling a write-intensive database: Geth, in this case.

After 11 months of running without problems, I had reason to "resync" Geth, and the server could not keep up with the required IOPS. Symptoms were Database compacting, degraded performance messages for hours, without recovery, and read/write latency in excess of 20/70ms, as measured by sudo iostat -mdx and its r_await and w_await data.

The cause of this was that the RAID controller does not support TRIM on the SSD, and the SSD's performance degraded over time because of it.

@yorickdowne
yorickdowne / README.md
Last active March 11, 2024 18:20
How to resize a netcup VPS disk after contract upgrade

Resizing a netcup VPS disk after upgrading the contract to a bigger one

From Server Control Panel

Boot rescue image

  • Change boot order to network first: Settings -> Boot Order, Save
  • Control -> Shutdown. Use Forced Poweroff if Shutdown doesn't work.
  • Boot into rescue system: Media, "Rescue System" tab, Enable Rescue System. Take note of root pw
  • Control -> Start
@yorickdowne
yorickdowne / GethBEHAVE.md
Last active March 13, 2024 01:10
Pruning Geth 1.10.x, 1.11.x, 1.12.x

Note: PBSS in Geth >=1.13.0 removes the need to prune manually.


Old content for reference

Overview

Geth (Go-Ethereum) as of July 2022 takes about 650 GiB of space on a fast/snap sync, and then grows by ~ 14 GiB/week with default cache, ~ 8 GiB/week with more cache.

@yorickdowne
yorickdowne / Besu Bebop.md
Last active March 31, 2024 16:05
Optimal Besu settings for database growth

Overview

Besu, an Ethereum execution layer client, can be optimized for minimal database growth (7-8 GiB/week), and for block processing speed.

The relevant parameter is --Xbonsai-limit-trie-logs-enabled=true

If you have 64 GiB of RAM or more, you can also add --Xplugin-rocksdb-high-spec-enabled=true for even better performance.

A long-running Besu DB will have sizeable trie log storage. This can be reduced with a one-off prune using the

@yorickdowne
yorickdowne / yawn.md
Last active April 8, 2024 14:44
Debian 12 bookworm upgrade

Debian 12

To start, read the official release notes.

If your install fits into "vanilla Debian plus maybe a handful of 3rd-party repos", then this guide for a simple upgrade to Debian 12 "bookworm" from Debian 11 "bullseye" can be helpful. 3rd-party repos are handled with a find command.

Note upgrade is only supported from Debian 11 to Debian 12. If you are on Debian 10, upgrade to Debian 11 first and make sure to change the security repo as per the release notes. Then once on Debian 11, you can upgrade to Debian 12.

  • Check free disk space
@yorickdowne
yorickdowne / friday.md
Last active April 8, 2024 15:02
Debian 13 trixie upgrade

Debian 13

This has not been tested, and is a placeholder for instructions when Debian 13 is released in 2025

To start, read the official release notes.

If your install fits into "vanilla Debian plus maybe a handful of 3rd-party repos", then this guide for a simple upgrade to Debian 13 "trixie" from Debian 12 "bookworm" can be helpful. 3rd-party repos are handled with a find command.

Note upgrade is only supported from Debian 12 to Debian 13. If you are on Debian 11, upgrade to Debian 12 first. Then once on Debian 12, you can upgrade to Debian 13.

@yorickdowne
yorickdowne / noble.md
Last active April 24, 2024 10:52
Ubuntu Noble Numbat

Ubuntu Noble Numbat

This is a placeholder for the 15th August 2024 release of Ubuntu 24.04.1

To start, read the official release notes.

If your install fits into "vanilla Ubuntu plus maybe a handful of 3rd-party repos", then this guide for a simple upgrade to Ubuntu 24.04 "Noble Numbat" from Ubuntu 22.04 "Jammy Jellyfish" can be helpful. 3rd-party repos are handled with a find command.