Commands tagged sniffer (1)

  • Quick OneLiner to sniff for ICMP traffic, proof of concept socket code. Needs root privs to run. Show Sample Output

    echo "exec(\"import socket, os\nwhile True:\n\tprint (socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_ICMP)).recvfrom(65565)\")" | sudo python
    justinf · 2015-05-24 08:19:55 0

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Check These Out

Double your disk read performance in a single command
(WARN) This will absolutely not work on all systems, unless you're running large, high speed, hardware RAID arrays. For example, systems using Dell PERC 5/i SAS/SATA arrays. If you have a hardware RAID array, try it. It certainly wont hurt. You may be can test the speed disk with some large file in your system, before and after using this: $ time dd if=/tmp/disk.iso of=/dev/null bs=256k To know the value of block device parameter known as readahead. $ blockdev --getra /dev/sdb And set the a value 1024, 2048, 4096, 8192, and maybe 16384... it really depends on the number of hard disks, their speed, your RAID controller, etc. (see sample)

Colorize svn stat
Use color escape sequences and sed to colorize the output of svn stat -u. Colors: svn stat characters: GNU Extensions for Escapes in Regular Expressions:

Mac OS-X-> copy and paste things to and from the clipboard from the shell
Copies whatever is piped to the pbcopy command to the clipboard. pbpaste ... well pastes whats on the clipboard.

batch convert Nikon RAW (nef) images to JPG
converts RAW files from a Nikon DSLR to jpg for easy viewing etc. requires ufraw package

Run the last command as root
Useful when you forget to use sudo for a command. "!!" grabs the last run command.

Random unsigned integer
works at least in bash. returns integer in range 0-32767. range is not as good, but for lots of cases it's good enough.

Vectorize xkcd strips
Uses ImageMagick and potrace to vectorize the input image, with parameters optimized for xkcd-like pictures.

stop windows update
Windows only: stops windows update and the nagging restart window. You need your admin password for this one.

Create a file of a given size in linux

[git] Output remote origin from within a local repository
Great way to quickly grasp if a locally cloned repository originates from e.g. github or elsewhere.

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: