<?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>Likesalmon Design &#187; Solutions</title>
	<atom:link href="http://www.likesalmondesign.com/category/solutions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.likesalmondesign.com</link>
	<description>Open Source Web Design and Development from Scratch</description>
	<lastBuildDate>Tue, 15 Jun 2010 03:51:47 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Imagemagick: use montage to proof images</title>
		<link>http://www.likesalmondesign.com/imagemagick-use-montage-to-proof-images/</link>
		<comments>http://www.likesalmondesign.com/imagemagick-use-montage-to-proof-images/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 03:51:47 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Imagemagick]]></category>
		<category><![CDATA[montage]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=359</guid>
		<description><![CDATA[The following command will create an image called montage.png that is a collection of all the .png files in the current directory.  Images larger than 150px on a side will be resized, but aspect ratio is preserved.  The images are separated by a 2px offset.
$ montage *.png -geometry 150x150\>+2+2 montage.png
]]></description>
			<content:encoded><![CDATA[<p>The following command will create an image called montage.png that is a collection of all the .png files in the current directory.  Images larger than 150px on a side will be resized, but aspect ratio is preserved.  The images are separated by a 2px offset.</p>
<p><code>$ montage *.png -geometry 150x150\>+2+2 montage.png</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/imagemagick-use-montage-to-proof-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image Magick: Resize a batch of images so they all come out square, and preserve filenames</title>
		<link>http://www.likesalmondesign.com/image-magick-resize-a-batch-of-images-so-they-all-come-out-square-and-preserve-filenames/</link>
		<comments>http://www.likesalmondesign.com/image-magick-resize-a-batch-of-images-so-they-all-come-out-square-and-preserve-filenames/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 04:05:12 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Image Magick]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=331</guid>
		<description><![CDATA[The following command will shrink all .jpg&#8217;s in the current directory that are larger than 500px and center them on a square 500&#215;500px canvas.  Since the aspect ratio of the original images will be preserved and not all of the originals are square, the left over space will be filled with an off-white color. [...]]]></description>
			<content:encoded><![CDATA[<p>The following command will shrink all .jpg&#8217;s in the current directory that are larger than 500px and center them on a square 500&#215;500px canvas.  Since the aspect ratio of the original images will be preserved and not all of the originals are square, the left over space will be filled with an off-white color.  All the modified images will be placed in a directory called &#8216;resized&#8217;.  Original filenames will be preserved.</p>
<p><code>mogrify -path resized -resize 500x500\> -background 'rgb(217,215,202)' -extent 500x500 -gravity center *.jpg</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/image-magick-resize-a-batch-of-images-so-they-all-come-out-square-and-preserve-filenames/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image Magick: Resize a batch of images and preserve the original file names</title>
		<link>http://www.likesalmondesign.com/image-magick-resize-a-batch-of-images-and-preserve-the-original-file-names/</link>
		<comments>http://www.likesalmondesign.com/image-magick-resize-a-batch-of-images-and-preserve-the-original-file-names/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 03:21:50 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Image Magick]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=327</guid>
		<description><![CDATA[The following command will resize any and all .jpg&#8217;s in the current directory that are larger than 500px on either side and put them in a file called &#8216;resized&#8217;.  Aspect ratios will be respected, and the same filenames will be used for the modified images.
mogrify -path resized -resize 500&#62;x500\&#62; *.jpg
Yes, you have to use [...]]]></description>
			<content:encoded><![CDATA[<p>The following command will resize any and all .jpg&#8217;s in the current directory that are larger than 500px on either side and put them in a file called &#8216;resized&#8217;.  Aspect ratios will be respected, and the same filenames will be used for the modified images.</p>
<p><code>mogrify -path resized -resize 500&gt;x500\&gt; *.jpg</code></p>
<p>Yes, you have to use <code>mogrify</code> and not <code>convert</code> because only <code>mogrify</code> excepts the <code>-path</code> command.  And I&#8217;m pretty sure it&#8217;s important to escape the greater than symbols in the <code>-path</code> argument like I did.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/image-magick-resize-a-batch-of-images-and-preserve-the-original-file-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use source to import large .sql files</title>
		<link>http://www.likesalmondesign.com/use-source-to-import-large-sql-files/</link>
		<comments>http://www.likesalmondesign.com/use-source-to-import-large-sql-files/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 05:38:41 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[Solutions]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=307</guid>
		<description><![CDATA[Its true, don&#8217;t waste your time with strange scripts and such if you&#8217;re trying to upload an .sql file that exceeds the limit.  Just give up and use source. Note: don&#8217;t be confused that I don&#8217;t capitalise my MySQL commands.  Its my silent protest against standard MySQL syntax: I think capitalising commands you [...]]]></description>
			<content:encoded><![CDATA[<p>Its true, don&#8217;t waste your time with strange scripts and such if you&#8217;re trying to upload an .sql file that exceeds the limit.  Just give up and use <code>source</code>. <em>Note: don&#8217;t be confused that I don&#8217;t capitalise my MySQL commands.  Its my silent protest against standard MySQL syntax: I think capitalising commands you have to type over and over is dumb.  SOURCE is the same as source.</em></p>
<ol>
<li>Upload the .sql file to your server somewhere, preferably with <a href="http://www.likesalmondesign.com/lftp-is-awesome/" title="lftp is awesome!">lftp</a></li>
<li>ssh to your server: <code>$ ssh  username@username.hostname.com</code></li>
<li>Start mysql: <code>$ mysql -u <em>username</em> -p <em>password</em></code></li>
<li>Find the correct table: <code>$ show databases;</code></li>
<li>Access the database you want to import to: <code>$ use <em>databasename</em>;</code></li>
<li>And finally the source command: <code>$ source <em>path/to/filename.sql</em></code></li>
</ol>
<p>I used several sources for this, but <a href="http://www.johnon.com/import-large-file-into-mysql/" title="John Andrews: Import Large File into MySQL">John Andrews</a> was the angriest.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/use-source-to-import-large-sql-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The better way to install LAMP on Ubuntu Karmic 9.10</title>
		<link>http://www.likesalmondesign.com/the-better-way-to-install-lamp-on-ubuntu-karmic-9-10/</link>
		<comments>http://www.likesalmondesign.com/the-better-way-to-install-lamp-on-ubuntu-karmic-9-10/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 03:30:44 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=295</guid>
		<description><![CDATA[All this comes from here:
https://help.ubuntu.com/community/ApacheMySQLPHP
In the teminal:

$ sudo tasksel install lamp-server
$ sudo apt-get install phpmyadmin
$ sudo gedit /etc/apache2/apache2.conf

Add the following to the end of this file:  &#8220;Include /etc/phpmyadmin/apache.conf&#8221;


Edit the /etc/php5/apache2/php.ini file and increase the memory_limit value.  I used 64M, but that may be overkill.

]]></description>
			<content:encoded><![CDATA[<p>All this comes from here:</p>
<p><a href="https://help.ubuntu.com/community/ApacheMySQLPHP" title="Ubuntu is rad, right?">https://help.ubuntu.com/community/ApacheMySQLPHP</a></p>
<p>In the teminal:</p>
<ul>
<li>$ sudo tasksel install lamp-server</li>
<li>$ sudo apt-get install phpmyadmin</li>
<li>$ sudo gedit /etc/apache2/apache2.conf
<ul>
<li>Add the following to the end of this file:  &#8220;Include /etc/phpmyadmin/apache.conf&#8221;</li>
</ul>
</li>
<li>Edit the /etc/php5/apache2/php.ini file and increase the <em>memory_limit</em> value.  I used 64M, but that may be overkill.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/the-better-way-to-install-lamp-on-ubuntu-karmic-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash aliases: create your own bash shortcuts!</title>
		<link>http://www.likesalmondesign.com/bash-aliases-create-your-own-bash-shortcuts/</link>
		<comments>http://www.likesalmondesign.com/bash-aliases-create-your-own-bash-shortcuts/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 02:13:12 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=286</guid>
		<description><![CDATA[When I&#8217;m building websites especially, I have to work with a lot of deeply nested files.  But typing cd ~/public_html/websitename/wp-content/themes/themename/ in the terminal every time is giving me carpal tunnel, so I found a better way:
First open ~/.barshrc in a text editor and uncomment lines 73 through 75 so they look like this:
if [ [...]]]></description>
			<content:encoded><![CDATA[<p>When I&#8217;m building websites especially, I have to work with a lot of deeply nested files.  But typing <code>cd ~/public_html/websitename/wp-content/themes/themename/</code> in the terminal every time is giving me carpal tunnel, so I found a better way:</p>
<p>First open ~/.barshrc in a text editor and uncomment lines 73 through 75 so they look like this:</p>
<p><code>if [ -f ~/.bash_aliases ]; then<br />
. ~/.bash_aliases<br />
fi</code></p>
<p>Then create a file called <code>.bash_aliases</code> in your home directory (if it doesn&#8217;t already exist).  Edit that file like so:</p>
<p><code>alias themename="cd ~/public_html/websitename/wp-content/themes/themename/"<br />
</code></p>
<p>Restart terminal (<em>or source .bashrc with <code>$ source ~/.bashrc</code>, or even terser <code>$. .bashrc</code></em>), type in <code>themename</code> and press enter.  Voila!  Your are cd&#8217;ed all the way into that deeply nested file without having to type the whole thing.  This works great for lots of other common commands that are a little too verbose:</p>
<p><code>alias ins="sudo apt-get install"<br />
</code></p>
<p>Once those lines are added to your <code>.bash_aliases</code> file and you restart terminal, you will be able to install new packages like so:</p>
<p><code>ins <em>packagename</em></code></p>
<p>Handy eh?  (That last suggestion is courtesy of the always useful <a title="Go to the Lifehacker website" href="http://lifehacker.com/270799/create-terminal-shortcuts">Lifehacker</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/bash-aliases-create-your-own-bash-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to configure Apache virtual hosting in Ubuntu Karmic 9.10</title>
		<link>http://www.likesalmondesign.com/how-to-configure-apache-virtual-hosting-in-ubuntu-karmic-9-10/</link>
		<comments>http://www.likesalmondesign.com/how-to-configure-apache-virtual-hosting-in-ubuntu-karmic-9-10/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 03:38:56 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Virtual Hosts]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=283</guid>
		<description><![CDATA[Before you do anything, back up your original config files.  I used to just create a copy of the files with the suffix &#8220;.bak&#8221; (sudo cp example.conf example.conf.bak), which works, but creates a lot of clutter.  Now I use a great little utility called etckeeper which automatically places all files in /etc under [...]]]></description>
			<content:encoded><![CDATA[<p>Before you do anything, back up your original config files.  I used to just create a copy of the files with the suffix &#8220;.bak&#8221; (<code>sudo cp example.conf example.conf.bak</code>), which works, but creates a lot of clutter.  Now I use a great little utility called <em>etckeeper</em> which automatically places all files in /etc under version control using Bazaar.  It also automatically performs a commit each day if you forget to.  You can get etckeeper by typing this in the terminal: <code>sudo apt-get install etckeeper</code>.</p>
<h3>Update, 3/29/10</h3>
<p>I just had to do this from scratch after a computer disaster, and I found an omission.  Before you get started on this business you need to do what this post says:</p>
<p>http://www.likesalmondesign.com/use-your-users-public_html-directory-to-serve-webpages/</p>
<h3>And we&#8217;re off</h3>
<p>Now on to virtual hosts.  The first thing you need to do is edit /etc/hosts so your computer knows where to look for your website:</p>
<ol>
<li>In the terminal, enter: <code>$ sudo gedit /etc/hosts</code></li>
<li>In gedit, add the following line to the hosts file: <code>127.0.0.1 mysite.dev</code>
<ul>
<li>Note: you can use whatever name you want for your virtual hosted site.  I like to use the suffix <em>.dev</em> because it won&#8217;t conflict with sites on the actual internet.</li>
<li>Note: 127.0.0.1 is the same ip address that is assigned to localhost in that file.  If yours is different, use that one.</li>
</ul>
</li>
</ol>
<p>Next add your site to /etc/apache2/sites-available/ and then link to that file in /etc/apache2/sites-enabled/:</p>
<ol>
<li>In the terminal, cd to <code>/etc/apache2/sites-available/</code></li>
<li>Create a new file with: <code>$ sudo touch mysite.dev</code></li>
<li>Open that file in gedit: <code>$ sudo gedit mysite.dev</code></li>
<li>Add following to that file:<br />
&lt;VirtualHost *:80&gt;<br />
ServerName 	mysite.dev<br />
ServerAlias 	mysite.dev<br />
ServerAdmin 	myaddress@email.com<br />
DocumentRoot /home/<em>yourusername</em>/public_html/mysite/<br />
&lt;/VirtualHost&gt;</li>
</ol>
<p>Add a pseudo link to that file in /etc/apache2/sites-enabled/:</p>
<ol>
<li>cd over to <code>/etc/apache2/sites-enabled/</code></li>
<li>In the terminal, enter: <code>$ sudo ln -s /etc/apache2/sites-enabled/mysite.dev mysite.dev</code>
<ul>
<li>Note: <code>$ ln -s <em>target</em> <em>linkname</em></code></li>
</ul>
</li>
</ol>
<p>Finally, restart Apache:</p>
<ol>
<li>$ sudo service apache2 restart</li>
<li>You&#8217;re done!</li>
</ol>
<p>See!  Not so bad&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/how-to-configure-apache-virtual-hosting-in-ubuntu-karmic-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Mootools to a Wordpress child theme</title>
		<link>http://www.likesalmondesign.com/add-mootools-to-a-wordpress-child-theme/</link>
		<comments>http://www.likesalmondesign.com/add-mootools-to-a-wordpress-child-theme/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 04:00:35 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=279</guid>
		<description><![CDATA[The following code, when included in the functions.php file in your Wordpress child theme, will correctly load Mootools and a custom script.  This is the only way I am able make custom scripts work, but you hear a lot of stuff out there on the interweb&#8230;

&#60;?php
function add_js() {
    $stylesheet_dir = get_bloginfo('stylesheet_directory');
 [...]]]></description>
			<content:encoded><![CDATA[<p>The following code, when included in the functions.php file in your Wordpress child theme, will correctly load Mootools and a custom script.  This is the <em>only</em> way I am able make custom scripts work, but you hear a lot of stuff out there on the interweb&#8230;</p>
<p><code><br />
&lt;?php<br />
function add_js() {<br />
    $stylesheet_dir = get_bloginfo('stylesheet_directory');<br />
    $myscript = $stylesheet_dir . '/js/myscript.js';<br />
    $mootools = $stylesheet_dir . '/js/mootools.js';<br />
    wp_enqueue_script('mootools', $mootools, '', '1.2.4', false);<br />
    wp_enqueue_script('myscript', $myscript, array('mootools'), '1.0', false);<br />
}<br />
add_js();<br />
?&gt;<br />
</code></p>
<p>Notice how every parameter is used in the <code>&lt; ?php wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); ?&gt;</code> function <em>even though</em> all but the first one is supposed to be optional.  Maybe its a PHP thing.  Whatever.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/add-mootools-to-a-wordpress-child-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Karmic LAMP stack installation</title>
		<link>http://www.likesalmondesign.com/ubuntu-karmic-lamp-stack-installation/</link>
		<comments>http://www.likesalmondesign.com/ubuntu-karmic-lamp-stack-installation/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 04:55:40 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=262</guid>
		<description><![CDATA[In the terminal, type:

$ sudo apt-get install apache2
$ sudo apt-get install php5 libapache2-mod-php5 php5-mysql
$ sudo apt-get install mysql-server
$ sudo apt-get install phpmyadmin

Just agree when it asks you stuff.
]]></description>
			<content:encoded><![CDATA[<p>In the terminal, type:</p>
<ul>
<li><code>$ sudo apt-get install apache2</code></li>
<li><code>$ sudo apt-get install php5 libapache2-mod-php5 php5-mysql</code></li>
<li><code>$ sudo apt-get install mysql-server</code></li>
<li><code>$ sudo apt-get install phpmyadmin</code></li>
</ul>
<p>Just agree when it asks you stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/ubuntu-karmic-lamp-stack-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use &#8217;service&#8217; to start, stop and restart Apache in Ubuntu Karmic</title>
		<link>http://www.likesalmondesign.com/use-service-to-start-stop-and-restart-apache-in-ubuntu-karmic/</link>
		<comments>http://www.likesalmondesign.com/use-service-to-start-stop-and-restart-apache-in-ubuntu-karmic/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 04:42:29 +0000</pubDate>
		<dc:creator>Ammon</dc:creator>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.likesalmondesign.com/?p=258</guid>
		<description><![CDATA[The service service_name command command can be used to start, stop, or restart anything in your /etc/init.d directory. From the command line, use it like this:

$ sudo service apache2 start
$ sudo service apache2 stop
$ sudo service apache2 restart

]]></description>
			<content:encoded><![CDATA[<p>The <code>service <em>service_name command</em></code> command can be used to start, stop, or restart anything in your <code>/etc/init.d</code> directory. From the command line, use it like this:</p>
<p><code><br />
$ sudo service apache2 start<br />
$ sudo service apache2 stop<br />
$ sudo service apache2 restart<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.likesalmondesign.com/use-service-to-start-stop-and-restart-apache-in-ubuntu-karmic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
