<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>David Walsh :: Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞. &#187; Shell</title> <atom:link href="http://davidwalsh.name/tutorials/shell/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Thu, 02 Sep 2010 03:13:15 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Fixing Python&#8217;s &#8220;Python Eggs&#8221;&#160;Error</title><link>http://davidwalsh.name/python-eggs</link> <comments>http://davidwalsh.name/python-eggs#comments</comments> <pubDate>Thu, 25 Feb 2010 14:29:00 +0000</pubDate> <dc:creator>David Walsh</dc:creator> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://davidwalsh.name/?p=4879</guid> <description><![CDATA[Let me first state this for the record: I am not a server guy. The closest I&#8217;ve ever gotten to compiling my own versions of code is &#8220;sudo port install &#8230;&#8221; So when I decided to teach myself Python (creating simply database interaction, record listings, etc) and kept getting &#8220;500 Internal Server Error&#8221; messages, I [...]<p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/python-eggs">Fixing Python&#8217;s &#8220;Python Eggs&#8221;&nbsp;Error</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/custom-error-handling-php' rel='bookmark' title='Permanent Link: Custom Error Handling in&nbsp;PHP'>Custom Error Handling in&nbsp;PHP</a></li><li><a
href='http://davidwalsh.name/custom-404-page-tips' rel='bookmark' title='Permanent Link: Custom Error Page Tips &#8211; Designate The Pages You Hope No One&nbsp;Sees'>Custom Error Page Tips &#8211; Designate The Pages You Hope No One&nbsp;Sees</a></li><li><a
href='http://davidwalsh.name/javascript-framework-considerations' rel='bookmark' title='Permanent Link: 8 Considerations For Choosing Your JavaScript&nbsp;Framework'>8 Considerations For Choosing Your JavaScript&nbsp;Framework</a></li><li><a
href='http://davidwalsh.name/google-load' rel='bookmark' title='Permanent Link: google.load():  Utilize Google&#8217;s AJAX Libraries&nbsp;API'>google.load():  Utilize Google&#8217;s AJAX Libraries&nbsp;API</a></li><li><a
href='http://davidwalsh.name/prevent-directory-listings-with-htaccess' rel='bookmark' title='Permanent Link: Prevent Directory Listings With&nbsp;.htaccess'>Prevent Directory Listings With&nbsp;.htaccess</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Let me first state this for the record:  I am not a server guy.  The closest I&#8217;ve ever gotten to compiling my own versions of code is &#8220;sudo port install &#8230;&#8221;  So when I decided to teach myself Python (creating simply database interaction, record listings, etc) and kept getting &#8220;500 Internal Server Error&#8221; messages, I thought I was doomed.  I opened up the Apache error log and saw this:</p><pre class="shell">
[error] [client ::1] Traceback (most recent call last):
[error] [client ::1]   File &quot;/Users/davidwalsh83/Projects/server/something.py&quot;, line 6, in &lt;module&gt;
[error] [client ::1]     import MySQLdb, cgi, cgitb, httplib, urllib2
[error] [client ::1]   File &quot;build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py&quot;, line 19, in &lt;module&gt;
[error] [client ::1]   File &quot;build/bdist.macosx-10.6-universal/egg/_mysql.py&quot;, line 7, in &lt;module&gt;
[error] [client ::1]   File &quot;build/bdist.macosx-10.6-universal/egg/_mysql.py&quot;, line 4, in __bootstrap__
[error] [client ::1]   File &quot;/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py&quot;, line 835, in resource_filename
[error] [client ::1]     self, resource_name
[error] [client ::1]   File &quot;/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py&quot;, line 1304, in get_resource_filename
[error] [client ::1]     self._extract_resource(manager, self._eager_to_zip(name))
[error] [client ::1]   File &quot;/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py&quot;, line 1326, in _extract_resource
[error] [client ::1]     self.egg_name, self._parts(zip_path)
[error] [client ::1]   File &quot;/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py&quot;, line 915, in get_cache_path
[error] [client ::1]     self.extraction_error()
[error] [client ::1]   File &quot;/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py&quot;, line 881, in extraction_error
[error] [client ::1]     raise err
[error] [client ::1] pkg_resources.ExtractionError: Can't extract file(s) to egg cache
[error] [client ::1] 
[error] [client ::1] The following error occurred while trying to extract file(s) to the Python egg
[error] [client ::1] cache:
[error] [client ::1] 
[error] [client ::1]   [Errno 20] Not a directory: '/Library/WebServer/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp'
[error] [client ::1] 
[error] [client ::1] The Python egg cache directory is currently set to:
[error] [client ::1] 
[error] [client ::1]   /Library/WebServer/.python-eggs
[error] [client ::1] 
[error] [client ::1] Perhaps your account does not have write access to this directory?  You can
[error] [client ::1] change the cache directory by setting the PYTHON_EGG_CACHE environment
[error] [client ::1] variable to point to an accessible directory.
[error] [client ::1] 
[error] [client ::1] Premature end of script headers: something.py
</pre><p>My first thought was &#8220;Wow, that&#8217;s quite a long way of telling me to &#8216;just quit.&#8217;&#8221;  Not wanting to concede defeat, I did some quick Google searching to find that the following snippet of Python code would allow me program another day:</p><pre class="shell">
import os
os.environ['PYTHON_EGG_CACHE'] = '/tmp'
</pre><p>I&#8217;d like to pretend I know what that means but I really don&#8217;t know.  In any event, if you start receiving those errors, this snippet could be your ticket to taking a bite out of Python.</p><p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/python-eggs">Fixing Python&#8217;s &#8220;Python Eggs&#8221;&nbsp;Error</a></p><p>Related posts:<ol><li><a
href='http://davidwalsh.name/custom-error-handling-php' rel='bookmark' title='Permanent Link: Custom Error Handling in&nbsp;PHP'>Custom Error Handling in&nbsp;PHP</a></li><li><a
href='http://davidwalsh.name/custom-404-page-tips' rel='bookmark' title='Permanent Link: Custom Error Page Tips &#8211; Designate The Pages You Hope No One&nbsp;Sees'>Custom Error Page Tips &#8211; Designate The Pages You Hope No One&nbsp;Sees</a></li><li><a
href='http://davidwalsh.name/javascript-framework-considerations' rel='bookmark' title='Permanent Link: 8 Considerations For Choosing Your JavaScript&nbsp;Framework'>8 Considerations For Choosing Your JavaScript&nbsp;Framework</a></li><li><a
href='http://davidwalsh.name/google-load' rel='bookmark' title='Permanent Link: google.load():  Utilize Google&#8217;s AJAX Libraries&nbsp;API'>google.load():  Utilize Google&#8217;s AJAX Libraries&nbsp;API</a></li><li><a
href='http://davidwalsh.name/prevent-directory-listings-with-htaccess' rel='bookmark' title='Permanent Link: Prevent Directory Listings With&nbsp;.htaccess'>Prevent Directory Listings With&nbsp;.htaccess</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://davidwalsh.name/python-eggs/feed</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>MooTools Forge / GitHub Plugin Structure Shell&#160;Script</title><link>http://davidwalsh.name/mootools-forge-script</link> <comments>http://davidwalsh.name/mootools-forge-script#comments</comments> <pubDate>Tue, 15 Dec 2009 14:11:47 +0000</pubDate> <dc:creator>David Walsh</dc:creator> <category><![CDATA[MooTools]]></category> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://davidwalsh.name/?p=4410</guid> <description><![CDATA[One thing I love about the MooTools Forge is that it requires a strict structure for its plugins i.e. requiring a README.md file, Source directory, etc. I&#8217;ve created a shell script that I can run that creates the directory structure and files required to add my plugin to GitHub and then the Forge. The Shell [...]<p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/mootools-forge-script">MooTools Forge / GitHub Plugin Structure Shell&nbsp;Script</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/mootools-plugins' rel='bookmark' title='Permanent Link: Forge:  MooTools Plugin&nbsp;Repository'>Forge:  MooTools Plugin&nbsp;Repository</a></li><li><a
href='http://davidwalsh.name/github-markdown' rel='bookmark' title='Permanent Link: Using the GitHub API and PHP to Get Repository&nbsp;Information'>Using the GitHub API and PHP to Get Repository&nbsp;Information</a></li><li><a
href='http://davidwalsh.name/github-merge-batch' rel='bookmark' title='Permanent Link: Create a GitHub Merge Batch&nbsp;File'>Create a GitHub Merge Batch&nbsp;File</a></li><li><a
href='http://davidwalsh.name/github-badge' rel='bookmark' title='Permanent Link: Represent Your Repositories Using the GitHub&nbsp;Badge!'>Represent Your Repositories Using the GitHub&nbsp;Badge!</a></li><li><a
href='http://davidwalsh.name/mootools-github' rel='bookmark' title='Permanent Link: Follow MooTools on&nbsp;GitHub!'>Follow MooTools on&nbsp;GitHub!</a></li></ol>]]></description> <content:encoded><![CDATA[<p>One thing I love about the MooTools Forge is that it requires a strict structure for its plugins i.e. requiring a README.md file, Source directory, etc.  I&#8217;ve created a shell script that I can run that creates the directory structure and files required to add my plugin to GitHub and then the Forge.</p><h2>The Shell Script &amp; Usage</h2><p>The first step is creating the repository at GitHub.  Once created at GitHub, I run the script, giving it the name of the plugin and repository (they must be the same):</p><pre class="shell">
./newPlugin.sh ScrollSpy
</pre><p>The script itself looks like:</p><pre class="shell">
#!/bin/sh
mkdir $1
cd $1
git init
touch README.md
mkdir Source
touch Source/$1.js
touch Source/$1-yui-compressed.js
mkdir Docs
touch Docs/$1.md
touch package.yml
echo &quot;name:  $1
author:  davidwalsh
current:  
category:  
tags:  []
docs:  
demo:  &quot; &gt;&gt; package.yml;
cd $1
git add *
git commit -m &quot;First Commit&quot;
git remote add origin g&#105;t&#64;g&#105;t&#104;&#117;&#98;.&#99;om:darkwing/$1.git
</pre><p>Tada!  Done!  Now I just need to populate each file with the necessary content. MooTools FTW!</p><p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/mootools-forge-script">MooTools Forge / GitHub Plugin Structure Shell&nbsp;Script</a></p><p>Related posts:<ol><li><a
href='http://davidwalsh.name/mootools-plugins' rel='bookmark' title='Permanent Link: Forge:  MooTools Plugin&nbsp;Repository'>Forge:  MooTools Plugin&nbsp;Repository</a></li><li><a
href='http://davidwalsh.name/github-markdown' rel='bookmark' title='Permanent Link: Using the GitHub API and PHP to Get Repository&nbsp;Information'>Using the GitHub API and PHP to Get Repository&nbsp;Information</a></li><li><a
href='http://davidwalsh.name/github-merge-batch' rel='bookmark' title='Permanent Link: Create a GitHub Merge Batch&nbsp;File'>Create a GitHub Merge Batch&nbsp;File</a></li><li><a
href='http://davidwalsh.name/github-badge' rel='bookmark' title='Permanent Link: Represent Your Repositories Using the GitHub&nbsp;Badge!'>Represent Your Repositories Using the GitHub&nbsp;Badge!</a></li><li><a
href='http://davidwalsh.name/mootools-github' rel='bookmark' title='Permanent Link: Follow MooTools on&nbsp;GitHub!'>Follow MooTools on&nbsp;GitHub!</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://davidwalsh.name/mootools-forge-script/feed</wfw:commentRss> <slash:comments>18</slash:comments> </item> <item><title>Run PHP Files From the Command&#160;Line</title><link>http://davidwalsh.name/php-command-line</link> <comments>http://davidwalsh.name/php-command-line#comments</comments> <pubDate>Fri, 02 Oct 2009 13:24:20 +0000</pubDate> <dc:creator>David Walsh</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://davidwalsh.name/?p=3753</guid> <description><![CDATA[I&#8217;ve been brushing up on my shell scripting lately. I just got a MacBook and never felt compelled to spend too much time with Cygwin. I&#8217;m learning quite a bit now but there are still some tasks that I&#8217;d need to accomplish sooner rather than later. I know how to accomplish the task using PHP [...]<p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/php-command-line">Run PHP Files From the Command&nbsp;Line</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/read-pdf-doc-file-php' rel='bookmark' title='Permanent Link: Read PDF and Word DOC Files Using&nbsp;PHP'>Read PDF and Word DOC Files Using&nbsp;PHP</a></li><li><a
href='http://davidwalsh.name/prevent-cache' rel='bookmark' title='Permanent Link: Prevent Your CSS and JavaScript Files From Being&nbsp;Cached'>Prevent Your CSS and JavaScript Files From Being&nbsp;Cached</a></li><li><a
href='http://davidwalsh.name/htaccess-security-include-files' rel='bookmark' title='Permanent Link: Advanced .htaccess Security &#8211; Block Access to Include Files Using&nbsp;.htaccess'>Advanced .htaccess Security &#8211; Block Access to Include Files Using&nbsp;.htaccess</a></li><li><a
href='http://davidwalsh.name/twitter' rel='bookmark' title='Permanent Link: I&#8217;ve Finally Caved:&nbsp;Twitter'>I&#8217;ve Finally Caved:&nbsp;Twitter</a></li><li><a
href='http://davidwalsh.name/send-files-ftp-php' rel='bookmark' title='Permanent Link: Send Files via FTP Using&nbsp;PHP'>Send Files via FTP Using&nbsp;PHP</a></li></ol>]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been brushing up on my shell scripting lately.  I just got a MacBook and never felt compelled to spend too much time with Cygwin.  I&#8217;m learning quite a bit now but there are still some tasks that I&#8217;d need to accomplish sooner rather than later.  I know how to accomplish the task using PHP so I&#8217;ve got that to my advantage.  What&#8217;s awesome is that I can quickly and easily run my PHP files from the command line.</p><h2>The Shell&nbsp;Script</h2><pre class="shell">
php doTask.php
</pre><p>I&#8217;m not sure whether I consider using PHP instead of a straight shell script as being resourceful or using PHP as a crutch.  What are your thoughts?</p><p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/php-command-line">Run PHP Files From the Command&nbsp;Line</a></p><p>Related posts:<ol><li><a
href='http://davidwalsh.name/read-pdf-doc-file-php' rel='bookmark' title='Permanent Link: Read PDF and Word DOC Files Using&nbsp;PHP'>Read PDF and Word DOC Files Using&nbsp;PHP</a></li><li><a
href='http://davidwalsh.name/prevent-cache' rel='bookmark' title='Permanent Link: Prevent Your CSS and JavaScript Files From Being&nbsp;Cached'>Prevent Your CSS and JavaScript Files From Being&nbsp;Cached</a></li><li><a
href='http://davidwalsh.name/htaccess-security-include-files' rel='bookmark' title='Permanent Link: Advanced .htaccess Security &#8211; Block Access to Include Files Using&nbsp;.htaccess'>Advanced .htaccess Security &#8211; Block Access to Include Files Using&nbsp;.htaccess</a></li><li><a
href='http://davidwalsh.name/twitter' rel='bookmark' title='Permanent Link: I&#8217;ve Finally Caved:&nbsp;Twitter'>I&#8217;ve Finally Caved:&nbsp;Twitter</a></li><li><a
href='http://davidwalsh.name/send-files-ftp-php' rel='bookmark' title='Permanent Link: Send Files via FTP Using&nbsp;PHP'>Send Files via FTP Using&nbsp;PHP</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://davidwalsh.name/php-command-line/feed</wfw:commentRss> <slash:comments>26</slash:comments> </item> <item><title>Automate YouTube Video and MP3 Rips with Bash Shell&#160;Scripting</title><link>http://davidwalsh.name/youtube-mp3</link> <comments>http://davidwalsh.name/youtube-mp3#comments</comments> <pubDate>Thu, 01 Oct 2009 12:21:04 +0000</pubDate> <dc:creator>David Walsh</dc:creator> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://davidwalsh.name/?p=3698</guid> <description><![CDATA[I love listening to music while I code. Listening to music keeps me from getting too frustrated about code that isn&#8217;t working (yes, it happens) or frustrations brought on by hosting providers, clients, etc. What I&#8217;ll do is listen to Pandora, hear a song I like, look up the song on YouTube, and save the [...]<p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/youtube-mp3">Automate YouTube Video and MP3 Rips with Bash Shell&nbsp;Scripting</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/youtube-ffmpeg-mp3-conversion' rel='bookmark' title='Permanent Link: YouTube, FFMPEG, and MP3&nbsp;Conversion'>YouTube, FFMPEG, and MP3&nbsp;Conversion</a></li><li><a
href='http://davidwalsh.name/convert-video-ffmpeg' rel='bookmark' title='Permanent Link: Convert Video Formats Using&nbsp;FFMPEG'>Convert Video Formats Using&nbsp;FFMPEG</a></li><li><a
href='http://davidwalsh.name/rules-audio-video-media' rel='bookmark' title='Permanent Link: 5 Rules For Using Audio/Video Media on Your&nbsp;Site'>5 Rules For Using Audio/Video Media on Your&nbsp;Site</a></li><li><a
href='http://davidwalsh.name/javascript-speed' rel='bookmark' title='Permanent Link: Video:  Speed Up Your&nbsp;JavaScript'>Video:  Speed Up Your&nbsp;JavaScript</a></li><li><a
href='http://davidwalsh.name/mootools-forge-script' rel='bookmark' title='Permanent Link: MooTools Forge / GitHub Plugin Structure Shell&nbsp;Script'>MooTools Forge / GitHub Plugin Structure Shell&nbsp;Script</a></li></ol>]]></description> <content:encoded><![CDATA[<p>I love listening to music while I code.  Listening to music keeps me from getting too frustrated about code that isn&#8217;t working (yes, it happens) or frustrations brought on by hosting providers, clients, etc.  What I&#8217;ll do is listen to Pandora, hear a song I like, look up the song on YouTube, and save the YouTube link in a text file for later listening.  Having to go to YouTube every time sucks so I set out to take YouTube videos linked in a text file and download them to my computer in MP3 format.</p><h2>The Text&nbsp;File</h2><pre class="text">

http://www.youtube.com/watch?v=iYtDqHupwrg


<object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/xZ23pVTPfSw&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/xZ23pVTPfSw&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object>


<object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/Rvw1ctGWfSs&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Rvw1ctGWfSs&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object>


<object width="500" height="306"><param name="movie" value="http://www.youtube.com/v/IXPOHCsgWFw&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/IXPOHCsgWFw&#038;fs=1" type="application/x-shockwave-flash" width="500" height="306" allowscriptaccess="always" allowfullscreen="true"></embed></object>


<object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/QF73Ypncwss&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/QF73Ypncwss&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object>


<object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/8nBmIetx_t8&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/8nBmIetx_t8&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object>


<object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/sw_x8XtngGM&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/sw_x8XtngGM&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object>

</pre><p>One link per line.</p><h2>The Bash&nbsp;Script</h2><pre class="shell">
#!/bin/sh
IFS=$'\n'
for line in `&lt; songs.txt`; do
	newfile=`youtube-dl.py -o %\(title\)s.%\(ext\)s $line | grep '^\[download\]' | cut -d ' ' -f 3-`
	ffmpeg -b 192k -i $newfile ${newfile/flv/mp3}
	rm $newfile
done
</pre><p>My script reads the file by line, downloads the YouTube video at the link provided by the text document, uses ffmpeg to rip the song into an MP3, and deleted the video.  Note that you&#8217;ll need YouTube-DL and FFMPEG to run this script;  this script is essentially a shortcut to achieve what was outlined in my post titled <a
href="http://davidwalsh.name/youtube-ffmpeg-mp3-conversion">YouTube, FFMPEG, and MP3 Conversion</a>.</p><p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/youtube-mp3">Automate YouTube Video and MP3 Rips with Bash Shell&nbsp;Scripting</a></p><p>Related posts:<ol><li><a
href='http://davidwalsh.name/youtube-ffmpeg-mp3-conversion' rel='bookmark' title='Permanent Link: YouTube, FFMPEG, and MP3&nbsp;Conversion'>YouTube, FFMPEG, and MP3&nbsp;Conversion</a></li><li><a
href='http://davidwalsh.name/convert-video-ffmpeg' rel='bookmark' title='Permanent Link: Convert Video Formats Using&nbsp;FFMPEG'>Convert Video Formats Using&nbsp;FFMPEG</a></li><li><a
href='http://davidwalsh.name/rules-audio-video-media' rel='bookmark' title='Permanent Link: 5 Rules For Using Audio/Video Media on Your&nbsp;Site'>5 Rules For Using Audio/Video Media on Your&nbsp;Site</a></li><li><a
href='http://davidwalsh.name/javascript-speed' rel='bookmark' title='Permanent Link: Video:  Speed Up Your&nbsp;JavaScript'>Video:  Speed Up Your&nbsp;JavaScript</a></li><li><a
href='http://davidwalsh.name/mootools-forge-script' rel='bookmark' title='Permanent Link: MooTools Forge / GitHub Plugin Structure Shell&nbsp;Script'>MooTools Forge / GitHub Plugin Structure Shell&nbsp;Script</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://davidwalsh.name/youtube-mp3/feed</wfw:commentRss> <slash:comments>15</slash:comments> </item> <item><title>Creating Git&#160;Aliases</title><link>http://davidwalsh.name/git-aliases</link> <comments>http://davidwalsh.name/git-aliases#comments</comments> <pubDate>Fri, 25 Sep 2009 13:18:04 +0000</pubDate> <dc:creator>David Walsh</dc:creator> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://davidwalsh.name/?p=3702</guid> <description><![CDATA[I create shortcuts for everything. I create variables which act as text shortcuts, shortcuts in TextMate to generate CSS/JS/HTML, and bash scripts so I don&#8217;t have to type in the same commands over and over again. So why should version control software be any different? I commit and push religiously so I create Git aliases [...]<p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/git-aliases">Creating Git&nbsp;Aliases</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/mootools-alias' rel='bookmark' title='Permanent Link: Using MooTools&#8217; Alias&nbsp;Functionality'>Using MooTools&#8217; Alias&nbsp;Functionality</a></li><li><a
href='http://davidwalsh.name/create-a-simple-slideshow-iii' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using MooTools, Part III: Creating a&nbsp;Class'>Create a Simple Slideshow Using MooTools, Part III: Creating a&nbsp;Class</a></li><li><a
href='http://davidwalsh.name/creating-advanced-xhtml-email-links-include-subject-cc-bcc-email-body' rel='bookmark' title='Permanent Link: Creating Advanced XHTML Email Links:  Include Subject, CC, BCC, and Email&nbsp;Body'>Creating Advanced XHTML Email Links:  Include Subject, CC, BCC, and Email&nbsp;Body</a></li><li><a
href='http://davidwalsh.name/mootools-print-links' rel='bookmark' title='Permanent Link: MooTools &#038; Printing &#8211; Creating a Links Table of&nbsp;Contents'>MooTools &#038; Printing &#8211; Creating a Links Table of&nbsp;Contents</a></li><li><a
href='http://davidwalsh.name/mootools-forge-script' rel='bookmark' title='Permanent Link: MooTools Forge / GitHub Plugin Structure Shell&nbsp;Script'>MooTools Forge / GitHub Plugin Structure Shell&nbsp;Script</a></li></ol>]]></description> <content:encoded><![CDATA[<p>I create shortcuts for everything.  I create variables which act as text shortcuts, shortcuts in TextMate to generate CSS/JS/HTML, and bash scripts so I don&#8217;t have to type in the same commands over and over again.  So why should version control software be any different?  I commit and push religiously so I create Git aliases to save myself a few keystrokes.</p><h2>Sample&nbsp;Aliases</h2><pre class="git">
#make "com" alias for "commit"
git config alias.com commit

#make "co" alias for checkout
git config alias.co checkout

#make "br" alias for branch
git config alias.br branch

# When you want to see just the differences of one function in one file in two different commits
git config alias.funcdiff '!sh -c "git show \"\$1:\$3\" | sed -n \"/^[^ \t].*\$4(/,/^}/p\" > .tmp1 &#038;&#038;
        git show \"\$2:\$3\" | sed -n \"/^[^ \t].*\$4(/,/^}/p\" > .tmp2 &#038;&#038;
        git diff --no-index .tmp1 .tmp2"' -

</pre><p>These are just some sample Git aliases.  You can view more detailed (and by detailed I mean brain-numbing) examples of git aliases at the <a
href="http://git.or.cz/gitwiki/Aliases">Git Wiki</a>.</p><p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/git-aliases">Creating Git&nbsp;Aliases</a></p><p>Related posts:<ol><li><a
href='http://davidwalsh.name/mootools-alias' rel='bookmark' title='Permanent Link: Using MooTools&#8217; Alias&nbsp;Functionality'>Using MooTools&#8217; Alias&nbsp;Functionality</a></li><li><a
href='http://davidwalsh.name/create-a-simple-slideshow-iii' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using MooTools, Part III: Creating a&nbsp;Class'>Create a Simple Slideshow Using MooTools, Part III: Creating a&nbsp;Class</a></li><li><a
href='http://davidwalsh.name/creating-advanced-xhtml-email-links-include-subject-cc-bcc-email-body' rel='bookmark' title='Permanent Link: Creating Advanced XHTML Email Links:  Include Subject, CC, BCC, and Email&nbsp;Body'>Creating Advanced XHTML Email Links:  Include Subject, CC, BCC, and Email&nbsp;Body</a></li><li><a
href='http://davidwalsh.name/mootools-print-links' rel='bookmark' title='Permanent Link: MooTools &#038; Printing &#8211; Creating a Links Table of&nbsp;Contents'>MooTools &#038; Printing &#8211; Creating a Links Table of&nbsp;Contents</a></li><li><a
href='http://davidwalsh.name/mootools-forge-script' rel='bookmark' title='Permanent Link: MooTools Forge / GitHub Plugin Structure Shell&nbsp;Script'>MooTools Forge / GitHub Plugin Structure Shell&nbsp;Script</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://davidwalsh.name/git-aliases/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>PNGCRUSH a Directory of&#160;Images</title><link>http://davidwalsh.name/pngcrush-directory</link> <comments>http://davidwalsh.name/pngcrush-directory#comments</comments> <pubDate>Thu, 24 Sep 2009 12:24:15 +0000</pubDate> <dc:creator>David Walsh</dc:creator> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://davidwalsh.name/?p=3713</guid> <description><![CDATA[One easy way of reducing website load time is by optimizing your images. PNG graphics are often more bloated than they need to be so using PNGCRUSH should be a no-brainer. PNGCRUSH&#8217;s basic usage provides only single-file-crushage but I&#8217;ve created a script that crushes PNGs in directories recursively. The Bash&#160;Script #!/bin/sh for png in `find [...]<p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/pngcrush-directory">PNGCRUSH a Directory of&nbsp;Images</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/pngcrush' rel='bookmark' title='Permanent Link: Reduce PNG Graphic Size Using&nbsp;PNGCRUSH'>Reduce PNG Graphic Size Using&nbsp;PNGCRUSH</a></li><li><a
href='http://davidwalsh.name/generate-photo-gallery' rel='bookmark' title='Permanent Link: Automatically Generate a Photo Gallery from a Directory of Images:&nbsp;Updated'>Automatically Generate a Photo Gallery from a Directory of Images:&nbsp;Updated</a></li><li><a
href='http://davidwalsh.name/password-protect-directory-using-htaccess' rel='bookmark' title='Permanent Link: Password Protect a Directory Using&nbsp;.htaccess'>Password Protect a Directory Using&nbsp;.htaccess</a></li><li><a
href='http://davidwalsh.name/directory-index-homepage-htaccess' rel='bookmark' title='Permanent Link: Set Your Directory Index (Homepage) Using&nbsp;.htaccess'>Set Your Directory Index (Homepage) Using&nbsp;.htaccess</a></li><li><a
href='http://davidwalsh.name/prevent-directory-listings-with-htaccess' rel='bookmark' title='Permanent Link: Prevent Directory Listings With&nbsp;.htaccess'>Prevent Directory Listings With&nbsp;.htaccess</a></li></ol>]]></description> <content:encoded><![CDATA[<p>One easy way of reducing website load time is by optimizing your images.  PNG graphics are often more bloated than they need to be so using PNGCRUSH should be a no-brainer.  PNGCRUSH&#8217;s basic usage provides only single-file-crushage but I&#8217;ve created a script that crushes PNGs in directories recursively.</p><h2>The Bash&nbsp;Script</h2><pre class="shell">
#!/bin/sh
for png in `find $1 -name "*.png"`;
do
	echo "crushing $png"	
	pngcrush -brute "$png" temp.png
	mv -f temp.png $png
done;
</pre><p>Do whatever you can to compress your images so that your website will load as quickly as possible.  PNGCRUSHing your images does not cause a loss of quality &#8212; only a loss of excess file size!  PNGCRUSHing my images saved over 120KB of bloated imagery for the recent redesign.</p><p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/pngcrush-directory">PNGCRUSH a Directory of&nbsp;Images</a></p><p>Related posts:<ol><li><a
href='http://davidwalsh.name/pngcrush' rel='bookmark' title='Permanent Link: Reduce PNG Graphic Size Using&nbsp;PNGCRUSH'>Reduce PNG Graphic Size Using&nbsp;PNGCRUSH</a></li><li><a
href='http://davidwalsh.name/generate-photo-gallery' rel='bookmark' title='Permanent Link: Automatically Generate a Photo Gallery from a Directory of Images:&nbsp;Updated'>Automatically Generate a Photo Gallery from a Directory of Images:&nbsp;Updated</a></li><li><a
href='http://davidwalsh.name/password-protect-directory-using-htaccess' rel='bookmark' title='Permanent Link: Password Protect a Directory Using&nbsp;.htaccess'>Password Protect a Directory Using&nbsp;.htaccess</a></li><li><a
href='http://davidwalsh.name/directory-index-homepage-htaccess' rel='bookmark' title='Permanent Link: Set Your Directory Index (Homepage) Using&nbsp;.htaccess'>Set Your Directory Index (Homepage) Using&nbsp;.htaccess</a></li><li><a
href='http://davidwalsh.name/prevent-directory-listings-with-htaccess' rel='bookmark' title='Permanent Link: Prevent Directory Listings With&nbsp;.htaccess'>Prevent Directory Listings With&nbsp;.htaccess</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://davidwalsh.name/pngcrush-directory/feed</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>YouTube, FFMPEG, and MP3&#160;Conversion</title><link>http://davidwalsh.name/youtube-ffmpeg-mp3-conversion</link> <comments>http://davidwalsh.name/youtube-ffmpeg-mp3-conversion#comments</comments> <pubDate>Tue, 07 Jul 2009 13:08:15 +0000</pubDate> <dc:creator>David Walsh</dc:creator> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://davidwalsh.name/?p=3102</guid> <description><![CDATA[Yesterday I published a quick post about a basic MPEG -&#62; FLV video conversion method using FFMPEG. Today I want to share another great usage of FFMPEG: stripping a video&#8217;s audio and creating an MP3. As an added bonus, I&#8217;ll be ripping the audio from a great YouTube video using youtube-dl, a python script with [...]<p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/youtube-ffmpeg-mp3-conversion">YouTube, FFMPEG, and MP3&nbsp;Conversion</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/youtube-mp3' rel='bookmark' title='Permanent Link: Automate YouTube Video and MP3 Rips with Bash Shell&nbsp;Scripting'>Automate YouTube Video and MP3 Rips with Bash Shell&nbsp;Scripting</a></li><li><a
href='http://davidwalsh.name/convert-video-ffmpeg' rel='bookmark' title='Permanent Link: Convert Video Formats Using&nbsp;FFMPEG'>Convert Video Formats Using&nbsp;FFMPEG</a></li><li><a
href='http://davidwalsh.name/rules-audio-video-media' rel='bookmark' title='Permanent Link: 5 Rules For Using Audio/Video Media on Your&nbsp;Site'>5 Rules For Using Audio/Video Media on Your&nbsp;Site</a></li><li><a
href='http://davidwalsh.name/javascript-good-parts-video' rel='bookmark' title='Permanent Link: JavaScript:  The Good Parts by Douglas&nbsp;Crockford'>JavaScript:  The Good Parts by Douglas&nbsp;Crockford</a></li><li><a
href='http://davidwalsh.name/javascript-speed' rel='bookmark' title='Permanent Link: Video:  Speed Up Your&nbsp;JavaScript'>Video:  Speed Up Your&nbsp;JavaScript</a></li></ol>]]></description> <content:encoded><![CDATA[<img
src="http://davidwalsh.name/dw-content/rod.jpg" alt="Rod Stewart and Ron Wood" class="image" /><p>Yesterday I published a quick post about a basic <a
href="http://davidwalsh.name/convert-video-ffmpeg">MPEG -&gt; FLV video conversion method using FFMPEG</a>.  Today I want to share another great usage of FFMPEG:  stripping a video&#8217;s audio and creating an MP3.  As an added bonus, I&#8217;ll be ripping the audio from a <a
href="http://www.youtube.com/watch?v=tlWpnLdPwvk">great YouTube video</a> using <a
href="http://bitbucket.org/rg3/youtube-dl/wiki/Home">youtube-dl</a>, a python script with loads of options for downloading YouTube videos.</p><h2>The youtube-dl Shell&nbsp;Script</h2><pre class="shell">
#command
davidwalsh83$ youtube-dl.py http://www.youtube.com/watch?v=tlWpnLdPwvk

#output
[youtube] Setting language
[youtube] tlWpnLdPwvk: Downloading video webpage
[youtube] tlWpnLdPwvk: Extracting video information
[youtube] tlWpnLdPwvk: URL: http://www.youtube.com/get_video?video_id=tlWpnLdPwvk&#038;t=vjVQa1PpcFMZ4TkTSYXamGxmLZq-ot2l8Jx-HiNAf0I=&#038;el=detailpage&#038;ps=
[download] Destination: tlWpnLdPwvk.flv
[download] 100.0% of 18.78M at   53.98k/s ETA 00:00
</pre><p>The initial install of youtube-dl was tough but only because I&#8217;m not well-versed with the permissions side of Unix.  I eventually figured it out but if you have trouble installing youtube-dl or simply want to use its advanced options, check out <a
href="http://bitbucket.org/rg3/youtube-dl/wiki/Home">youtube-dl&#8217;s documentation</a>.  youtube-dl also provides an option to read a text file with a list of videos and will do a batch download. <em>Note: youtube-dl allows you to set an output file name but it didn&#8217;t appear to be working.</em> If you&#8217;d like a more simple method, Mark Sanborn wrote a great post on <a
href="http://www.marksanborn.net/howto/using-wget-to-download-youtube-videos/">ripping YouTube videos using wget</a>.</p><h2>The FFMPEG Shell&nbsp;Script</h2><pre class="shell">
davidwalsh83$ ffmpeg -i tlWpnLdPwvk.flv RodStewartMaggieMay.mp3
</pre><p>As I did with youtube-dl, I chose the most basic usage of FFMPEG. <a
href="http://www.ffmpeg.org/ffmpeg-doc.html">FFMPEG&#8217;s documentation</a> provides you a list of all of the possible conversion options if you need them.</p><h2>The&nbsp;Result</h2>[audio:RodStewartMaggieMay.mp3]<p>Use the video player above to listen to the result.  The video I chose is a live version of Maggie May by Rod Stewart recorded at Royal Albert Hall in the Knightsbridge area of the City of Westminster, London, England.  The video is from Rod&#8217;s <a
href="http://www.amazon.com/One-Night-Only-Stewart-Albert/dp/B00064VR0W/ref=sr_1_1?ie=UTF8&amp;s=music&amp;qid=1246897303&amp;sr=8-1">One Night Only DVD</a> which I HIGHLY recommend.  This is the best version of Maggie May that exists (my opinion but, as you know, when is my opinion not correct?)  Enjoy!</p><p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/youtube-ffmpeg-mp3-conversion">YouTube, FFMPEG, and MP3&nbsp;Conversion</a></p><p>Related posts:<ol><li><a
href='http://davidwalsh.name/youtube-mp3' rel='bookmark' title='Permanent Link: Automate YouTube Video and MP3 Rips with Bash Shell&nbsp;Scripting'>Automate YouTube Video and MP3 Rips with Bash Shell&nbsp;Scripting</a></li><li><a
href='http://davidwalsh.name/convert-video-ffmpeg' rel='bookmark' title='Permanent Link: Convert Video Formats Using&nbsp;FFMPEG'>Convert Video Formats Using&nbsp;FFMPEG</a></li><li><a
href='http://davidwalsh.name/rules-audio-video-media' rel='bookmark' title='Permanent Link: 5 Rules For Using Audio/Video Media on Your&nbsp;Site'>5 Rules For Using Audio/Video Media on Your&nbsp;Site</a></li><li><a
href='http://davidwalsh.name/javascript-good-parts-video' rel='bookmark' title='Permanent Link: JavaScript:  The Good Parts by Douglas&nbsp;Crockford'>JavaScript:  The Good Parts by Douglas&nbsp;Crockford</a></li><li><a
href='http://davidwalsh.name/javascript-speed' rel='bookmark' title='Permanent Link: Video:  Speed Up Your&nbsp;JavaScript'>Video:  Speed Up Your&nbsp;JavaScript</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://davidwalsh.name/youtube-ffmpeg-mp3-conversion/feed</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Convert Video Formats Using&#160;FFMPEG</title><link>http://davidwalsh.name/convert-video-ffmpeg</link> <comments>http://davidwalsh.name/convert-video-ffmpeg#comments</comments> <pubDate>Mon, 06 Jul 2009 11:13:54 +0000</pubDate> <dc:creator>David Walsh</dc:creator> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://davidwalsh.name/?p=3023</guid> <description><![CDATA[Getting a video into the format you like can be important when providing media to your users on the web. Unfortunately your customer or video source may not give you media in the desired format. No problem: use the FFMPEG library to quickly and easily convert your media from and to any format you&#8217;d like. [...]<p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/convert-video-ffmpeg">Convert Video Formats Using&nbsp;FFMPEG</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/youtube-ffmpeg-mp3-conversion' rel='bookmark' title='Permanent Link: YouTube, FFMPEG, and MP3&nbsp;Conversion'>YouTube, FFMPEG, and MP3&nbsp;Conversion</a></li><li><a
href='http://davidwalsh.name/youtube-mp3' rel='bookmark' title='Permanent Link: Automate YouTube Video and MP3 Rips with Bash Shell&nbsp;Scripting'>Automate YouTube Video and MP3 Rips with Bash Shell&nbsp;Scripting</a></li><li><a
href='http://davidwalsh.name/rules-audio-video-media' rel='bookmark' title='Permanent Link: 5 Rules For Using Audio/Video Media on Your&nbsp;Site'>5 Rules For Using Audio/Video Media on Your&nbsp;Site</a></li><li><a
href='http://davidwalsh.name/track-file-downloads-google-analytics-mootools' rel='bookmark' title='Permanent Link: Track File Downloads in Google Analytics Using&nbsp;MooTools'>Track File Downloads in Google Analytics Using&nbsp;MooTools</a></li><li><a
href='http://davidwalsh.name/javascript-speed' rel='bookmark' title='Permanent Link: Video:  Speed Up Your&nbsp;JavaScript'>Video:  Speed Up Your&nbsp;JavaScript</a></li></ol>]]></description> <content:encoded><![CDATA[<img
src="http://davidwalsh.name/dw-content/ffmpeg.jpg" alt="FFMPEG" class="image" /><p>Getting a video into the format you like can be important when providing media to your users on the web.  Unfortunately your customer or video source may not give you media in the desired format.  No problem:  use the <a
href="http://ffmpeg.org/index.html">FFMPEG</a> library to quickly and easily convert your media from and to any format you&#8217;d like.</p><h2>Installing&nbsp;FFMPEG</h2><pre class="shell">
sudo port install ffmpegx
</pre><p>The above installs FFMPEG with MacPorts.  The install process took quite a while because FFMPEG required that I upgrade quite a few packages.  Be patient&#8230;it&#8217;s worth it.</p><h2>Basic Conversion Shell&nbsp;Script</h2><pre class="shell">
ffmpeg -i myVideo.mpeg myVideo.flv
</pre><p>This is a very basic conversion directive.  Since Flash video has become the standard for embedding video, I&#8217;ve chosen to convert to the FLV format.  If you want to control more of the conversion details, <a
href="http://ffmpeg.org/documentation.html">grab the documentation</a> and experiment.  I&#8217;ve installed FFMPEG on a few websites and used PHP to direct FFMPEG to dynamically generate videos.</p><p>If you need to take control of your media, try FFMPEG.  FFMPEG also has a <a
href="http://www.macupdate.com/info.php/id/31364/ivideo-converter">GUI version</a> if you prefer to avoid command line.</p><p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/convert-video-ffmpeg">Convert Video Formats Using&nbsp;FFMPEG</a></p><p>Related posts:<ol><li><a
href='http://davidwalsh.name/youtube-ffmpeg-mp3-conversion' rel='bookmark' title='Permanent Link: YouTube, FFMPEG, and MP3&nbsp;Conversion'>YouTube, FFMPEG, and MP3&nbsp;Conversion</a></li><li><a
href='http://davidwalsh.name/youtube-mp3' rel='bookmark' title='Permanent Link: Automate YouTube Video and MP3 Rips with Bash Shell&nbsp;Scripting'>Automate YouTube Video and MP3 Rips with Bash Shell&nbsp;Scripting</a></li><li><a
href='http://davidwalsh.name/rules-audio-video-media' rel='bookmark' title='Permanent Link: 5 Rules For Using Audio/Video Media on Your&nbsp;Site'>5 Rules For Using Audio/Video Media on Your&nbsp;Site</a></li><li><a
href='http://davidwalsh.name/track-file-downloads-google-analytics-mootools' rel='bookmark' title='Permanent Link: Track File Downloads in Google Analytics Using&nbsp;MooTools'>Track File Downloads in Google Analytics Using&nbsp;MooTools</a></li><li><a
href='http://davidwalsh.name/javascript-speed' rel='bookmark' title='Permanent Link: Video:  Speed Up Your&nbsp;JavaScript'>Video:  Speed Up Your&nbsp;JavaScript</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://davidwalsh.name/convert-video-ffmpeg/feed</wfw:commentRss> <slash:comments>16</slash:comments> </item> <item><title>Reduce PNG Graphic Size Using&#160;PNGCRUSH</title><link>http://davidwalsh.name/pngcrush</link> <comments>http://davidwalsh.name/pngcrush#comments</comments> <pubDate>Thu, 02 Jul 2009 12:39:45 +0000</pubDate> <dc:creator>David Walsh</dc:creator> <category><![CDATA[Optimization]]></category> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://davidwalsh.name/?p=2986</guid> <description><![CDATA[Now that I&#8217;m knee-deep in MacBook I love working with command line applications. There&#8217;s a certain beauty in the simplicity of using the console instead of a nice GUI. One task I use the console for often is reducing the size of PNG files using the powerhouse that is PNGCRUSH. The Shell&#160;Script # directive pngcrush [...]<p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/pngcrush">Reduce PNG Graphic Size Using&nbsp;PNGCRUSH</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/pngcrush-directory' rel='bookmark' title='Permanent Link: PNGCRUSH a Directory of&nbsp;Images'>PNGCRUSH a Directory of&nbsp;Images</a></li><li><a
href='http://davidwalsh.name/php-timer-benchmark' rel='bookmark' title='Permanent Link: PHP Optimization &#8211; Using A Timer To Benchmark Code And Increase&nbsp;Speed'>PHP Optimization &#8211; Using A Timer To Benchmark Code And Increase&nbsp;Speed</a></li><li><a
href='http://davidwalsh.name/firebug-console-log' rel='bookmark' title='Permanent Link: Logging Information to the Firebug JavaScript&nbsp;Console'>Logging Information to the Firebug JavaScript&nbsp;Console</a></li><li><a
href='http://davidwalsh.name/furl-retrieve-website-headers' rel='bookmark' title='Permanent Link: Use FURL to Retrieve Website&nbsp;Headers'>Use FURL to Retrieve Website&nbsp;Headers</a></li><li><a
href='http://davidwalsh.name/php-mysql-database-optimization-function' rel='bookmark' title='Permanent Link: PHP / MySQL Database Optimization&nbsp;Function'>PHP / MySQL Database Optimization&nbsp;Function</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Now that I&#8217;m knee-deep in MacBook I love working with command line applications.  There&#8217;s a certain beauty in the simplicity of using the console instead of a nice GUI.  One task I use the console for often is reducing the size of PNG files using the powerhouse that is PNGCRUSH.</p><h2>The Shell&nbsp;Script</h2><pre class="shell">
# directive
pngcrush -reduce -brute source.png destination.png

#result
Best pngcrush method = 113 (fm 0 zl 9 zs 0) for destination.png
     (33.38% IDAT reduction)
     (33.43% filesize reduction)

   CPU time used = 835.707 seconds (decoding 151.450,
          encoding 679.145, other 5.112 seconds)
</pre><p>The above directive is a basic usage of PNGCRUSH.  PNGCRUSH offers a wealth of options that allow you to optimize your PNGs.  If you use many PNGs on your website, optimizing them using PNGCRUSH is a must.  Using the above directive, PNGCRUSH took a 11.7MB down to 7.8MB. <strong>NO QUALITY LOSS</strong>.  Sure it took over 10 minutes, but think of the bandwidth your site will save.</p><p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/pngcrush">Reduce PNG Graphic Size Using&nbsp;PNGCRUSH</a></p><p>Related posts:<ol><li><a
href='http://davidwalsh.name/pngcrush-directory' rel='bookmark' title='Permanent Link: PNGCRUSH a Directory of&nbsp;Images'>PNGCRUSH a Directory of&nbsp;Images</a></li><li><a
href='http://davidwalsh.name/php-timer-benchmark' rel='bookmark' title='Permanent Link: PHP Optimization &#8211; Using A Timer To Benchmark Code And Increase&nbsp;Speed'>PHP Optimization &#8211; Using A Timer To Benchmark Code And Increase&nbsp;Speed</a></li><li><a
href='http://davidwalsh.name/firebug-console-log' rel='bookmark' title='Permanent Link: Logging Information to the Firebug JavaScript&nbsp;Console'>Logging Information to the Firebug JavaScript&nbsp;Console</a></li><li><a
href='http://davidwalsh.name/furl-retrieve-website-headers' rel='bookmark' title='Permanent Link: Use FURL to Retrieve Website&nbsp;Headers'>Use FURL to Retrieve Website&nbsp;Headers</a></li><li><a
href='http://davidwalsh.name/php-mysql-database-optimization-function' rel='bookmark' title='Permanent Link: PHP / MySQL Database Optimization&nbsp;Function'>PHP / MySQL Database Optimization&nbsp;Function</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://davidwalsh.name/pngcrush/feed</wfw:commentRss> <slash:comments>22</slash:comments> </item> <item><title>Use FURL to Retrieve Website&#160;Headers</title><link>http://davidwalsh.name/furl-retrieve-website-headers</link> <comments>http://davidwalsh.name/furl-retrieve-website-headers#comments</comments> <pubDate>Fri, 26 Jun 2009 12:39:26 +0000</pubDate> <dc:creator>David Walsh</dc:creator> <category><![CDATA[Apache / Server]]></category> <category><![CDATA[Shell]]></category><guid
isPermaLink="false">http://davidwalsh.name/?p=2990</guid> <description><![CDATA[It&#8217;s important to know what headers your website and its files are communicating. For example, if your website is providing a 404 status, you&#8217;re probably streaking toward your computer to fix the problem. Using the FURL library, you may retrieve website headers from the command line. The Shell&#160;Script furl http://davidwalsh.name Simple and quick &#8212; just [...]<p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/furl-retrieve-website-headers">Use FURL to Retrieve Website&nbsp;Headers</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/php-header-mime' rel='bookmark' title='Permanent Link: PHP Headers and Popular Mime&nbsp;Types'>PHP Headers and Popular Mime&nbsp;Types</a></li><li><a
href='http://davidwalsh.name/introducing-band-website-template' rel='bookmark' title='Permanent Link: Introducing Band Website Template &#8211; Get a Website That Rocks Like&nbsp;You!'>Introducing Band Website Template &#8211; Get a Website That Rocks Like&nbsp;You!</a></li><li><a
href='http://davidwalsh.name/cygwin-dig-dns-records' rel='bookmark' title='Permanent Link: Using Cygwin&#8217;s dig To Retrieve DNS&nbsp;Records'>Using Cygwin&#8217;s dig To Retrieve DNS&nbsp;Records</a></li><li><a
href='http://davidwalsh.name/php-google-analytics' rel='bookmark' title='Permanent Link: Retrieve Google Analytics Visits and PageViews with&nbsp;PHP'>Retrieve Google Analytics Visits and PageViews with&nbsp;PHP</a></li><li><a
href='http://davidwalsh.name/optimizing-content-print-css' rel='bookmark' title='Permanent Link: Optimizing Your Website Content For Print Using&nbsp;CSS'>Optimizing Your Website Content For Print Using&nbsp;CSS</a></li></ol>]]></description> <content:encoded><![CDATA[<p>It&#8217;s important to know what headers your website and its files are communicating.  For example, if your website is providing a 404 status, you&#8217;re probably streaking toward your computer to fix the problem.  Using the FURL library, you may retrieve website headers from the command line.</p><h2>The Shell&nbsp;Script</h2><pre class="shell">
furl http://davidwalsh.name
</pre><p>Simple and quick &#8212; just like every shell directive.</p><h2>The Sample&nbsp;Response</h2><pre class="shell">
HTTP/1.1 200 OK
Date: Thu, 25 Jun 2009 01:50:50 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.2.6
X-Pingback: http://davidwalsh.name/xmlrpc.php
Cache-Control: max-age=1, private, must-revalidate
Expires: Thu, 25 Jun 2009 01:50:51 GMT
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=UTF-8
</pre><p>Don&#8217;t have FURL?  Install it by scripting this:</p><pre class="shell">
sudo port install furl
</pre><p>How is this useful?  I would use this to periodically (cron) check my website to make sure it was up.  What would you use this for?</p><p><strong>Follow Me!</strong> <a
href="http://twitter.com/davidwalshblog">Twitter</a> | <a
href="http://www.facebook.com/#!/pages/David-Walsh-Blog/186644584869">Facebook</a> | <a
href="http://www.linkedin.com/in/davidjameswalsh">LinkedIn</a> | <a
href="http://mootools.net/forge/profile/davidwalsh">MooTools Forge.</a><br/><br/>Full David Walsh Blog Post: <a
href="http://davidwalsh.name/furl-retrieve-website-headers">Use FURL to Retrieve Website&nbsp;Headers</a></p><p>Related posts:<ol><li><a
href='http://davidwalsh.name/php-header-mime' rel='bookmark' title='Permanent Link: PHP Headers and Popular Mime&nbsp;Types'>PHP Headers and Popular Mime&nbsp;Types</a></li><li><a
href='http://davidwalsh.name/introducing-band-website-template' rel='bookmark' title='Permanent Link: Introducing Band Website Template &#8211; Get a Website That Rocks Like&nbsp;You!'>Introducing Band Website Template &#8211; Get a Website That Rocks Like&nbsp;You!</a></li><li><a
href='http://davidwalsh.name/cygwin-dig-dns-records' rel='bookmark' title='Permanent Link: Using Cygwin&#8217;s dig To Retrieve DNS&nbsp;Records'>Using Cygwin&#8217;s dig To Retrieve DNS&nbsp;Records</a></li><li><a
href='http://davidwalsh.name/php-google-analytics' rel='bookmark' title='Permanent Link: Retrieve Google Analytics Visits and PageViews with&nbsp;PHP'>Retrieve Google Analytics Visits and PageViews with&nbsp;PHP</a></li><li><a
href='http://davidwalsh.name/optimizing-content-print-css' rel='bookmark' title='Permanent Link: Optimizing Your Website Content For Print Using&nbsp;CSS'>Optimizing Your Website Content For Print Using&nbsp;CSS</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://davidwalsh.name/furl-retrieve-website-headers/feed</wfw:commentRss> <slash:comments>9</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 126/365 queries in 2.352 seconds using disk

Served from: davidwalsh.name @ 2010-09-02 23:11:30 -->