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 19, 2023 17:08
building and testing lvm2 package with autopkgtest

building and testing lvm2 package

I'm working with lvm2 package in order to get some autopkgtest tests run on ubuntu before merging.

I've submitted a pull request to debian at lvm2/#6.

My post to the linux-lvm2 mailing list asking about stability of the tests can be seen here.

building lvm2

lvm2 in debian uses gbp to build. Changes are made directly to the source and a debian delta patch is generated (debian/source/format shows 3.0 (gitarchive)).

@smoser
smoser / README.md
Last active February 21, 2023 18:08
[fosdem 2023 talk] oci images in squashfs format with dm-verity

Fosdem 2023 Talk on use of squashfs in oci images

@smoser
smoser / README.md
Last active January 18, 2023 14:53
raspberry pi in qemu / Romi emulation

Raspberry pi / Romi in qemu

When working with photonvision and without a romi in front of me, I decided to give qemu a try.

It works, but it is very slow.

See the 'boot' script provided for booting.

Getting Romi 2023 image going.

Romi notes

  • system reboots twice before staying up
@smoser
smoser / README.md
Last active April 26, 2023 23:34
Running zot config and such

I run a local zot for use with stacker.

It is very useful to be able to publish oci images. It also can improve performance by acting as a caching proxy. See sync extension. This is especially useful due to docker.io's low bandwidth limits.

Quick start

To use this for localhost:

  • Download a zot from releases and make it executable (chmod 755 zot)
@smoser
smoser / README.md
Last active March 11, 2024 09:05
suspend-then-hibernate and ubuntu 22.04

suspend-then-hibernate on Ubuntu 22.04

Recently I have had the opportunity/necessity to use Windows for a bit. Windows, expecially with WSL (Windows Subsystem for Linux) is much better than it used to be. One thing that I really liked was "susped to hibernate".

When closing the lid on the laptop, the system would suspend, and then after some time it would power off. This is really nice behavior for someone who often comes to find a laptop they've suspended a couple days ago and that they have no power.

So... How to do that on linux? Specifically Ubuntu 22.04

@smoser
smoser / HelloWorld.efi
Last active May 26, 2023 12:08
demonstrate Ubuntu 22.04 (jammy) problem signing efi applications with snakeoil vars (uefi ovmf) including gen-esp
@smoser
smoser / README.md
Last active May 22, 2024 12:59
subprocess python wrapper named 'subp'.

subp - a python subprocess wrapper

This is just a wrapper around python subprocess that I like to use. It originated during cloud-init development.

Some things that I like about it:

  • SubpResult prints well.
  • times how long subpocesses take, that is available in the SubpResult.
  • takes a timeout and a signal to send to the subprocess. The python standard library will only ever send SIGKILL which does not give the process time to cleanup.
@smoser
smoser / README.md
Created June 27, 2022 18:42
Simple test of using ginkgo test suite with go

Example ginkgo test

Setup

Setup for this was like:

$ mkdir superdude
$ cd superdude
$ go mod init example.com/superdude
$ go get -u github.com/onsi/ginkgo/v2

$ go get -u "github.com/onsi/gomega"

@smoser
smoser / README.md
Last active August 31, 2022 15:44
A deb upload client for artifactory

deb-artifactory - publish a deb to artifactory

This is an example client to upload debs to artifactory.

Example usage is pretty simple:

$ export ARTIFACTORY_CREDS=AKCp.........BuV
$ ./deb-artifactory https://smoser0.jfrog.io/artifactory/test1 my.deb

Things this does:

@smoser
smoser / README.md
Last active August 2, 2022 18:30
test kernel and initrd boot with cirros

Minimal initramfs

If you are playing around with qemu, sometimes it is useful to have a kernel and initrd easily available to play with. Cirros provides kernel and initramfs that can be used for this purpose.

This init script here provides a initramfs /init that will do nothing but write the kernel command line and then power the system off. You can adjust it to your needs.

The get-krd script will: