Downloading all related videos from youtube with youtube-dl

2010-05-16 2 min read Fedora Learning Linux Uncategorized

How many time did you want to see all the videos (related) to the one you were watching on youtube but decided otherwise as the downloaded was not fast enough. Or has it happened to you that you wanted to <a class="zem_slink freebase/en/uploading_and_downloading" title="Uploading and downloading" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uploading_and_downloading">download all the related videos, in either case you can use the youtube-dl utility I blogged about some times back. First you need to get all the <a class="zem_slink freebase/en/uniform_resource_locator" title="Uniform Resource Locator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator">URL&#8217;s in a <a class="zem_slink freebase/en/text_file" title="Text file" rel="wikipedia" href="http://en.wikipedia.org/wiki/Text_file">text file, and the simplest way to do this is :

Continue reading

Find out why a program can't seem to access to a file

2010-05-05 2 min read Fedora Linux

$ strace php tias.php -e open,access 2>&1 | <a class="zem_slink freebase/en/grep" href="http://en.wikipedia.org/wiki/Grep" title="Grep" rel="wikipedia">grep foo.txt Sometimes a program refuses to read a file and you&#8217;re not sure why. You may have display_errors turned off for <a class="zem_slink freebase/en/php" href="http://www.php.net/" title="PHP" rel="homepage">PHP or something. In this example, fopen(&#8217;/var/www/test/foo.txt&#8217;) was called but doesn&#8217;t have read access to foo.txt.

Strace can tell you what went wrong. E.g., if php doesn&#8217;t have read access to the file, strace will say &#8221;EACCESS (Permission denied)&#8221;. Or, if the <a class="zem_slink freebase/guid/9202a8c04000641f8000000000220ffa" href="http://en.wikipedia.org/wiki/Path_%28computing%29" title="Path (computing)" rel="wikipedia">file path you gave doesn&#8217;t exist, strace will say &#8221;ENOENT (No such file or directory)&#8221;, etc.

Continue reading

Download youtube video directly from the command line with youtube-dl

2010-05-03 2 min read Fedora Uncategorized

If you keep searching for applications to <a class="zem_slink freebase/en/uploading_and_downloading" title="Uploading and downloading" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uploading_and_downloading">download the <a class="zem_slink freebase/en/youtube" title="YouTube" rel="homepage" href="http://www.youtube.com/">youtube videos or you keep searching for the firefox addons to download the embedded the video, then this is for you. Ofcouse that is the case, only if you do not want to copy it after you have watched it in the <a class="zem_slink freebase/en/web_browser" title="Web browser" rel="wikipedia" href="http://en.wikipedia.org/wiki/Web_browser">browser :). If you have already watched it then you can copy it from the <a class="zem_slink freebase/en/mozilla_firefox" title="Firefox" rel="homepage" href="http://www.mozilla.com/en-US/firefox/">Firefox cache. I will post on that later for now lets see youtube-dl.

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.feedburner.com/commands/by/mdelatorre">View all commands by <a href="http://feeds2.feedburner.com/commands/by/mdelatorre">mdelatorre

<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" />

Continue reading

geoip lookup with curl on geody.com

2010-04-11 1 min read Linux

$ geoip(){curl -s "http://www.geody.com/geoip.php?ip=${1}" | sed '/^IP:/!d;s/<[^>][^>]*>//g' ;}

  • <a href="http://www.commandlinefu.com/commands/view/3835/geoip-lookup">View this command to comment, vote or add to favourites
  • <a href="http://feeds2.feedburner.com/commands/by/twfcc">View all commands by <a href="http://feeds2.feedburner.com/commands/by/twfcc">twfcc

<a href="http://www.commandlinefu.com"><img src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg" alt="commandlinefu.com" align="bottom" />

by David Winterbottom (<a href="http://codeinthehole.com">codeinthehole.com)

<a href="http://feedads.g.doubleclick.net/~a/cceHjCeJpY_mGEm7ufxOyYvznhw/0/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/cceHjCeJpY_mGEm7ufxOyYvznhw/0/di" border="0" alt="" align="bottom" />
<a href="http://feedads.g.doubleclick.net/~a/cceHjCeJpY_mGEm7ufxOyYvznhw/1/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/cceHjCeJpY_mGEm7ufxOyYvznhw/1/di" border="0" alt="" align="bottom" />

<img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/TiutyTYxoU0" border="0" alt="" width="1" height="1" align="bottom" />

URL: <a href="http://feedproxy.google.com/~r/Command-line-fu/~3/TiutyTYxoU0/geoip-lookup">http://feedproxy.google.com/~r/Command-line-fu/~3/TiutyTYxoU0/geoip-lookup<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.killerstartups.com/Web-App-Tools/retwt-me-shortening-links-in-a-new-setting">ReTwt.me – Shortening Links In A New Setting (killerstartups.com) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/9044e865-5beb-432f-b243-31d6858ee7a2/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e21.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related pretty-attribution">

Continue reading
Older posts Newer posts