Commands by ajmckee (1)

  • Rather then editing the /etc/sysconfig/iptables file, or during a kickstart doing some awk/sed magic, easily add a rule in the correct place within iptables


    1
    REJECT_RULE_NO=$(iptables -L RH-Firewall-1-INPUT --line-numbers | grep 'REJECT' | awk '{print $1}');/sbin/iptables -I RH-Firewall-1-INPUT $REJECT_RULE_NO -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -m comment --comment "Permit HTTP Service"
    ajmckee · 2012-02-02 12:21:06 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

Find the package that installed a command

Calculate N!

Find all dotfiles and dirs
find makes it easier, filtering . and .. maxdepth could be removed, finding entries recursively. Removing mindepth causes . to appear

Change the default editor for modifying the sudoers list.
On Ubuntu, the default editor for visudo is nano. To change the editor to something else (e.g., vi) use this command.

cpu info

Backup a local drive into a file on the remote host via ssh

Extract audio from Flash video (*.flv) as mp3 file

Sort a character string
Sorts a character string, using common shell commands.

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

List process in unkillable state D (iowait)


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: