Retrieves AS route prefixes for IPv4 and IPv6, aggregates the routes to the minimal set, and adds netfilter rules to reject them. Relies on two helpers: IPv4 - "aggregate" by Joe Abley (package name 'aggregate'), IPv6 - "aggregate6" by Job Snijders ( https://github.com/job/aggregate6 ) Show Sample Output
If you have to stop a bunch of processes or just want to get a list of their ID's, us this replacing with your process. Then you can use a loop to kill -9 all of them. Show Sample Output
Adds up the used disk space on all hard drives that are directly connected to the machine (i.e. no network mounts etc.) Assumes there are no IDE drives present. Show Sample Output
Extracts the binary from the .text section and escapes it. This puts it in a form ready to use in a program. Show Sample Output
remove the IP from proxy reverse server and parentesis from real IP obtained from X-forwarder_IP Show Sample Output
Grab the multiline webhook URL definition from alarm-show. Basically it parse the following into an URL only: ```root@ctl01:/home/hombre# ceilometer alarm-show 1383a6be-fb73-4955-9991-8d65a8a23d60 +---------------------------+--------------------------------------------------------------------------+ | Property | Value | +---------------------------+--------------------------------------------------------------------------+ | alarm_actions | [u'http://10.40.50.20:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3d6118 | | | cc789c4db3b06fb3a382494b67%3Astacks%2Fhombre-V2R1%2Fd189e704-4f99-467 | | | 5-9ec2-eaadkc0ae8af5%2Fresources%2Fweb_server_scaleup_policy?Timestamp=20 | | | 16-10-03T14%3A05%3A27Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=09sdkd4e | | | d854347189383aba11d6353c6&SignatureVersion=2&Signature=MXxlKLZ%2BT4y4y%2 | | | BOuuAmxTLIVQ9ONKx2jKSZKHYIy83Q%3D'] | ```
Seems to work on Ubuntu 14.02 LTS Show Sample Output
Show file count into directories. Usefull when you try to find hugh directories that elevate system CPU (vmstat -> sy) Show Sample Output
This command lists all currently installed packages in ubuntu in a single line, for example to use later with apt install. Show Sample Output
Python is installed on many boxes (in case you could not afford installing jq).
Get newest kernel version by parsing the most bleeding-edge Makefile possible. Useful for doing things like writing live ebuilds and/or self-updating PKGBUILDs for testing purposes. Breakdown: * wget -qO - https://raw.githubusercontent.com/torvalds/linux/master/Makefile — retrieve Makefile and pipe to stdout * head -n5 — only the first 5 lines are relevant, that's where all the version variables are grep -E '\ \=\ [0-9]{1,}' — version variables always have an equals sign followed by a number * cut -d' ' -f3 — extract the individual numbers from the version variables * tr '\n' '.' — replace newlines with periods * sed -e "s/\.$// — remove trailing period Show Sample Output
change ":" in path for new line and associate word path to var $PATH
You can replace "sort -nu" with "sort -u" for a word list sorted or "sort -R" for a random-sorted line (edit: corrected) Show Sample Output
Puts words on new lines, removing additional newlines.
This command will generate "CHECK TABLE `db_name.table_name` ;" statements for all tables present in databases on a MySQL server, which can be piped into the mysql command. (Can also be altered to perform OPTIMIZE and REPAIR functions.) Tested on MySQL 4.x and 5.x systems in a Linux environment under bash. Show Sample Output
search argument in PATH accept grep expressions without args, list all binaries found in PATH Show Sample Output
Searches in order of the directories of $PATH. Stops after finding the entry; looks for only that fileName. Works in Bourne, Korn, Bash and Z shells. Show Sample Output
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.
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
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: