Hacker News new | ask | show | jobs
by westurner 1541 days ago
From https://westurner.github.io/hnlog/#comment-20671184 ::

> I log shell commands with a script called usrlog.sh that creates [per-]$USER and per-virtualenv tab-delimited [$_USRLOG] logfiles with unique per-terminal-session identifiers [$_TERM_ID] and ISO8601 timestamps; so it's really easy to just grep for the apt/yum/dnf commands that I ran ad-hoc when I should've just taken a second to create an Ansible role with `ansible-galaxy init ansible-role-name ` and referenced that in a consolidated system playbook with a `when` clause. https://westurner.github.io/dotfiles/usrlog.html#usrlog

  stid \#tutorial; echo "$_TERM_ID"

  tail -n11 $_USRLOG
  ut -n11

  grep "$_TERM_ID" "$_USRLOG"
  usrlog_grep "$_TERM_ID"
  ug "$_TERM_ID"

  usrlog_grep_parse "$_TERM_ID"
  ugp "$_TERM_ID" # `type ugp`
usrlog.sh: https://github.com/westurner/dotfiles/blob/master/scripts/us...