Skip to content

Instantly share code, notes, and snippets.

@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 July 11, 2022 20:29
backdoor-image

backdoor-image

Description

backdoor-image can be used to easily add user with passwordless sudo access to a image or a root filesystem.

Operating on an image requires the 'mount-image-callback' tool from cloud-utils. That can be installed on ubuntu via apt-get install -qy cloud-image-utils.

@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 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
Last active May 1, 2022 09:48
Curtin install in a vm with tools/launch

curtin install with launch

Curtin has a test suite named vmtest. It has loads of configs for installation that put curtin through a battery. As of this writing it runs 192 installations on amd64 covering all supported ubuntu releases. It runs nightly under jenkins. See example results in the curtin-vmtest-devel-amd64 job.

If you're interested just a general use of curtin without starting a VM, see another article 'Curtin Development on uvt-kvm'.

@smoser
smoser / README.md
Last active March 8, 2022 20:07
bzr convert to git things (bzr2git)

converting bzr 2 git things

Bug 1606973 was my original file, and then changes to bzr export.

The patch was improved by some others, and I'm storing my version of it here.

Features

The benefit of the patch is that you get:

@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.