Skip to content

Instantly share code, notes, and snippets.

View mgerdts's full-sized avatar

Mike Gerdts mgerdts

View GitHub Profile
@mgerdts
mgerdts / illumos-to-linux.md
Last active September 18, 2020 10:38
illumos to Linux observations

These are initially notes to myself about the things I had to look up while taking on a Linux project after a taking a decade or two hiatus from Linux to focus on Solaris, SmartOS, and illumos. Following my footsteps may find this useful.

systemd

This is the init system replacement, like SMF was for Solaris.

Equivalent of svcs

# systemctl list-unit-files
@mgerdts
mgerdts / README.md
Last active January 29, 2020 20:13
Colapse Confirmed

Collapse Confirmed

This user script may be used with Tamper Monkey or similar to add a "Collapsed Confirmed" button to github pull requests.

Why is this needed?

I have observed:

  • Large PRs can generate hundreds of comment threads.
  • There is no good for the submitter to mark "ok, I've done the work" and for the commenter to say "yep, looks good now".
@mgerdts
mgerdts / chainload.md
Created February 12, 2020 21:19
ipxe chainload from qemu built-in to Joyent

I have a box running Fedora, which runs a bunch of VMs. I want to iPXE boot using a larger ipxe script than is allowed by the ipxe that is embedded in qemu's virtual nic. That is, a VM is booting with iPXE but not the right ipxe.

Let's consider two VMs, debian10 and debian-live-ipxe. The DHCP server is running debian10, the other is pxe booting.

The procedure followed is roughly:

Grab the .tar.gz from the manta directory mentioned by /Joyent_Dev/public/builds/ipxe/master-latest.

Copy boot/undionly.kpxe from that archive to /tftpboot/.

@mgerdts
mgerdts / README.md
Last active February 19, 2020 15:56

This records my configuration of a host used for Linux CN development. The host is a relatively current Intel box with 64 GiB of RAM. It is running Fedora 30.

Virtualization on the host

QEMU/KVM

I had initially gone down the route of using QEMU/KVM and this worked pretty well except:

  • SmartOS CNs were unable to run bhyve instances. This is problematic for testing unrelated to the Linux CN project.
  • debian-live CNs were unable to use MACVLAN in their nspawn configuration to bridge to my office network. Watching traffic generated by the container using MACVLAN, I could see that DHCP requests would make it to the DHCP server. The responses were seen on the Fedora 30 host but not in the debian-live guest. No amount of mucking about or googling lead to a solution.

This describes Mike Gerdts' suggestion for how to complete the work on OS-6632. It is an expansion of this comment.

Overview

The OS-6632 branch has a prototype fix that demonstrates that it is possible for the guest to recognize disk size changes when a zvol changes size. To detect the size change, the bhyve process has an mevent that fstat()s each virtio-blk device

X-Gmail-Received: cd1f5334be7e07c5ae660415a92dd8d7db52e9a8
Delivered-To: mgerdts@gmail.com
Received: by 10.90.82.20 with SMTP id f20cs699047agb;
Mon, 11 Sep 2006 16:46:36 -0700 (PDT)
Received: by 10.70.46.1 with SMTP id t1mr7121092wxt;
Mon, 11 Sep 2006 16:46:15 -0700 (PDT)
Return-Path: <zfs-discuss-bounces@opensolaris.org>
Received: from mail.opensolaris.org (oss-mail1.opensolaris.org [72.5.123.71])
by mx.gmail.com with ESMTP id h18si9496273wxd.2006.09.11.16.46.08;
Mon, 11 Sep 2006 16:46:15 -0700 (PDT)

Blobstore External Snapshots Design {#blob_esnap_design}

Terminology

External snapshots provide a way for a blob to be a clone of storage that exists outside of the blobstore. This document describes the design of this feature.

This originally appeared in this slack message.

I've implemented your latest suggestions, which I think will work out ok. I'll push to gerrit shortly. I also hacked up a version to compare mutex and spinlock performance. With each thread taking the lock 50,000 times, the mutex takes 4% longer (non-debug, no asan, no ubsan) when the threads get fair access to the lock.

Starting test contend_spin
  Worker    Delay  Wait us  Hold us Total us
       0        3   251971   153829   405801
       1        5   151200   253713   404914
PASS test contend_spin
@mgerdts
mgerdts / pathodon.md
Created November 25, 2022 05:32
Pathodon idea

Pathodon

This is a proposal for a social network optimized for hiking, walking, trekking and other forms of ambling through nature. It is intended to be a participant in ActivityPub Fediverse. In particular, things shared on Pathodon should look great on Mastodon and Mastodon users should be able to interact with Pathodon users as naturally as they the interact with other Mastodon users.

The key things that set Pathodon apart from Mastodon are:

  • Support GPS traces (e.g. GPX) to let others know about trails and to be able to follow others in a very literal sense.
  • Encourage the use of consistent, geographically significant hashtags for meaningful follows.
  • Geographic search to find recent activity in a region of interest
  • Use of OpenStreetMap (OSM) and curation of trails and related OSM data.
@mgerdts
mgerdts / README.md
Created January 23, 2023 18:29
Prevent accidental squash during merge fixup

I've found that git rebase -i $some_commit and adding break lines is very handy for fixing up things in an earlier commits. I then sometimes use x ./check after each subsequent commit to quickly identify any breakage in the commit where it happens.

After each fixup due to break or x, I need to run:

git commit --amend -a
git rebase --continue

If the rebase stops because there is a merge conflict that I need to fix, the proper thing to do is: