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 June 12, 2025 17:41
git bisect with melange package build

git bisect with melange package build

I spent some time debugging a change in melange behavior and put together a reproduce script. I wanted to save that knowledge off.

After putting together repro.sh, I was able to let git bisect tell me where the change came in.

In this gist there is some general knowledge on how to call melange with everything in place (as of today) and how to call git bisect.

@smoser
smoser / README.md
Last active May 23, 2025 09:56
apksql - populate sql database with apk data

apksql - populate sql database with apk data

@smoser
smoser / README.md
Last active March 17, 2025 16:28
example using go test to replace/wrap shell tests in tw

example go test wrapping or replacing shell tests in tw

tw has a 'gem-check' test.

The test is shell code that invokes ruby and looks at output.

I think we can use the functionality in 'go test' to replace a lot of the "shell test infrastructure".

'gem_test.go' here replaces the --require= functionality in seen there in gem-check.

@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 March 25, 2025 16:05
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

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 May 9, 2025 19:22
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