Skip to content

Instantly share code, notes, and snippets.

View cgwalters's full-sized avatar
👍
LGTM

Colin Walters cgwalters

👍
LGTM
View GitHub Profile
```
From d3ca224c4b7547b2cdfaa5808bc91cd74ffd1416 Mon Sep 17 00:00:00 2001
From: Colin Walters <[email protected]>
Date: Fri, 3 Apr 2020 21:23:03 +0000
Subject: [PATCH] wip
---
.../dracut/modules.d/20live/live-generator | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
```
[root@master-1 ~]# journalctl -u ignition-firstboot-complete │·····································································································
-- Logs begin at Thu 2020-05-28 12:55:35 UTC, end at Thu 2020-05-28 14:02:44 UTC. -- │·····································································································
May 28 12:57:45 localhost systemd[1]: Starting Mark boot complete... │·····································································································
May 28 12:57:45 localhost systemd[1]: Started Mark boot complete. │··························
@cgwalters
cgwalters / bashoverflow.md
Created October 1, 2020 15:29
bash stackoverflow
$ cat /tmp/foo.sh 
#!/bin/bash
foo() {
    foo
}
foo
$ bash /tmp/foo.sh
fish: 'bash /tmp/foo.sh' terminated by signal SIGSEGV (Address boundary error)
$
```
In src/cmd-fetch line 112:
prepare_compose_overlays ${IGNORE_COSA_OVERRIDES_ARG}
^--------------------------^ SC2086: Double quote to prevent globbing and word splitting.
```
```
$ diff --git a/go.mod b/go.mod
index b11051831..eafa9ed83 100644
--- a/go.mod
+++ b/go.mod
@@ -20,6 +20,7 @@ require (
github.com/c4milo/gotoolkit v0.0.0-20190525173301-67483a18c17a // indirect
github.com/clarketm/json v1.14.1
github.com/containers/image v3.0.2+incompatible
+ github.com/coreos/ign-converter v0.0.0-20200918193805-44d462f1c700
walters@toolbox /v/s/w/s/g/c/coreos-assembler (master)> make
cd tools && make
cd mantle && make
cd gangplank && make
make[1]: Entering directory '/var/srv/walters/src/github/coreos/coreos-assembler/tools'
mkdir -p bin
make[1]: Entering directory '/var/srv/walters/src/github/coreos/coreos-assembler/mantle'
make[1]: Entering directory '/var/srv/walters/src/github/coreos/coreos-assembler/gangplank'
./build cmd/*
```
$ ostree pull fedora:fedora/33/x86_64/silverblue
...
$ ostree show fedora:fedora/33/x86_64/silverblue
commit 3d0853ae8e01ac1a168abc4f101e875e2dbee4ebe22a8f18ce2d507cb5e08903
Parent: b6234daf046fcc44cdfa1b49a40ea0a538e1970905256e60477c03eb6b6b11c2
ContentChecksum: fb8c0e9f0c615228b1103ae7d1de29d25f2cb1c4239593cd272236002e9a60bc
Date: 2021-03-28 00:47:34 +0000
Version: 33.20210328.0
...
$ ostree-ext-cli container export-oci --repo=/var/srv/walters/builds/fcos/tmp/repo fedora/x86_64/coreos/testing-devel tmp/fcos-oci
$ ll tmp/fcos-oci/
total 8.0K
drwxr-xr-x. 1 walters walters 12 Apr 12 13:59 blobs
-rw-r--r--. 1 walters walters 235 Apr 12 14:00 index.json
-rw-r--r--. 1 walters walters 30 Apr 12 13:59 oci-layout
$ ll tmp/fcos-oci/blobs/sha256/
total 709M
-rw-r--r--. 1 walters walters 350 Apr 12 14:00 2577566f24e885356203c0f010bc39371bf968d6d4f1b5f77b010a3be4c47f62
-rw-r--r--. 1 walters walters 709M Apr 12 14:00 661e87aeae95f660663bce7539ad3386cecd787b01f960ce6e20e3b90c372128
```
i-0d6e35c1d2e95d53d 520064] device-mapper: uevent: version 1.0.3
[ 5.525869] device-mapper: ioctl: 4.42.0-ioctl (2020-02-27) initialised: [email protected]
[ OK ] Started dracut pre-udev hook.
Starting udev Kernel Device Manager...[ 5.593109] systemd[1]: Started dracut pre-udev hook.
[ 5.599877] systemd[1]: Starting udev Kernel Device Manager...
[ OK ] Started udev Kernel Device Manager.
Starting dracut pre-trigger hook...
[ 5.895121] systemd[1]: Started udev Kernel Device Manager.
@cgwalters
cgwalters / tarthread.py
Created May 7, 2021 15:06
Python and threading don't mix
#!/usr/bin/python3
# Write to a tarball from multiple threads to demonstrate corruption.
import tarfile, threading, io
N_THREADS = 8
def append_tar(tarf, val):
tf = tarfile.TarInfo(name="{}".format(val))
# Generate an entry with the unique byte