Debian with Automated Snapper Rollbacks is a short tutorial about setting up a Debian linux system with automated BTRFS snapshots of the system and easy rollback to previous auto-generated snapshots. Once it's setup, it'll automatically take pre/post snapshots when you run `apt` and you can boot them from grub.
Monday, July 10. 2023
Debian Apt Btrfs Auto-Snapshot Retrofit
Wednesday, July 5. 2023
Restful Sleep Formula
There is a company called the 'Wellness Company'. They suggest the following natural ingredients, rather than using Melatonin for assistance with sleep:
- Passion Flower to relax and promote an easy start to your sleep routine.
- Rafuma Leaf stabilizes the mind and prepares it for restful sleep.
- Kava mitigates the impacts of stress as you wind down.
- Chamomile for its time-tested properties of providing a gentle calming effect on the brain and body.
- Valerian Root to help reduce anxiety.
- Ashwagandha Root to help regulate the negative impacts of daily stress on your immune system.
They are saying that the hormone-based supplement Melatonin has risks such as: sleep-wake cycle disruption, hormonal effects, drug interactions, dependence & tolerance, as well as purity concerns.
Tuesday, July 4. 2023
2023/07/04 Machine Learning
Intelligent Traffic Control with Smart Speed Bumps
Traffic congestion and safety continue to pose significant challenges in urban environments. In this paper, we introduce the Smart Speed Bump (SSBump), a novel traffic calming solution that leverages the Internet of Things (IoT) and innovative non-Newtonian fluid materials to enhance road safety, optimize emergency response times, and improve the overall driving experience. The SSBump uses IoT sensors to detect and communicate with emergency vehicles, reducing response times by temporarily deflating. These sensors also analyze traffic patterns and inform data-driven decisions. Additionally, the SSBump uses an Oobleck mixture that adapts its behavior based on the velocity of approaching vehicles, resulting in a safer and more comfortable experience for drivers. This study commences with an overview of the prevalent traffic congestion, followed by a discussion on various available options in this domain. Subsequently, the paper explores the advantages of smart speed bumps and their operational mechanisms. Finally, it presents a comprehensive analysis of the results, its challenges, and the prospects of the work. The findings of this research demonstrate the potential of the SSBump system to revolutionize traffic control, emergency response time, and the driving experience in smart cities, making it a game-changing innovation for advanced transportation systems.
Graph Neural Network based Log Anomaly Detection and Explanation
Event logs are widely used to record the status of high-tech systems, making log anomaly detection important for monitoring those systems. Most existing log anomaly detection methods take a log event count matrix or log event sequences as input, exploiting quantitative and/or sequential relationships between log events to detect anomalies. Unfortunately, only considering quantitative or sequential relationships may result in many false positives and/or false negatives. To alleviate this problem, we propose a graph-based method for unsupervised log anomaly detection, dubbed Logs2Graphs, which first converts event logs into attributed, directed, and weighted graphs, and then leverages graph neural networks to perform graph-level anomaly detection. Specifically, we introduce One-Class Digraph Inception Convolutional Networks, abbreviated as OCDiGCN, a novel graph neural network model for detecting graph-level anomalies in a collection of attributed, directed, and weighted graphs. By coupling the graph representation and anomaly detection steps, OCDiGCN can learn a representation that is especially suited for anomaly detection, resulting in a high detection accuracy. Importantly, for each identified anomaly, we additionally provide a small subset of nodes that play a crucial role in OCDiGCN's prediction as explanations, which can offer valuable cues for subsequent root cause diagnosis. Experiments on five benchmark datasets show that Logs2Graphs performs at least on par state-of-the-art log anomaly detection methods on simple datasets while largely outperforming state-of-the-art log anomaly detection methods on complicated datasets.
Effects of Explanation Specificity on Passengers in Autonomous Driving
The nature of explanations provided by an explainable AI algorithm has been a topic of interest in the explainable AI and human-computer interaction community. In this paper, we investigate the effects of natural language explanations' specificity on passengers in autonomous driving. We extended an existing data-driven tree-based explainer algorithm by adding a rule-based option for explanation generation. We generated auditory natural language explanations with different levels of specificity (abstract and specific) and tested these explanations in a within-subject user study (N=39) using an immersive physical driving simulation setup. Our results showed that both abstract and specific explanations had similar positive effects on passengers' perceived safety and the feeling of anxiety. However, the specific explanations influenced the desire of passengers to takeover driving control from the autonomous vehicle (AV), while the abstract explanations did not. We conclude that natural language auditory explanations are useful for passengers in autonomous driving, and their specificity levels could influence how much in-vehicle participants would wish to be in control of the driving activity.
Machine learning for potion development at Hogwarts
Machine learning for potion development at Hogwarts
Objective: To determine whether machine learning methods can generate useful potion recipes for research and teaching at Hogwarts School of Witchcraft and Wizardry. Design: Using deep neural networks to classify generated recipes into a standard drug classification system. Setting: Hogwarts School of Witchcraft and Wizardry. Data sources: 72 potion recipes from the Hogwarts curriculum, extracted from the Harry Potter Wiki. Results: Most generated recipes fall into the categories of psychoanaleptics and dermatologicals. The number of recipes predicted for each category reflected the number of training recipes. Predicted probabilities were often above 90% but some recipes were classified into 2 or more categories with similar probabilities which complicates anticipating the predicted effects. Conclusions: Machine learning powered methods are able to generate potentially useful potion recipes for teaching and research at Hogwarts. This corresponds to similar efforts in the non-magical world where such methods have been applied to identify potentially effective drug combinations.
Saturday, July 1. 2023
Linux: recover a rm'd file still open
I had an application running which had an open file it was actively using.
I accidentally performed an rm (remove) on the file rather than another I actually meant to remove.
Due to Linux's method of linking files, even though the directory entry link to the file was removed, the file is still open and has an additional link via the application process pseudo directory.
The process sub-directory is composed of the process id. The process id can be found with something like:
$ pidof BasketTrading 2663042
The deleted file can then be found with:
$ lsof -p 2663042 | grep deleted BasketTra 2663042 rpb 18u REG 0,46 2739200 29438986 /home/.../BasketTrading.db (deleted)
The 18u reflects the file descriptor used for the file. This can be used to perform a simple copy of the file to an alternate location. A link does not seem to fix it. You may want to complete any outstanding writes to the file first. But do not close it or the application. If you do, the file will be unrecoverable.
$ ls /proc/2663042/fd/18 /proc/2663042/fd/18
$ cp /proc/2663042/fd/18 /home/.../BasketTrading.db.rescue
Sunday, June 25. 2023
Kiosk Recovery
Here is an interesting note from Connor's Blog - an automatic reboot after kernel panic with the following sysctl setting:
$ sysctl -w kernel.panic=60
... or on the kernel command line:
The kernel reboots after 60 seconds. It might start a doom loop, but it is a potential way to get a remote system back up after a failure.panic=60
Tegra TK1
Yes, this is a very old device (back to 2017 or so). But I have a couple, and I need to keep a few reference notes to see if it is upgradeable.
- Linux for Tegra R21.8 found from Jetson Linux Archive -- shows a 3.10.40 version kernel with a 32 bit driver package -- pretty old, if only 32 bit.
- Installing Debian on nvidia Jetson TK1 - based on the Tegra K1 chip (also known as Tegra 124). The Tegra K1 (codenamed "Logan") features a quad-core 32-bit ARM Cortex-A15 CPU and Kepler GPU (GK20A) with 192 CUDA cores. The Jetson TK1 can run Debian's armhf port.
Friday, June 23. 2023
espressobin v5 notes
I picked up a zigbee controller and was going to attach it to me BeagleBoard. Zigbee2MQTT. Recent installs of Zigbee2MQTT require recent versions of node.js, which the latest BeagleBoard operating system can't quite yet supply.
I did have an espressobin sitting around. After reviewing it's capabilities, it looks feasible. But it needed an operating system update.
I needed to boot it up to see what flavour it is. A couple of startup notes:
- It requires more power than what the USB can provide, so even though there is a green light lit on the board when the USB cable is inserted, the power adapter must be connected as well.
- command to start a console: screen /dev/ttyUSB0 115200
- The startup text showed I had a version with 1G memory, 1000Mhz CPU, 800 Mhz memory
- The starting page with cryptic notes: Espressobin
- I first needed to reflash the boot loader. This required downloading from /dl/espressobin/u-boot with my boot file being flash-image-DDR3-1g_2cs_2-1000_800.bin and placing the file on a vfat SD
- booting up the espressobin, and starting the boot prompt, the boot flash could be installed with:
- bubt flash-image-DDR3-1g_2cs_2-1000_800.bin spi usb
- from my linux desktop, I downloaded Armbian Bookworm and imaged to an SD card with: sudo dd if=Downloads/Armbian_23.5.1_Espressobin_bookworm_current_5.15.113_minimal.img of=/dev/mmcblk0 bs=1M status=progress
- A reboot started Debian and entered in to the initial configuration process.
- a line in /etc/NetworkManager/conf.d/10-ignore-interfaces.conf needed to be commented out to be able to manage the interfaces (networking in this espressobin build may not be fully baked), and NetworkManager restarted
Espressobin Reference:
Continue reading "espressobin v5 notes" »systemd-networkd
References
- systemd-networkd - from archlinux, with reference to systemd-nspawn for container networking. -- interesting note: "it is possible to run Docker containers inside an unprivileged systemd-nspawn container with cgroups v2 enabled". But from an old talk:
- Creating containers with systemd-nspawn - It is targeted at "building, testing, debugging, and profiling", not at deployment. systemd-nspawn uses the same kernel APIs that the other two tools use, but is not a competitor to them because it is not targeted at running in a production environment.
NetworkManager - error - 'device is strictly unmanaged'
Gone are the good 'ole days of using /etc/network/interfaces to manage basic networking stack configurations. There seems to be an explosion of alternate ways, each stepping on each other's toes: /etc/network/interfaces, NetworkManager, NetPlan, systemd-networking, ...
A problem I had the other day was where a new installation of an espressobin had NetworkManager installed, no NetPlan, and some stuff in /etc/network/interfaces. Unfortunately, since NetworkManager controls the dhcp-client, the /etc/network/interfaces interface was not obtaining an address.
The solution was to edit /etc/NetworkManager/conf.d/10-ignore-interfaces.conf, and comment the following line:
[keyfile] #unmanaged-devices=interface-name:eth*,interface-name:wan*,interface-name:lan*,interface-name:br*
After 'sudo service NetworkManager restart', this solves the error of NetworkManager not being able to manage strictly unmanaged interfaces, which for the espressobin, are lan0, lan1, wan.
Some commands for NetworkManager:
- nmcli
- nmcli device show
- nmcli connection show
File locations:
- /etc/NetworkManager/system-connections/ - interface configurations
- /usr/share/doc/network-manager/README.Debian - notes about managed/unmanaged devices
Some references:
- Debian NetworkManager - mostly desktop?
- Debian NetworkConfiguration - nostly server?
- NetworkManager homepage
- nmcli - command-line tool for controlling NetworkManager
- NetworkManager.conf - NetworkManager configuration file
- NetworkManager - archlinux view of NetworkManager, with a section on VPN connectivity based upon profiles
Sunday, June 11. 2023
Stop VSCode from adding headers
Visual Studio Code, by default, when using the clangd language server, will automatically insert headers files for types which may have already been declared.
To disable this, go into the configuration options for clangd, and in 'clangd:arguments' add:
--header-insertion=never
Wednesday, June 7. 2023
dbus monitoring
It is always interesting looking at bug reports. They uncover interesting nooks and crannies of system tooling. In reading Debian Bug#1037194, there is a command for watching dbus:
$ sudo dbus-monitor --system
Thursday, June 1. 2023
Configuration for a Simple systemd Service
To keep locally generated systemd service files separate from distribution files (as an example):
$ sudo mkdir -p /usr/local/lib/systemd/system $ sudo vim /usr/local/lib/systemd/system/bme680.service $ sudo systemctl enable bme680 $ sudo systemctl daemon-reload $ sudo systemctl start bme680
An example systemd service file in /etc/systemd/system might look like:
[Unit] Description=BME680 Collector Documentation=https://github.com/rburkholder/bme680 After=network.target [Service] Type=simple User=debian WorkingDirectory=/home/debian Environment="ID=02" "LOCATION=top floor" ExecStart=/home/debian/bme680/build/bme680-mqtt ${ID} ${LOCATION} ExecReload=kill -HUP $MAINPID KillMode=process Restart=on-failure RestartSec=5s StandardOutput=null # note change with logrotate implemented, or to a memory file [Install] WantedBy=multi-user.target
The example from ecowitt2mqtt got me started - is a small CLI/web server that can receive data from Fine Offset weather stations (and their numerous white-labeled counterparts, like Ecowitt and Ambient Weather), adjust that data in numerous ways, and send it on to one or more MQTT brokers.
Reference to:
- systemd.service — Service unit configuration
- systemd.exec — Execution environment configuration - has list of expanded exit codes
Thursday, May 25. 2023
Other-Location Service Testing
Use these sites to test whether a service is up from other locations:
- https://testlocal.ly
- https://www.locasnap.com
- https://www.uptrends.com/tools/uptime
- https://www.site24x7.com/check-website-availability.html
And use these sites to ping/mtr from other locations (keeping in mind, of course, that some hosts block ping/mtr replies even when working normally):
Wednesday, May 24. 2023
Dynamic DNS
- dnsmadeeasy
- ddns rout53
- www.changeip.com
Wherever possible, we use RFC 2136, to the primary authoritative name server. pfSense firewalls, for example, support RFC 2136 for Dynamic DNS (tracking the WAN IP when DHCP changes it) and for Acme Certificates (demonstrate control of the FQDN). RFC 2136 is also a nice method for internal devices to get Let's Encrypt certs.
But you're not going to find RFC 2136 support very common. You probably won't find it on many NVR units or cheap Netgear routers.