VirtualTam's bookmarks

  1. A PCAP-based tool that allows you to specify an extended regular or hexadecimal expression to match against data payloads of packets. It understands many kinds of protocols, including IPv4/6, TCP, UDP, ICMPv4/6, IGMP and Raw, across a wide variety of interface types, and understands BPF filter logic in the same fashion as more common packet sniffing tools, such as tcpdump and snoop.

  2.  1// THIS WILL SEND AN INTERRUPT TO ALL MATCHING THREADS
     2Thread.getAllStackTraces().keySet().each() {
     3  t -> if (t.getName().contains("PATTERN") ) { t.interrupt(); }
     4}
     5
     6// THIS WILL FORCE-STOP ALL MATCHING THREADS
     7// May be required for recursive loops
     8Thread.getAllStackTraces().keySet().each() {
     9  t -> if (t.getName().contains("PATTERN") ) { t.stop(); }
    10}
    
  3. Context: replace spaces by dashes in a script-generated HTML file's links

    1awk -F\' 'm = /a href/ { gsub(/ /,'-',$2); print$1'\''$2'\''$3} !m {print $0}'
    
  4. Given your unittests are in the tests directory:

     1# run a specific test module
     2python -m unittest tests.<module>
     3 
     4# run a specific test suite
     5python -m unittest tests.<module>.<class>
     6 
     7# run a specific test
     8python -m unittest tests.<module>.<class>.<test>
     9 
    10# run tests matching a given pattern
    11python -m unittest discover -s tests -p <pattern>