Skip to content

Instantly share code, notes, and snippets.

View smoser's full-sized avatar

Scott Moser smoser

View GitHub Profile
@smoser
smoser / README.md
Last active February 5, 2025 03:43
usrmerge prototype of golang tool for wolfi

usrmerge tool

This is function for a usrMerge tool.

The goal is to call usrSbinMergeRoot with a target directory and it should apply a usrSbinMerge to the contents of that directory.

Plan to utilize

The plan for making usrMerge in wolfi was:

  1. setup things such that this tool can be called from a pipeline
@smoser
smoser / README.md
Last active January 23, 2025 14:52
virtio serial information hvc0, virtio-ports, ...

virtio serial information that I know

I played with virtio-serial today and don't want to lose the information that I had.

Here is an example of booting with multiple

   -chardev socket,wait=off,id=mychardev0,server=on,path=/tmp/.sock0
   -chardev socket,wait=off,id=mychardev1,server=on,path=/tmp/.sock1
   -device virtio-serial-pci
 -device virtserialport,name=smoser0,chardev=mychardev1
@smoser
smoser / README.md
Last active December 12, 2024 20:59
gotty and tmux - Easily share terminal screen in browser

Share your screen in a browser witih tmux and gotty

Gotty is really nice, allowing you to share your terminal in a browser.

I had never wanted to do that until I realized that the only thing I ever share in a video conference is:

  1. terminal
  2. browser window.

I don't share my whole screen, because I don't want you seeing the notifications of new cat videos on youtube and you probably would not appreciate the full 4880x2560 screen.

@smoser
smoser / README.md
Last active February 20, 2025 17:04
python editing melange yaml

editing melange yaml with python

Sometimes its helpful to edit lots of melange files quickly.

This is something that I used to do that.

notes

  • uses ruamel.yaml this is pretty good. I have seen one case where messed up roundtrip (py3-botocore.yaml)
  • running 'yam' afterwards fixed up more of the small differences with indentation.
@smoser
smoser / README.md
Last active December 12, 2024 16:09

chainctl token helper

This little helper just wraps calls to chainctl auth and reads token ttls.

On my workstation, I call it from ~/.profile like this:

is_interactive() {
    [ -t 0 ] && [ -t 1 ]
}
@smoser
smoser / README.md
Last active February 19, 2025 14:57
wolfi get file list and apk info

Random wolfi and tools.

  • get-archive-info - get a tar tvf output and the .APKINFO for every file in the archive.

  • build-stage - throw a bunch of files and see which build. they do not depend on each other (each only builds with the wolfi repo)

    I used this to help create batches of things when changing lots of files.

  • test-installable - its like the c-i test that checks that all packages

@smoser
smoser / README.md
Created June 28, 2024 21:40
find shell deps in a file or filesystem tree

find shell deps

The idea here is just to "parse" files to

  1. see if they are shell
  2. find the external commands/utilities that they use

A more advanced version of this would help identify dependencies.

there are bugs in the fs traversal and I'm not finding everything :-(.

example

@smoser
smoser / README.md
Last active November 7, 2024 19:17
get-sbom and sbom-to-manifest get-pkglist

get-sbom and sbom-to-manifest

Just a friendly wrapper for getting the sbom for an image.

$ ./get-sbom cgr.dev/chainguard/busybox:latest | ./sbom-to-manifest
alpine-baselayout-data	3.6.5-r0
alpine-keys	2.4-r1
alpine-release	3.20.0-r0
busybox	1.36.1-r29
ca-certificates-bundle	20240226-r0
@smoser
smoser / README.md
Created May 20, 2024 21:09
boot a tarball or oci image ref

boot a tarball or oci imag ref

Get yourself a kernel

# kernel from vmlinuz on ubuntu
kdist=/boot/$(uname -r)
# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725
sudo cat "$kdist" > kernel

Now convert a oci or local tarball to kernel flavor cpio. this script adds a very basic 'init'

@smoser
smoser / README.md
Created May 16, 2024 13:46
hello world simple melange yaml

This is a simple melange package file. It builds really quickly.

Build it in wolfi-dev/os with:

make hello-busybox

Build it directly with melange as:

melange build ./hello-busybox.yaml \