lsofer
oh
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
lsofer
-
Not knowing the /proc file system
/proc is amazing once you get the hang of it and get a good understanding of what's all in there. Especially if you're doing low level performance tuning.
It's particularly helpful in larger infrastructures where tool the variability means differences in available tooling, and their output plus cli options. I'm sure /proc iteration has its own issues of variability across large infrastructres, but I haven't seen it. It's a fairly consistent API. Or at least it was, since I haven't touched a large infrastructure in some time.
When I got tired of `lsof` not being installed on hosts (or when its `-i` param isn't available) I ended up writing a script [1] that just iterates through /proc over ssh and grabs all inet sockets, environment variables, command line, etc from a set of hosts. Results in a null-delimited output that can then be fed into something like grafana to create network maps. Biggest problem with it is the use of pipes means all cores go to 100% for the few seconds it takes to run.
[1] https://github.com/red-bin/lsofer
-
Bash functions are better than I thought
Oh yeah, bash functions are great and absolutely abusable. Sometimes you need some grand hacks to get it to work well, but when it works well, it can do some magic. You can even export functions over ssh!
I wrote this a few years back which ran on bunches of hosts and fed into a infrastructure network mapper based on each hosts' open network sockets to other known hosts. It wasn't really feasible to install a set of tools on random hosts.. but I still had root ssh access across the board. So I needed something tool agnostic, short, auditable, and effectively guaranteed to work:
https://github.com/red-bin/lsofer/blob/master/lsofer.sh
oh
- Understanding the Power of Lisp (2020)
- Bass – Lisp dialect for scripting the infrastructure beneath your project
-
CommandConsole: A shell written in C
I think an extensible shell like oh shell would be something I would prefer. Though it should not need closures on heap to extend (which is ridolous slow on arithmetic) and generate the data types at compilation time.
-
Bash functions are better than I thought
> Is there a reason we aren’t using a shell with a proper programming language for scripting?
Mostly because the people who want to introduce a "programming language" into the shell don't prioritize being a shell.
Check out the "Oh" shell for contrast. This is what a programming language looks like when you force it to conform to being a shell first priority.
https://github.com/michaelmacinnis/oh
https://www.youtube.com/watch?v=v1m-WEZz46U
This is "Scheme-like" but has FEXPRs so things can be redefined and evaluation can be controlled.
-
Show HN: SectorLISP Now Fits in One Sector
I love chatting about Kernel :D Here's my most recent post: https://lobste.rs/s/d0hogq/problem_with_macros#c_nozcrm
Thanks for showing me Oh! It really has f-exprs?! I didn't immediately see it in https://github.com/michaelmacinnis/oh/blob/main/doc/manual.m...
- Oh, a New Unix Shell
What are some alternatives?
hasura-ci-cd-action
elvish - Powerful scripting language & Versatile interactive shell
bash-core - Core functions for any Bash program.
sicp - HTML5/EPUB3 version of SICP
basalt - The rock-solid Bash package manager.
cl-unix-cybernetics - UNIX system administration in Common Lisp
PPSS - Parallel Processing Shell Script
nsd - NGS Scripts Dumpster
ngs - Next Generation Shell (NGS)