Tail all logs that are opened by all java processes. This is helpful when you are on a new environment and you do not know where the logs are located. Instead of java you can put any process name. This command does work only for Linux.
The list of all log files opened by java process:
sudo ls -l $(eval echo "/proc/{$(echo $(pgrep java)|sed 's/ /,/')}/fd/")|grep log|sed 's/[^/]* //g'
urls.txt should have a fully qualified url on each line
prefix with
rm log.txt;
to clear the log
change curl command to
curl --head $file | head -1 >> log.txt
to just get the http status
Show Sample Output
Uses the Wunderground web API to get weather data. Change the STA variable to a station near you. Show Sample Output
Change the value of p to match the path where you wish to create the profile. To run it again in the future, use the parameter --user-data-dir (which gets echoed to you when run): chromium-browser --user-data-dir=/path/to/your/ Quick Functions: # create a new chromium profile new-chromium-profile() { p=~/.config/chromium/$1; cp -r ~/.config/chromium/Default $p && echo "chromium-browser --user-data-dir=$p" && chromium-browser --user-data-dir=$p; } # runs a chromium profile run-chromium-profile() { chromium-browser --user-data-dir=~/.config/chromium/$1; } Show Sample Output
So your boss wants to know how much memory has been assigned to each virtual machine running on your server... here's how to nab that information from the command line while logged in to that server Show Sample Output
(Changed to "bartonskis" suggestion.)
This function is used to set environmental variables from a list of alternatives depending on what's installed on the system. It returns the first program found in the list.
Example usage:
export BROWSER=$(find_alternatives chromium-browser google-chrome opera firefox firefox-bin iceweasel konqueror w3m lynx)
.
export EDITOR=$(find_alternatives vim nano pico emacs kate)
.
export PAGER=$(find_alternatives vimpager less most more pg)
Numbers are less understandable then words. Also this may put out a different result.
This will tighten up security for your box. The default value for PermitRootLogin sadly is 'yes'.
a pretty simple script when running java programs from command line Show Sample Output
(1) don't run twice, or the same folder will occur in $PATH. (2) otherwise you need to start a new terminal Show Sample Output
Here's a bash version using an array.
Warn: use convmv or detox if you can: they are the right tools. But if you want to do it manually, you can use this command to find the problematic files and transliterate their accented characters to their ascii equivalent. (Useful when doing cd backup: growisofs may fail on files which come from the old iso8859-* days.)
This command are using by me for checking connection with Internet. Show Sample Output
urldecode files in current directrory
It's very similar to this thread:
http://www.commandlinefu.com/commands/view/4317/send-a-local-file-via-email
mutt your@email_address.com -s "Message Subject Here" -a attachment.jpg </dev/null
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: