Commands by koppi (4)


  • 4
    ASN=32934; for s in $(whois -H -h riswhois.ripe.net -- -F -K -i $ASN | grep -v "^$" | grep -v "^%" | awk '{ print $2 }' ); do echo " blocking $s"; sudo iptables -A INPUT -s $s -j REJECT &> /dev/null || sudo ip6tables -A INPUT -s $s -j REJECT; done
    koppi · 2016-04-08 11:30:12 0

  • 3
    ss -t -o state established '( dport = :443 || dport = :80 )'|grep tcp|awk '{ print $5 }'|sed s/:http[s]*//g|sort -u|netcat whois.cymru.com 43|grep -v "AS Name"|sort -t'|' -k3
    koppi · 2016-04-07 01:48:44 2

  • 0
    alias rn='mkdir -p ~/.rm`pwd`; mv -v -f --backup=t -t ~/.rm`pwd` "$@"'
    koppi · 2013-04-17 10:56:21 0
  • As mtr starts, it investigates the network connection between the host and google public dns server. Show Sample Output


    0
    mtr -t -o "LSD NBAW" 8.8.8.8
    koppi · 2013-04-15 22:28:09 0

What's this?

commandlinefu.com 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

list files recursively by size

ROT13 whole file in vim.
gg puts the cursor at the begin g? ROT13 until the next mov G the EOF

Create Solid Archive (best compression) with 7z
Creates a solid archive with the highest possible compression (Ultra). Advantage of 7z is that it will use all the processor cores to create the archive. (Ok. at least version 9.04 does)

Automatically download Ubuntu 10.04 when available
Tested with 9.10 release. Choose whatever torrent client you prefer.

Git Global search and replace
Find all the occurrences in the git repo of 'foo' and replace with 'bar'

ignore hidden directory in bash completion (e.g. .svn)
add it in ~/.bashrc install bash-completion

Change permissions of every directory in current directory
"find . -type d -print0 | xargs -0 chmod 755" thanks masterofdisaster

A simple command to toggle mute with pulseaudio (any sink)
0 can also be replaced by the source name, e.g. alsa_output.pci-0000_00_1b.0.analog-stereo

list all opened ports on host

Find usb device
I often use it to find recently added ou removed device, or using find in /dev, or anything similar. Just run the command, plug the device, and wait to see him and only him


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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: