Skip to content

Instantly share code, notes, and snippets.

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

@smoser
smoser / README.md
Created January 25, 2022 20:14
frc code layout doc

A command based architecture is one of the designs that FRC suggests (see the TimedRobot here and command based here).

CommandScheduler.java -- I don't think we need to touch this class, but it is at the core of a command-based design; commands may specify which subsystems they interact with, and the scheduler will never schedule more than one command requiring a given subsystem at a time.

RobotCointainer.java -- define/create subsystem and command fields/objects, bind controller buttons to commands, and specify commands for autonomous routine.

SubsytemsBase.java

@smoser
smoser / README.md
Created January 11, 2022 19:37
seed user-data and metadata from a directory with network config from nocloud seed.

Seed user-data, meta-data and network config from a directory in nocloud

A while back a collegue asked me for help. He was trying to seed nocloud data from the kernel command line. Below is how I tested the functionality using LXD.

start a "normal" lxc container

$ lxc launch ubuntu:focal test1
@smoser
smoser / README.md
Last active January 11, 2022 21:29
byting irish homework assignment 1

Byting Irish Programming Assignment 1.

This assignment will get a programming environment installed on your computer. That is the environment that we'll write code in to run and drive our robot. At the end of the assigment, hopefully you'll have the environment installed and ready to work, and have executed a Java program.

Install WPILib 2022

Install the WPILib application. This will install VSCode and WPILib libraries for Java and C++ development. Follow instructions in zero-to-robot/step-2.

Some things to note:

  • You do want to install VS Code, so use "Download for this computer only"
  • You do not need "Additional C++ Installation"
@smoser
smoser / README.md
Last active June 10, 2021 15:17
Using -proposed on Ubuntu selectively

Enabling and Selectively using Ubuntu -proposed.

Often times people will want to test a package from -proposed, but do not want the whole ball of wax.

This covers how you can selectively use -proposed.

It is based on the backports doc. But also mentioned in EnableProposed in the Ubuntu Wiki. I used 'priority' of 400 below. You can read more about priority in apt_preferences(5).

After doing this you can leave -proposed enabled and your 'dist-upgrade' will not pull from it.

@smoser
smoser / README.md
Last active April 30, 2021 19:08
firefox , java, flash in a container

Flash, Java and Firefox in a functional container

Revisit the days of yesteryear by running unsupported and abandoned and security-vulnerability infested software. This will build a container with old enough versions of firefox, flash and java to all work together.

My purpose was to access a non-updated Cisco Integrated Management Controller (CIMC). Older versions used flash-only but required java plugin for KVM access.

It should be obvious to the reader that running out of date software might not be a good idea.

How to build

build the container

@smoser
smoser / README.md
Last active November 17, 2021 18:39
swtpm / libtpms notes

swtpm notes

Info on how to build/use swtpm and libtpms. Pretty good doc at swtpm wiki. Qemu page has good info also, including qemu command lines. Qemu tpm.

I have been maintaining a "swtpm ppa" at ppa:smoser/swtpm.

Debian/Ubuntu

libtpms and swtpm seem to be working their way into debian/ubuntu.

@smoser
smoser / README.md
Created September 23, 2020 17:35
git branch cleanup tool, for deleting local and remote branches

git-branch-cleanup

git-branch-cleanup basically just allows me to do housekeeping more easily on my many branches.