print strace summary

To summarise syscalls by time or count, use strace -c. To include child processed, add -f switch. For example:

λ strace -cf git status
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.000008           0       247        24 lstat
  0.00    0.000000           0        48           read
  0.00    0.000000           0         3           write
                     ... list goes on ...

automatically set prompt colour based on hostname

When logging on multiple machines with synchronized ~/.bashrc / ~/.zshrc you probably don’t want to set PS1 on each machine separately. Solution based on hostname will be handy.

To derive user@hostname (or any other host-identifying command) into uniformly-distributed colours, use:

_host_colour=$(echo $(whoami)@$(hostname -f) | sum | awk "{print  $1 % 256 }")

GNU tool sum generates simple, short checksum which are then shortened down to 256 (the default Xterm colour count).
Now add the variable to your PS1:

# Bash
export PS1="[33[38;5;${_host_colour}m]u@h[33[0m] % "

# Zsh (requires module colors)
export PS1="%F{${_host_colour}}%n@%m%f %% "

Protip: If you want to change colour per-host, just set variable _host_colour. You can do it even after PS1 was set.