Skip to content

Instantly share code, notes, and snippets.

View nitefood's full-sized avatar

Adriano nitefood

  • Italy
View GitHub Profile
@nitefood
nitefood / multitail.sh
Last active March 28, 2023 09:07
parallel remote tail
#!/usr/bin/env bash
# ssh targets and log search pattern
user="root" # remote ssh user
hostlist="host1.example.com host2.example.com host3.example.com" # space-separated ssh hosts list
remote_logfile="/var/log/syslog"
search_pattern="Session" # can use regexps here (grep -E)
# trap ctrl-c for named pipe cleanup and ssh process killing
trap 'echo -e "\n\nCleaning up..."; for pid in $children; do kill -9 $pid 2>/dev/null; done; rm "$HOME/tailpipe"; exit 0' INT
@nitefood
nitefood / README.md
Last active May 8, 2023 00:45
ASN/IP/Route/hostname command line lookup tool to map any network to the corresponding ASN and prefix

This gist has moved to its own repository HERE

See you there!