Tag Archives: shell

Ngrep and p2p

This the command I use to track down P2P conenctions through my networks: ngrep -t -d ETH00:00 -q -i -W single -l \ ‘info_hash|torr|bitt|vuze|azue|tracker|edonk|aza|lime|emule\ |gift|gnutella|frostwire|morpheus|bearshare|uTorrent’ Note: it should all be on one line. -i is ignore case -w is word-regex (expression must match as a word) -l is make stdout line buffered -t is print

Read More

Tar – Tricks and Tips

Task: List the contents of a tar file

Use the following command:
$ tar -tvf file.tar

Task: List the contents of a tar.gz file

Use the following command:
$ tar -ztvf file.tar.gz

Task: List the contents of a tar.bz2 file

Use the following command:
$ tar -jtvf file.tar.bz2

Where,

  • t: List the contents of an archive
  • v: Verbosely list files processed (display detailed information)
  • z: Filter the archive through gzip so that we can open compressed (decompress) .gz tar file
  • j: Filter archive through bzip2, use to decompress .bz2 files.
  • f filename: Use archive file called filename

Read More

Screen Tips

A few snippets to make your prompt look better when using screen for linux. Add the below to your .bashrc so each tab created when you generate a new screen shows user@hostname function rename_screen_tab () { echo -ne “\x1bk$@\x1b\\”; return 0; } if [[ “$TERM” = screen* ]]; then PROMPT_COMMAND=’rename_screen_tab ${USER}@${HOSTNAME%%.*}’ [ “$HOSTNAME” = “hostname-of-mainbox”

Read More

Bad Behavior has blocked 61 access attempts in the last 7 days.