Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@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
Created June 28, 2022 18:07
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:

@smoser
smoser / README.md
Last active May 16, 2022 18:50
generate an esp image using dosfs tools

Creating an esp image is a pain. The gen-esp here tries to make it less painful.

Would like to use diskfs, but some things broke #132

@smoser
smoser / README.md
Created February 17, 2022 19:09
Boot Ubuntu maas kernel and initrd with cloud-init network seed.

Boot Ubuntu MAAS kernel, initrd and squashfs with cloud-init seed data.

The demo-it script here will do the following:

  • download kernel and initrd from published MAAS images
  • download the minimal squashfs image from cloud-images.ubuntu.com.
    We use the minimal image just because it is smaller than the maas provided ephemeral image. We could use that just as well.
  • create cloud-init 'user-data' and 'meta-data'
  • boot qemu with the provided kernel and initrd use the kernel command line to:
    • provide it with a 'rooturl` to the squashfs image
    • use overlayfs to give writable space
@smoser
smoser / README.md
Created February 7, 2022 22:32
xrdp server setup used for first robotics / wpilib

xrdp and lxc

This is a half-done attempt at making a rdp server in lxc. It was largely based on ubuntu-xrdp. I'm not sure all of the things are necessary, but the result is a functional xrdp server.

I did this to see if it is feasible to host remote development system for students.

At least one annoyance is that on linux you cannot install "for all users", so each user would end up with ~2.6G of ~/wpilib. That also manifests itself in updating dev tools.

build container

@smoser
smoser / README.md
Created January 31, 2022 20:58
Byting Irish Programming Assignment 2.

Byting Irish Programming Assignment number 2

The idea behind this is that students understand the interplay between commands and subsystems. Once the subsystems are well defined with RobotBuilder (i.e., we have all our parts), the primary work will be:

  • creating public methods that control the private subsystem components (e.g., ControllerGroup or PWMSparkMax) and
  • creating commands that (a) identify the subsystem(s) that they need (via a call to addRequirements) and (b) use the accessor methods in the subsystem class to make the robot do things. By creating lots of small, simple commands as "modules," we can then build up to more complex sequential or parallel commands for complex actions

Assignment number 1 has some information on setting up wpilib.

@smoser
smoser / README.md
Created January 28, 2022 22:17
apt talk in mdp format

apt talk

I gave this talk to some co-workers on 2022-01-18. It has some informaton on apt repository layout, general apt usage and some other bits and pieces.

I presented apt-talk.md with mdp, which is convienently installable in Ubuntu with apt.