lsofer
hasura-ci-cd-action
lsofer | hasura-ci-cd-action | |
---|---|---|
2 | 2 | |
10 | 35 | |
- | - | |
10.0 | 0.0 | |
over 6 years ago | 10 months ago | |
Shell | Shell | |
- | - |
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
hasura-ci-cd-action
-
Bash functions are better than I thought
I write a LOT of bash/shell scripts. And I don't like it, it's just part of what I have to do.
Learning a handful of bash idioms and best-practices has made a massive impact for me, and life much easier. The shell is something you cannot avoid if you're a programmer or other sort of code-wrangler.
You can interact with it + be (mostly) clueless and still get things done, but it's a huge return-on-investment to set up "shellcheck" and lookup "bash'isms", etc.
----
(Off-topic: I am convinced Ruby cannot be beaten for shell-scripting purposes. If I had a wish, it would be that every machine had a tiny Ruby interpreter on it so I could just use Ruby. I'm not even "a Ruby guy", it's just unreasonably good/easy for this sort of thing. And I keep my mind open for better alternatives constantly.)
Example of near-identical script in bash vs Ruby:
https://github.com/GavinRay97/hasura-ci-cd-action/blob/maste...
https://github.com/GavinRay97/hasura-ci-cd-action/blob/maste...
What are some alternatives?
bash-core - Core functions for any Bash program.
mycmd - Tool for writing and running commands from a command directory
basalt - The rock-solid Bash package manager.
murex - A smarter shell and scripting environment with advanced features designed for usability, safety and productivity (eg smarter DevOps tooling)
PPSS - Parallel Processing Shell Script
stripe-jobs-cli
nsd - NGS Scripts Dumpster
Seed - A Rust framework for creating web apps
ngs - Next Generation Shell (NGS)
KeenWrite - Free, open-source, cross-platform desktop Markdown text editor with live preview, string interpolation, and math.
oh - A new Unix shell.