DevTools


# log navigator
apt install lnav

# just print matching filename
for f in $(find . -type f); do grep -lH searchstr $f; done

alias dus='du --exclude=efs -ms * 2>/dev/null|sort -n|tail'

# top-level dir list
function fdtop () { find . -maxdepth 1 -type d; }
for d in $(find . -maxdepth 1 -type d); ...
alias tld='find . -maxdepth 1 -type d'


alias dus='for d in $(find . -maxdepth 1 -type d); do [[ "$d" == "." ]] && continue; du -ms $d; done |sort -n|tail'

# to gen lower-case uuid
uuidgen |tr '[A-Z]' '[a-z]' |pbcopy

hostnamectl set-hostname geeksforgeeks

timedatectl status

journalctl --since "1 hour ago" -t CRON

alias pw='pstree -w|less'
pww () { while true; do clear; date; pstree -w -p $1; sleep 5; done; }
  • Log grepping
    HTTP/1.1" [^2][0-9][0-9]
    cd /var/log/apache2
    grep 'HTTP/1.1" [5][0-9][0-9]' ssl_access.log  # 5xx
    grep 'HTTP/1.1" [^2][0-9][0-9]' ssl_access.log # non 200
    tail -F /var/log/apache2/ssl_access.log * 2>&1 |egrep -v -i 'Deprecated|^$'
    
    
  • GoJS chart lib - List all types

  • Remove Spaces from file names
    #!/usr/bin/env bash
    # Removes all spaces from file and directory names recursively.
    # Run from any directory; pass the target directory as an argument (defaults to .).
    # find . -depth -name "* *" # to check
    
    TARGET="${1:-.}"
    
    # Process deepest paths first so parent renames don't break child paths.
    find "$TARGET" -depth -name "* *" | while IFS= read -r path; do
      dir=$(dirname "$path")
      base=$(basename "$path")
      new_base="${base// /}"
      if [ "$base" != "$new_base" ]; then
        mv -- "$path" "$dir/$new_base"
        echo "Renamed: $path -> $dir/$new_base"
      fi
    done
  • Memory Profiler
    • /usr/bin/time --verbose <cmd>
    • \time -v <cmd>
  • Time Setup
    • timedatectl