Python Challenge Problem 0

sensible-browser http://www.pythonchallenge.com/pc/def/$(bc <<< 2^38).html
This is the answer to the 0th problem from the python challenge < http://www.pythonchallenge.com/ >. Replace sensible-browser with firefox, w3m or whatever.
Sample Output
http://www.pythonchallenge.com/pc/def/map.html

-1
By: kzh
2010-02-02 00:53:18

These Might Interest You

  • I have a server with a php requiring basic authentication, like this: header('WWW-Authenticate: Basic realm="do auth"'); header('HTTP/1.0 401 Unauthorized'); ...?> And the basic authentication in wget do not worked: wget --auth-no-challenge --http-user="username" --http-password="password" -O- "http://url" wget --keep-session-cookies --save-cookies=cookies.txt --load-cookies=cokies.txt --http-user="username" --http-password="password" -O- "http://url" I always received the 401 Authorization failed. The saved cookie is always empty. With my way, I received the header from the server and save the cookie, then resend the session cookie with authentication data Show Sample Output


    1
    wget --auth-no-challenge --server-response -O- $url 2>&1 | grep "Cookie" | sed "s/^ Set-//g" > cookie.txt; wget --auth-no-challenge --server-response --http-user="user" --http-password="pw" --header="$(cat cookie.txt)" -O- $url
    glaudiston · 2010-12-01 11:24:35 0
  • Pre-packaged python script that comes with Debian/Ubuntu. Show Sample Output


    1
    colortest-python
    eikenberry · 2012-10-26 06:50:01 0

  • 13
    python -c 'import this'
    cofi · 2009-08-15 10:31:21 1
  • This will save and execute your python script every time your press the F5 function key. It can also be added to your .vimrc: autocmd BufRead *.py nmap :w^M:!python % NOTE: the ^M is not just caret-M, it can be created by type: ctrl-v ctrl-m Show Sample Output


    1
    vim ... :nmap <F5> :w^M:!python %<CR>
    duxklr · 2010-09-03 18:44:21 0

What Others Think

Why don't you just replace sensible-browser with xdg-open?
matthewbauer · 433 weeks and 2 days ago
I was not aware of xdg-open. Thanks for the info. Also instead of $(bc
kzh · 433 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

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



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: