I had to rebuild VM recently, and I want to record what I did to get it to boot.
Continue readingCategory Archives: shell
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
Downloading from gitlab
We use gitlab to post internal releases of archives. I want to be able to automate the process of downloading these artifacts. Here it is using the glab CLI.
Continue readingSelecting a subset of files for ctags
I usually don’t want all of the files in the linux Kernel for my ctags. Sometimes I want a cvery small subset: a set of C files and the included header files.
Continue readingFind files to download from Apache default pages
Apache provides a pretty standard screen to display directoyr contents if you do not provide any mods. We post artifacts up to a local server that I later need to download. Here are my hacky notes using command line utilities. I probably will convert this to python next.
Continue readingI call it my ctaginator
The Linux Kernel source is too big to generate all tags for all files. I want only a subset of C files and the corresponding headers. Here is my first take at it. yes it is in python. The program is designed to be run from the root of the Linux Kernel tree.
Continue readingConverting a Shell Script to Python
We have a build system that has grown organically. It started as a shell script. We needed to run it from gitlab, so we wrote helper scripts to insulate our code from gitlab. Then we added some helper functions to mimic the gitlab interactions when working with them from the comand line. The helper functions grew until you could not practically run the original shell script without them.
It is a mess.
I want to refactor it.
Refactoring Shell is painful.
I want objects. I want python.
So I am rewriting the gitlab and functions layer in python with an eye to rewriting the whole thing. Here’s what I have learned;
Continue readingWhat Processor do I have?
dmidecode -t processor | grep Version
Version: Ampere(R) Altra(R) Processor
Version: Ampere(R) Altra(R) Processor
Fetching all packages from a Koji build
#bin/bash
KOJI_URL=https://kojipkgs.fedoraproject.org/packages/kernel/6.12.0/0.rc3.20241015giteca631b8fe80.32.eln143/aarch64/
curl $KOJI_URL > aarch64.dir.html
for PACKAGE in `xmllint --html --xpath "//html/body/pre/a/@href" aarch64.dir.html | awk -F\" 'NR % 2 == 0 { print $2 }' `;
do
URL=$KOJI_URL/$PACKAGE ;
echo $URL; wget $URL;
done
Modify the URL to fetch a different architecture, version, or package.
The version of xmllint I am running does not support fn:string. If it did, the “for PACKAGE” line can be redone as:
for PACKAGE in `xmllint --html --xpath "string(//html/body/pre/a/@href)" aarch64.dir.html` ;
Working with the Booked scheduler API
One benefit of working in a hardware company is that you actually have hardware. I have worked in software for a long time, and I have learned to appreciate when new servers are not such a scarce resource as to impact productivity. However, hardware in our group needs to be shared amongst a large group of developers, and constantly reserved, assigned, and reprovisioned. We use an install of the booked scheduler to reserve servers. As with many tools, I am most interested in using it in a scripted fashion. Booked comes with an API. Here’s some of the things I can do with it.
Continue reading