Some Cool Things

LEARN HTTP:
This is the best crash course I’ve seen for learning http at a deep and practical linux practioner level. I love that they are demoing how to pipe linux commands together to construct these requests and demonstrate how to make different classes of requests. If you are passionate about networking, this is an amazing read:
https://fasterthanli.me/articles/the-http-crash-course-nobody-asked-for
Accelerate Ansible Playbook Development
This is a Proof of Concept demo that is showing an application of a concept akin to Github’s copilot with Ansible. I spend a lot of time building ansible playbooks to do a thing. I’ve been thinking about how to tag & document useful playbooks. This demo is something I’ve been striving to create- but IBM has demo’d it faster:
https://research.ibm.com/blog/ai-for-code-project-wisdom-red-hat
Ansible: Saving Time by Locally Caching material
The BuilderHotspot can be used to save time building Single Board Computing firmware images where firmware components are installed using apt-get.
Downloading & compiling drivers can be painfully slow. I recently built a recipe for running a phony wifi network that spoofs common wifi SSIDs like “NETGEAR”. The solution relies on the AWUS036AH wifi adapter. These drivers aren’t available via apt- so I I need to download, configure, compile & install drivers. These activities add about 30 minutes to a firmware build- it would be advantageous to find some ways to speed this up.
We can reduce some time by:
- Saving the driver files locally on the builder hotspot
- pre-compiling them for target machines
- syncing them to the target
- then running make install on the target system.
I don’t want to package the drivers in the main recipe I publish- the drivers may be inappropriate for the target system- so I need a solution that will work for people generally.
I solved this problem by using some ansible conditionals.
I precompiled the rtl8812au drivers and stuck them in the Pi’ account’s home directory on the BuilderHotspot.
The logic of this playbook is:
If I have a rtl8812au in the home directory (discovered by stat’ing the location), register a variable called rtl8812au_config.
If the variable is defined, then I can use the synchronize step.
If the variable is not defined (because the directory was not identified), then we’ll go ahead and do a git clone- and in later steps, compile and install the drivers.
- name: Check for /home/pi/rtl8812au
delegate_to: localhost
stat:
path: /home/pi/rtl8812au
register: rtl8812au_config
tags:
- dual_nic
- catcher
- awus03ach_wifi
- name: Synchronization of files for rtl8812 wifi
synchronize:
src: "/home/pi/rtl8812au"
dest: /tmp/
when: rtl8812au_config is defined
tags:
- dual_nic
- catcher
- awus03ach_wifi
- name: Clone of rtl8812au drivers
ansible.builtin.git:
repo: https://github.com/aircrack-ng/rtl812au.git/
dest: /tmp
single_branch: yes
version: master
when: rtl8812au_config is undefined
tags:
- dual_nic
- catcher
- awus03ach_wifi
Configure dhcpcd to ignore wlan0
If you futz with multiple nics on a raspberry pi, at some point you will have to deal with disabling dhcp on a specific NIC. Here is some quick guidance on what to do:
Configure dhcpcd to ignore wlan0
dhcpcd is the linux dhcp client. dnsmasq is commonly used as a dhcp server. If you are doing something with both on the same client, you might have weird conditions where you are trying to set a static ip on the interface that is vending dhcp addresses. You’ll want to disable that interface from listening to the dhcp server.
Check /etc/network/interfaces; this should be empty except for an include from /etc/network/interfaces.d (which is in turn empty).
Edit /etc/dhcpcd.conf:
denyinterfaces wlan0
sudo systemctl restart dhcpcd.
No title necessary

BuilderHotspot //todos
Publish a repository of example recipes that includes:
- Marathon Wifi trap
- The Easiest Raspberry Pi Web Server
- Photo Sharing Solution
- Pcap on demand
- Recipe with universally valuable defaults for catching gotchas
- Unit Tests for validating a recipe
Update Default Recipe to address unnecessarily large journal logs (https://askubuntu.com/questions/1238214/big-var-log-journal)
edit /etc/systemd/journald.conf to Activate the SystemMaxUse= option there, e.g. as SystemMaxUse=100M to only use 100 MB.
Important advice

Advice on writing clearly
I’m frequently receiving requests for writing advice due to the clarity of my writing. I found an article on hackernews that resonates with me greatly. If persuasive writing is a skill you hope to develop, you should read this: http://www.covingtoninnovations.com/mc/WriteThinkLearn.pdf
In particular, the following ideas reflect a motivation I always try to capture in my writing:
“I’m not giving this presentation (or writing this paper) because I’m important. I’m doing it because you’re important.”
“I’m not going to demand that you put up with my quirks (bad spelling, bad organization, sloppiness [ME: Lolcat memes]). I’m going to package the information so that it enters your heads as easily as possible.”
Remembering that you are writing to help others seems to have a consistent impact-multiplier effect. I encourage you to be humble and consider how to invoke this motivation in your writing style.

Let’s canter
🏂

