cURL – Tutorial

2010-09-15 1 min read bash Fedora Linux
Here are linkw to two nice tutorials on curl and how to use curl to login before we try to fetch a page. Hope you find them useful. http://curl.haxx.se/docs/httpscripting.html http://www.youtube.com/watch?v=XcgQUsorF_8 http://scriptasy.com/php_11/tutorial-curl-login_44.html Related articles by Zemanta {."zemanta-related-title"} How To Display Just The HTTP Response Code In CLI Curl (beerpla.net)

Using tput to save, clear and restore the terminal contents

2010-06-17 1 min read Linux
Using tput to save, clear and restore the terminal contents $ tput smcup; echo ”Doing some things…”; sleep 2; tput rmcup Very useful for interactive scripts where you would like to return the terminal contents to its original state before the script was run. This would be similar to how vi exits and returns you to your original terminal screen. Save and clear the terminal contents with: tput smcup Continue reading

Delete all files in a folder that don't match a certain file extension

2010-04-30 1 min read bash Fedora Linux
$ rm !(.foo|.bar|*.baz) Deletes all files in a folder that are NOT *.foo, *.bar or *.baz files. Edit the pattern inside the brackets as you like. <a href="http://www.commandlinefu.com/commands/view/5351/delete-all-files-in-a-folder-that-dont-match-a-certain-file-extension">View this command to comment, vote or add to favourites <a href="http://feeds2.feedburner.com/commands/by/hutch">View all commands by <a href="http://feeds2.feedburner.com/commands/by/hutch">hutch <a href="http://www.commandlinefu.com"><img src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg" alt="" align="bottom" /> by David Winterbottom (<a href="http://codeinthehole.com">codeinthehole.com) <a href="http://feedads.g.doubleclick.net/~a/kewaFMgsXI4A1vQfeLscg2Vcv8o/0/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/kewaFMgsXI4A1vQfeLscg2Vcv8o/0/di" alt="" align="bottom" /> <a href="http://feedads.g.doubleclick.net/~a/kewaFMgsXI4A1vQfeLscg2Vcv8o/1/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/kewaFMgsXI4A1vQfeLscg2Vcv8o/1/di" alt="" align="bottom" /> <img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/TCRb2ku_V1Y" alt="" width="1" height="1" align="bottom" /> Continue reading

Lock the hardware eject button of the cdrom

2010-04-29 1 min read Fedora Learning Linux
$ eject -i 1 This command will lock the hardware eject button of your cdrom drive. Some uses are: 1: If you have a toddler and has discovered the cdrom button 2: If you are carrying a laptop in a bag or case and don&#8217;t want it to eject if the button is inadvertently pressed. To unlock the button use: eject -i 0 <a href="http://www.commandlinefu.com/commands/view/5390/lock-the-hardware-eject-button-of-the-cdrom">View this command to comment, vote or add to favourites <a href="http://feeds2. Continue reading