Thoughts on the Metric System: An Immigrant’s Perspective

I’ve long intended to write about the comparison between the metric and American measurement systems. It’s a topic that periodically resurfaces in American discourse, often sparking passionate debates about tradition versus global standardization. It’s fascinating to reflect on how my own attitude towards this debate has evolved. When I first arrived in America, I had to adapt to these unfamiliar measurements, and I initially resisted. “What’s with all these illogical units?” I thought. It wasn’t even the individual measures that bothered me most — after all, what’s inherently wrong with an inch, and how is a centimeter radically better? No, it was the seeming lack of logic in the system as a whole that irked me. Why are there 12 inches in a foot but three feet in a yard? And then 16 ounces in a pound? It all seemed arbitrary and inexplicable. ...

2024-08-08 · 5 min · 1062 words · Pavel Anni

Machine learning with matchboxes

I made my first machine learning project when I was 12. I used 24 matchboxes, 55 (give or take) cherry pits, gouache paint, paper, scissors, glue, and colored pencils. That was all I needed to start working with machine learning in the 1980s. My dad gave me a book by Martin Gardner describing a simple game and a machine for playing it. He called the game Hexapawn because it used just six pawns on a 3x3 board. ...

2024-05-26 · 7 min · 1325 words · Pavel Anni

How to monitor SSH logins?

I noticed that a friend of mine routinely logs into his lab servers via SSH using the root username and password. “Why do you do that?” I asked. “What’s wrong with that?” he said. “I know, I know, it’s not a good security practice, but I’m used to it. It’s just a lab server; what can go wrong? And also, all other ways are not that easy.” “‘What can go wrong?’” I said, “The famous last words!” “I’m not going to tell you horror stories. I just think that what you consider ’the most convenient way’ is not that convenient. There are other ways.” ...

2023-04-27 · 14 min · 2959 words · Pavel Anni

Project: SSH Login Monitor

Overview A Go program that monitors SSH login events in system logs, matches login/logout pairs, and identifies users by their SSH key fingerprints. The project demonstrates practical use of Go for system administration tasks and showcases how AI can assist in development. Features Parses /var/log/secure for SSH login events Matches login and logout events by port numbers Identifies users via SSH key fingerprints Calculates session durations Supports CSV-based user database Command-line argument support Comprehensive test coverage Technical Stack Platform Requirements Linux system with SSH server Access to system logs (/var/log/secure) Go runtime environment Software Components Go standard library github.com/spf13/pflag for command-line parsing Regular expressions for log parsing CSV handling for user database Implementation Details Log Parsing Regular expressions to extract: Timestamps IP addresses Port numbers SSH key fingerprints Login/logout events User Identification CSV database format: username,fingerprint Fingerprint matching for user identification Support for multiple users with different keys Session Tracking Port-based login/logout matching Duration calculation Source IP tracking Current Status Core functionality complete Command-line interface implemented Test suite in place Two versions available: Original Go implementation ChatGPT-generated version Future Plans Add real-time monitoring mode Implement log rotation handling Add support for different log formats Create configuration file support Add output formatting options Implement statistics collection Updates 2024-12-23: Documentation Update Converted to new documentation format Added detailed technical specifications Reorganized project structure Read the full story about this project ...

2023-04-27 · 2 min · 228 words · Pavel Anni