Python is always such much more readable than most shell scripting. Show Sample Output
Realtime lines per second in a log file using python ... identical to perl version, except python is much better :) Show Sample Output
you need ruby gems and localtunnel, further instruction on their website for ubuntu precise, just intall ... sudo apt-get install ruby ruby1.8-dev rubygems1.8 libopenssl-ruby sudo gem install localtunnel ssh-keygen -t rsa python -m SimpleHTTPServer 8000 sudo localtunnel -k ~/.ssh/id_rsa.pub 8000 Show Sample Output
Good because it doesn't use Sed.
for i rang(10) = length of the password random.choice("abcdefghijklmnopqrstuvwxyz...") = char allowed into the password Thanks Python/Django FAQ's. Show Sample Output
the command will output the script use the libs and particulars
No sudo; no permission issues; no crazy workarounds when trying to deploy to a CI server.
Puts the lines in a hash then iterates over the hash. Hashes are unsorted by nature. There should be newlines after each colon and an indent of two spaces, but it's still a one-liner.. kinda. The first line is the only one with no indent.
This might one day deliver the melody to the next super hit on the radio if played long enough
Useful to push strings in the stack Show Sample Output
Useful in shell scripts to dynamically detect python version, eg. in library paths etc: /usr/lib/python3.4 Show Sample Output
Http server on port other than 8000 Show Sample Output
Python is installed on many boxes (in case you could not afford installing jq).
More direct like this Show Sample Output
Explination: https://stackoverflow.com/questions/2257441/random-string-generation-with-upper-case-letters-and-digits/23728630#23728630 Why 16 Characters: https://www.wired.com/story/7-steps-to-password-perfection/ Show Sample Output
"this command line isn't mine but i find it very useful" ^^ This one-liner starts a dedicated server hosting (web server) on port 8000 with the contents of current directory on all the interfaces (address 0.0.0.0), not just localhost. If you have "index.html" or "index.htm" files, it will serve those, otherwise it will list the contents of the currently working directory. It works because python comes with a standard module called SimpleHTTPServer. The -m argument makes python to search for a module named SimpleHTTPServer.py in all the possible system locations (listed in sys.path and $PYTHONPATH shell variable). Once found, it executes it as a script. If you look at the source code of this module, you'll find that this module tests if it's run as a script if __name__ == '__main__', and if it is, it runs the test() method that makes it run a web server in the current directory.
Remove dashes, also validates if it's a valid UUID (in contrast to simple string-replacement)
Very useful for test a script. After launch this command, you only have to press ENTER for launch your script again. I work with screen and tape ENTER instead of '!!'+ENTER If you break your script with CTRL-C, it will wait for press ENTER and will re-launch You can write like it : while read -p "Press ENTER" ; do python ; done
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: