This command validates if exist any character different in 0-255 and dot. If any characters different is typed the error menssage is showing. Show Sample Output
Just added a little url encoding with sed - urls with spaces don't work well - this also works against instead of enclosure and adds a sample to show that you can filter against links at a certain domain Show Sample Output
finds all xml files greps them for extracts the bean id sorts the ids creates a list of distinct entries, a unique list of bean ids Show Sample Output
Get two different lines like this:
sed -n '1000000p;2000000{p;q;}' < massive-log-file.log
See also: http://www.commandlinefu.com/commands/view/6043/print-just-line-4-from-a-textfile
This is how you can do this without having to use oneline Show Sample Output
On debian parent process is running as root, workers as www-data. You can run strace in backgroud, get its PID, curl your webpage, kill strace and read your stats.
its not the prettiest but it should do the job. This one liner removes all ubuntu packages whose name ends with *-dev
Requirements: Google Authenticator is configured as per document (http://blogs.vmware.com/consulting/files/2015/02/VMW_15Q1_TD_Horizon-View-Google-Authenticator_021715_FINAL_EMonjoin.pdf) including the patch at the end of the document. Login as the user to be provisioned. su username Command will: 1. Silently provision a user for Google Authenticator (TOTP) 2. Remove the unnecessary (and unsecure) code that uses google.com to create the QR code in browser. 3. Decode URL (first instance) 4. Decode URL (second instance) 5. Create a QR code 6. Send email to an account with the QR Code attached User scans QR code with Google Authenticator.
this one includes special characters. note some some chars may be disallowed on windows systems. *nix will allow pretty much any character in a password except a carriage return. you do not want non printing characters in your password, so this is limited to the printable chars displayed on a keyboard , less space and return. edited to fix minor typo Show Sample Output
I had to reconfigure all of my 150 domains to use "localhost" as IMAP/SMTP server instead of mail.[domain]. This little thing did the job in a fraction of a second!
use get_iplay to download all listed content from http://www.bbc.co.uk/radio4extra run every night to make sure no episodes are missed
this is what i needed on ubuntu 12.04 for ios 9
1. No for-loop, but xargs. 2. Append "--" in git-reset HEAD command to deal with filenames contained leading hyphen/minus sign (-). 3. Add "--porcelain" option in git-status command for easy-to-parse format when scripting. 4. Add "--no-run-if-empty" option in xargs command to prevent you run it twice and accidentally reset all staged changes. 5. Use zero byte (NUL character) as line terminator instead of newline (\n) to make it more robust to deal with filename with whitespaces. pipe#1: git-status. pipe#2: Use "grep" to filter out "non-added" files. pipe#3: use "sed" to Trim out the leading three characters, reserve the filename. pipe#4: xargs + git-reset... p.s. The "HEAD" in git-reset can be omitted . And, maybe, the third part of this shell pipe (sed) has potential to be enhanced.
Nginx (and other webservers like Apache) can be awkward to trace. They run as root, then switch to another user once they're ready to serve web pages. They also have a "master" process and multiple worker processes. The given command finds the process IDs of all Nginx processes, joins them together with a comma, then traces all of them at once with "sudo strace." System trace output can be overwhelming, so we only capture "networking" output. TIP: to kill this complex strace, do "sudo killall strace". Compare with a similar command: http://www.commandlinefu.com/commands/view/11918/easily-strace-all-your-apache-processes Show Sample Output
Convert Underscore to CamelCase Show Sample Output
This oneliner will remove the number which begins a filename.
I just needed to store the LAN IP (for ipv4) in a variable for a specific task in a bash script. I figured I'd share. I sent it to a variable with VAR=$(stuff) and used it later on. I put the exit 0 in the if statement to make it so that it breaks if there are more than one IPv4 addresses assigned. I only wanted the first one. Edit: Bear in mind, my network mask is a double digit number so if you have a smaller nw mask you'd need to edit the sed statement. Show Sample Output
It's quite fun to invert text using "flip.pl" (ref: http://ubuntuforums.org/showthread.php?t=2078323 ). Slightly more challenging is to flip a whole "cowsay". :-) Show Sample Output
Above example is upgrading Solaris from 11.1SRU20.0.5 to 11.2SRU15.0.5. Patches are not applied options "-nv" are for dryrun and verbose output. Show Sample Output
Check that all websites on the current server are working as expected. This is a quick easy way to do that. Show Sample Output
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
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: