Removing colors from a stream by martinos

Ed77c0d1c8da409c4f69f67f934ff0bb?size=52

If you want to remove color escaped sequences from a stream. Useful to remove colors from rails log files.

cat colored_file.log | perl -ne 's/\x1b[[()=][;?0-9]*[0-9A-Za-z]?//g;s/\r//g;s/\007//g;print'`

#bash, #rails

Simple sniffer by martinos

Ed77c0d1c8da409c4f69f67f934ff0bb?size=52

To sniff the data sent and received from a host. Run the following command.

mkfifo pipe
tty=`tty`; nc -l -p 1234 < pipe | tee $tty | nc $host $port | tee pipe

Configure your program to communicate with localhost:1234 and run it.

All the data exchanged will be outputted to the terminal.

Note that on OS X, the nc -l option does not require the -p.

#bash

unix ls by agentcooper

50a1c1f2651b478f8cb8bff34ad41515?size=52
alias l='ls -trlah'

more productive ls:

  • -tr to sort modified asc, last modified will be in the end of output
  • -l for permissions
  • -a for hidden 'dot' files
  • -h for human readable size

#unix #bash