A fortnight with Codex

A Linux Kernel Enablement team has to produce at least one Linux Kernel. It turns out our team needs to produce 6. The two variables are page size and distribution. We support 4K, 16K, and 64 K page sizeds for internal testing, and people need to test both Fedora and Ubuntu based builds. When I started this project, we only supported Fedora; the Ubuntu support was one of the driving factors.

This project is called Ampack. I can thank Don Becker for showing me this style of naming back at Penguin.

I spent a good portion of last year reworking our build system from a series of bash scripts into a Python based system using plumbum and a lot of system utilities. Meanwhile, my native coding interest has been shifting to Rust, as we can use it in the Linux Kernel, in Qemu, and a bunch of other places. I was also getting frustrated with the lack of type support in Python…my code could be annotated with MyPy compliant types, but the same was not true for all the libraries I wanted to use.

So, as for the past couple weeks, I have been running a long-ish coding experiment: what would it mean if I used our officially blessed codex deployment to aid the conversion to Rust, and to continue development that way.

Continue reading →

Don’t call it boot camp.

Recruit rhymes with Boot. A Boot camp is for new recruits. Part of it is to help them break in, as if they were a new pair of boots, before sending them to the larger military organization. It is to provide a baseline for behavior.

Don’t call your orientation boot camp. It is insulting to both the people that went through an actual basic training, and to the professionals that come in with more than 6 months of experience.

Continue reading →

Find the IP address of a machine I just booted

I am booting VMs via qemu (no libvirt) and sometimes they don't tell me what IP address they got when booted.  To figure it out, considering I know the IP address, I can query the network via the Address Resolution Protocol (ARP)

I know they get address in sequence, so:


ayoung@sut11sys-r112:~/devel/ampvirt$ arp -n | grep -i "52:54:00:70:0c:"
10.76.112.154            ether   52:54:00:70:0c:02   C                     virbr0
10.76.112.153            ether   52:54:00:70:0c:04   C                     virbr0
10.76.112.155            ether   52:54:00:70:0c:03   C                     virbr0

Teaching Python using a Caesar Cipher


A Caesar cipher is a letter for letter exchange from a clear text to a encrypted text by shifting a set distance in the alphabet. Thus, if your set distance is 2, the letter A becomes C, the letter X becomes Z. To encrypt the last letters of the alphabet, you wrap around to the beginning, so Y becomes A and Z becomes B.

Caesar is commonly respelled to Ceasar, which I have done for this article. Use the spelling of your choice.

This is a fairly easy algorithm to code, and makes for a decent early class in python. Here are the steps I would go through to teach someone:

Continue reading →

Debugging Rust in Vim

On Fedora:

yum install termdebug

in ~/.vimrc

let g:termdebug_config = {}
let g:termdebug_config['command'] = 'rust-gdb'

packadd! termdebug
                   

Inside vim:

Termdebug target/debug<executable>

Use Ctrl-W DownArrow to switch between windows

Use :Break to set a breakpoint in the code window

Use Ctrl-W UpArrow to go to the gdb window

use run to run the program and cont to continue after hitting a break point.