<?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>command line idiot &#187; tutorials</title>
	<atom:link href="http://www.commandlineidiot.com/blog/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.commandlineidiot.com/blog</link>
	<description>one man's dawning realization that linux is waaaaay smarter than he is</description>
	<lastBuildDate>Mon, 05 Oct 2009 15:10:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Jack That Shat!</title>
		<link>http://www.commandlineidiot.com/blog/2009/jack-that-shat/</link>
		<comments>http://www.commandlineidiot.com/blog/2009/jack-that-shat/#comments</comments>
		<pubDate>Mon, 11 May 2009 17:56:49 +0000</pubDate>
		<dc:creator>command line idiot</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[headphone jack]]></category>
		<category><![CDATA[Headphones]]></category>
		<category><![CDATA[internal speakers]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[speakers]]></category>
		<category><![CDATA[Woot]]></category>

		<guid isPermaLink="false">http://www.commandlineidiot.com/blog/?p=1275</guid>
		<description><![CDATA[So you just wooted some awesome new desktop speakers for your Ubuntu desktop computer, you plug them into the headphone jack, and you behold the megawatt goodness of thumping 4-inch speakers. But what ho? What&#8217;s this? The on-board sound card speaker is still pumping it&#8217;s pathetic little pings and bleeps into your otherwise blissful aural [...]]]></description>
			<content:encoded><![CDATA[<p>So you just wooted some awesome new desktop speakers for your Ubuntu desktop computer, you plug them into the headphone jack, and you behold the megawatt goodness of thumping 4-inch speakers. But what ho? What&#8217;s this? The on-board sound card speaker is still pumping it&#8217;s pathetic little pings and bleeps into your otherwise blissful aural wonderland! It&#8217;s enough to drive a command line idiot to drink. Well, pretty much anything is enough to drive this command line idiot to drink. Things like &#8220;Mother&#8217;s Day&#8221; and &#8220;Tuesday&#8221;. </p>
<p>You would think that plugging something into the headphone jack would automatically shut off the speaker inside your box. You&#8217;d think that, but you&#8217;d be wrong. Not only are you wrong, but it&#8217;s such a stupid thing to want that the Ubuntu gods have hidden the setting under like 500 menu levels. Let&#8217;s go digging, shall we?</p>
<p>In the upper right corner, you have a volume icon. Click on that, and select &#8220;Volume Control&#8221;.<br />
<img class="alignnone size-full wp-image-1276" title="toolbar_icon" src="http://www.commandlineidiot.com/blog/wp-content/uploads/2009/05/toolbar_icon.png" alt="toolbar_icon" width="290" height="103" /></p>
<p>In the &#8220;Volume Control&#8221; dialog, you&#8217;ll see all of the volume sliders for various outputs. Select &#8220;Preferences&#8221;.<br />
<img src="http://www.commandlineidiot.com/blog/wp-content/uploads/2009/05/volumecontrol.png" alt="volumecontrol" title="volumecontrol" width="512" height="374" class="alignnone size-full wp-image-1277" /></p>
<p>Now, you can control which settings show up in the &#8220;Volume Control&#8221; dialog. About halfway down the list, you&#8217;ll find the setting for &#8220;Headphone Jack Sense&#8221;. Yes, let&#8217;s please jack some sense into these headphone outputs, shall we? Check the box.<br />
<img src="http://www.commandlineidiot.com/blog/wp-content/uploads/2009/05/preferences.png" alt="preferences" title="preferences" width="329" height="363" class="alignnone size-full wp-image-1278" /></p>
<p>Now, back in the &#8220;Volume Control&#8221; dialog, you&#8217;ll find a new tab for switches. Our preference for headphone jack behavior shows up there.<br />
<img src="http://www.commandlineidiot.com/blog/wp-content/uploads/2009/05/jacksense.png" alt="jacksense" title="jacksense" width="509" height="370" class="alignnone size-full wp-image-1279" /></p>
<p>That&#8217;s it! Now, you perfectly idiotic request to shut down the internal speakers when you plug in headphones (just like every other operating system does) will work with your fancy new speakers.</p>
<p>Now leave me alone. It&#8217;s 10am, and this tear-soaked gin &#038; tonic isn&#8217;t going to guzzle itself.</p>
<img src="http://www.commandlineidiot.com/blog/?ak_action=api_record_view&id=1275&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.commandlineidiot.com/blog/2009/jack-that-shat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Up the WP</title>
		<link>http://www.commandlineidiot.com/blog/2008/up-the-wp/</link>
		<comments>http://www.commandlineidiot.com/blog/2008/up-the-wp/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 15:18:20 +0000</pubDate>
		<dc:creator>command line idiot</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[bash script]]></category>
		<category><![CDATA[exploits]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://www.commandlineidiot.com/blog/?p=28</guid>
		<description><![CDATA[Give me WordPress, give me WordPress You can have all the rest, give me WordPress I love Matt&#8217;s little blogging engine that could. It&#8217;s easy, fast, and pretty to look at. It&#8217;s easy to install. It is not, however, fun to upgrade. That&#8217;s a problem, because people keep on coming up with tricksy little ways [...]]]></description>
			<content:encoded><![CDATA[<p><em>Give me WordPress, give me WordPress<br />
You can have all the rest, give me WordPress</em></p>
<p>I love Matt&#8217;s little blogging engine that could. It&#8217;s easy, fast, and pretty to look at. It&#8217;s easy to install. It is not, however, fun to upgrade.</p>
<p>That&#8217;s a problem, because people keep on coming up with tricksy little ways to burninate WordPress. Now, the folks who write the code are pretty good at staying on top of chinks in the armor, but that means that every time they say &#8220;update&#8221;, I have to update. Being the lazy ass that I am, I don&#8217;t like to keep doing things the hard way, ftp&#8217;ing data up and down, so I wrote a little bash script to do the badness for me. Now, I can go from vulnerable to updated in 0.4 seconds flat!</p>
<p>Let me take just a second to give mad props to the WordPress folks for a simple decision they made early on, that makes a world of difference to guys like me: you will always, always find the latest version of WordPress at the same location:</p>
<p><a href="http://wordpress.org/latest.zip">http://wordpress.org/latest.zip</a></p>
<p>Simple, easy, but by avoiding all the complications of version numbering and folder locations in the download URL, they make it possible to write scripts like this. Thanks, guys!</p>
<p>If you don&#8217;t know how to use bash scripts, check out this tutorial: <a href="http://www.commandlineidiot.com/blog/2008/bash-it-bop-it-script-it/">Bash it! Bop it! Script it!</a>. It&#8217;ll show you where to put the script, how to make it executable, and how to call it from the command line. The script itself is in the download link below, and it&#8217;s pretty well documented, so you should be able to figure out why everything is there. Here&#8217;s a stripped down version, with none of the documentation:</p>
<pre lang="bash" line="1" file="http://commandlineidiot.com/scripts/wpup.txt">
#! /bin/bash
#
# =======================
# WordPress Upgrade Script 0.1
# Written by Command Line Idiot
# http://commandlineidiot.com
# You may use, modify, and redistribute this script freely
# Released: April 2008
# =======================
echo 'WordPress server location, without trailing slash (ex. /var/www/mysite.com/blog)'
read WPLOC
WPNEW='/tmp'
cd $WPNEW
rm -rf $WPNEW/wordpress
rm -f latest.zip
wget http://wordpress.org/latest.zip
unzip -o latest.zip
rm wordpress.zip
rm -rf $WPLOC.bak
cp -rv $WPLOC $WPLOC.bak
cp -rfv $WPNEW/wordpress/*.php $WPLOC/
cp -rfv $WPNEW/wordpress/wp-admin/* $WPLOC/wp-admin/
cp -rfv $WPNEW/wordpress/wp-includes/* $WPLOC/wp-includes/
exit
</pre>
<p>You can download the script here:</p>
<p><a title="WordPress Update Script" href="http://commandlineidiot.com/scripts/wpup.txt">WordPress Update Script 0.1</a></p>
<p>Share and enjoy!</p>
<img src="http://www.commandlineidiot.com/blog/?ak_action=api_record_view&id=28&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.commandlineidiot.com/blog/2008/up-the-wp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bash it! Bop it! Script it!</title>
		<link>http://www.commandlineidiot.com/blog/2008/bash-it-bop-it-script-it/</link>
		<comments>http://www.commandlineidiot.com/blog/2008/bash-it-bop-it-script-it/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 02:01:20 +0000</pubDate>
		<dc:creator>command line idiot</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[bash script]]></category>
		<category><![CDATA[bash_profile]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.commandlineidiot.com/blog/2008/bash-it-bop-it-twist-it/</guid>
		<description><![CDATA[I would rather spend 3 hours writing a program to do a task than have to spend 3 minutes doing it myself more than once. Seriously. I&#8217;m that lazy. The only task I like to do over and over again is opening a Corona, taking a sip, filling it back up with tequila, and passing [...]]]></description>
			<content:encoded><![CDATA[<p>I would rather spend 3 hours writing a program to do a task than have to spend 3 minutes doing it myself more than once. Seriously. I&#8217;m that lazy. The only task I like to do over and over again is opening a Corona, taking a sip, filling it back up with tequila, and passing out in a pool of my own vomit. Or, as my kids like to call it, &#8220;Thursday.&#8221;</p>
<p>That kind of laziness means I use a lot of bash scripts to do regular tasks on my server. I have scripts to do automated backups, scripts to setup new virtual domains, scripts to prop up my fragile ego with repeated compliments, scripts to do just about every repeating task that goes into maintaining a barely functional webserver.</p>
<p>There are several tutorials out there for how to start writing scripts, but none of them have my flair for drunken bravado and outrageous sexual innuendo. So, I proudly present a very basic starter guide to writing a bash script:</p>
<h4>How to Write A Bash Script</h4>
<p>You know all those fancy commands you keep typing into the command line? Things like</p>
<p><code>cp -rv secretpr0nstash/*.avi /var/www/churchhats.com/</code></p>
<p>Well, those same commands can be stored in a file, and can be executed whenever you need to, by invoking the name of the file. Let&#8217;s start with a very basic file. It just has 3 lines:</p>
<p><code>#! /bin/bash<br />
# sexy robot script<br />
echo "You are the sexiest robot"</code></p>
<p>The first line tells the system which shell to use when interpreting the commands that follow. The second line is a comment, to remind me in 6 months what the point of the script is. You can place these throughout the script to remind yourself why you did what you did when you wrote the thing. Finally, the third line is the actual command. It tells the system to output the given text back to the shell.</p>
<p>If you&#8217;re looking to learn more about how to write complex scripts, I highly recommend these two guides:<br />
<a href="http://en.tldp.org/LDP/abs/html/">Advanced Bash-Scripting Guide</a> <a href="http://linuxcommand.org/writing_shell_scripts.php"></a><br />
<a href="http://linuxcommand.org/writing_shell_scripts.php">Writing Shell Scripts</a></p>
<p>So, now what?</p>
<h4>Where to Put It</h4>
<p>Now, you need a place to put the script. I keep all of mine in a folder called &#8220;bin&#8221; inside of my user folder. To create the folder, type:<br />
<code>mkdir ~/bin<br />
cd ~/bin</code></p>
<p>now, invoke your favorite text editor to open a new file, and start entering in the code:</p>
<p><code>nano sexrobot</code></p>
<p>Enter your code, save, exit, and TADA! you have your very own script to prop up your fragile ego with repeated compliments.</p>
<h4>How to Make Go Go</h4>
<p>Except, it still won&#8217;t run. Try it &#8211; type &#8220;sexrobot&#8221; into your command line. What happened? It mocked you, didn&#8217;t it. It told you that your crazy dreams of a sexy robot compliment did not exist.</p>
<p>Before we can invoke the command, we have to make it executable.</p>
<p><code>chmod 755 sexrobot</code></p>
<p>Now, I can execute the code. Try it again, with the whole location:</p>
<p><code>~/bin/sexrobot</code></p>
<p>Now that it works, we can do the final step &#8211; add a line to our .bash_profile file, so that every time we log in, the shell goes into our bin folder to look for commands.<br />
<code>nano ~/.bash_profile</code></p>
<p>Go to the end of the file, and add the following line:<br />
<code>export PATH="$PATH:~/bin"</code></p>
<p>Reload the bash_profile settings:<br />
<code>. ~/.bash_profile</code></p>
<p>If we did everything right, we should be able to execute our new script from any folder, just by typing the name of the file. Let&#8217;s try it:<br />
<code>cd /tmp<br />
sexrobot</code></p>
<h4>In Conclusions</h4>
<p>Now that I don&#8217;t have to do all these repetitive server maintenance tasks, I can focus on more important things, like repetitive binge-drinking to drown my own sorrow.</p>
<p>Ha Ha! Alcoholism is funny!</p>
<img src="http://www.commandlineidiot.com/blog/?ak_action=api_record_view&id=27&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.commandlineidiot.com/blog/2008/bash-it-bop-it-script-it/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Housekeeping, or, How To Obsessively Blow Up The Files Left Behind</title>
		<link>http://www.commandlineidiot.com/blog/2008/housekeeping-or-how-to-obsessively-blow-up-the-files-left-behind/</link>
		<comments>http://www.commandlineidiot.com/blog/2008/housekeeping-or-how-to-obsessively-blow-up-the-files-left-behind/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 18:42:46 +0000</pubDate>
		<dc:creator>command line idiot</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[aptitude]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux packages]]></category>
		<category><![CDATA[OCD]]></category>

		<guid isPermaLink="false">http://www.commandlineidiot.com/blog/2008/housekeeping-or-how-to-obsessively-blow-up-the-files-left-behind/</guid>
		<description><![CDATA[I install, and then uninstall, lots of different software packages on Debian. I&#8217;m trying to learn how this thing works, so I&#8217;ll often install something, poke around, and then remove it. But, I get paranoid about the package manager leaving things behind on my system. Cron jobs, config files, libraries, all that jazz. So, I [...]]]></description>
			<content:encoded><![CDATA[<p>I install, and then uninstall, lots of different software packages on Debian. I&#8217;m trying to learn how this thing works, so I&#8217;ll often install something, poke around, and then remove it. But, I get paranoid about the package manager leaving things behind on my system. Cron jobs, config files, libraries, all that jazz.</p>
<p>So, I do some housekeeping to make sure that everything, absolutely everything, gets blown up when I remove a piece of software. Is it necessary? Probably not. Does it satisfy my deeply rooted obsessive control issues? It does.</p>
<p>I&#8217;ll assume you&#8217;ve already removed the software using the package manager of your choice. For me, that&#8217;s aptitude. Throughout this little rundown, replace the word PACKAGE with the name of whatever you&#8217;re uninstalling.</p>
<p><code>sudo aptitude purge PACKAGE</code></p>
<p>Then, we need to hunt down and kill every remaining bread crumb that this thing left behind. We&#8217;ll be using the &#8220;locate&#8221; tool. It&#8217;s a fast search tool that refers to an existing database of files. Start by kicking into super user mode:</p>
<p><code>sudo su</code></p>
<p>Then, update the database that locate uses. This rebuilds an updated list of the files on your system.</p>
<p><code>updatedb</code></p>
<p>Next, we want locate to find all of the files that were left behind.</p>
<p><code>locate PACKAGE</code></p>
<p>This will print them all to the screen. See them there, smiling back at you? You thought you were clean, you dirty bird, but there they all are. Filthy. Filthy files. Dirty. Dirty.</p>
<p>Well, looking at them on the screen isn&#8217;t all that useful for us. What we really need is some way to generate a list of these files that we can then process for deletion, one at a time. Go go command line, go!</p>
<p><code>locate PACKAGE &gt; /tmp/PACKAGE_files.txt</code></p>
<p>head to your /tmp folder and take a look &#8211; there should be a .txt file there that lists each of the files left behind. Check it out:</p>
<p><code>cat /tmp/PACKAGE_files.txt</code></p>
<p>It should look identical to the output of the locate command we used earlier.</p>
<p>Now, we use a little Command Line Magic©, and no, I&#8217;m not talking about cocaine. Sweet, sweet cocaine, gives us the go-go to make everything clean. Mmmm, clean. So clean.</p>
<p>We want a command that will pass each line of our new text file into the &#8220;rm&#8221; command, and give us the option to delete each one. Why, hello there xargs, so nice to see you.</p>
<p><code>cat /tmp/PACKAGE_files.txt | xargs -l1 -p rm -rf</code></p>
<p>What&#8217;s going on here? The &#8220;cat&#8221; command will output the content of our txt file. The pipe passes it along to the next command. &#8220;xargs&#8221; lets us input that data into a new command, in this case &#8220;rm&#8221;. The &#8220;-l1&#8243; switch on xargs (that&#8217;s the letter &#8220;L&#8221; and the number &#8220;one&#8221;) executes the command on one line at a time, instead of the whole batch. The &#8220;-p&#8221; switch will ask us for permission on each file, so that we have some control over what we want to delete. The &#8220;-rf&#8221; switch on the &#8220;rm&#8221; command will remove files recursively, and will force the issue if there are warnings or errors.</p>
<p>If we did everything right, it should start ripping through the files, asking you if you want to delete each one. Y for yes, N for no, and Tada! you have a system clean enough to avoid those awkward OCD freakouts at 2am.</p>
<p>If you want to double check the process, run the locate command again:</p>
<p><code>updatedb &#038;&#038; locate PACKAGE</code></p>
<p>It should come back clean. Not dirty. Clean. Like pure white linen sheets on a bed of unicorn feathers. So clean. So nice and clean. And now, the sleeping.</p>
<img src="http://www.commandlineidiot.com/blog/?ak_action=api_record_view&id=26&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.commandlineidiot.com/blog/2008/housekeeping-or-how-to-obsessively-blow-up-the-files-left-behind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plate Up! Bash Script for Apache VHost Setup</title>
		<link>http://www.commandlineidiot.com/blog/2007/plate-up-bash-script-for-apache-vhost-setup/</link>
		<comments>http://www.commandlineidiot.com/blog/2007/plate-up-bash-script-for-apache-vhost-setup/#comments</comments>
		<pubDate>Wed, 08 Aug 2007 00:17:41 +0000</pubDate>
		<dc:creator>command line idiot</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.commandlineidiot.com/blog/2007/plate-up-bash-script-for-apache-vhost-setup/</guid>
		<description><![CDATA[In the sisyphian marathon of blowing up and rebuilding my server, I&#8217;ve had to go through the process of reconfiguring my virtual hosts for Apache2 several times. Well, that gets a bit tedious. How can my hands do the very important jobs of holding a beer up to my lips whilst scratching my man candy [...]]]></description>
			<content:encoded><![CDATA[<p>In the sisyphian marathon of blowing up and rebuilding my server, I&#8217;ve had to go through the process of reconfiguring my virtual hosts for Apache2 several times. Well, that gets a bit tedious. How can my hands do the very important jobs of holding a beer up to my lips whilst scratching my man candy if they have to keep typing &#8220;sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/newdomain.com&#8221; over and over again?</p>
<h3>bash it!</h3>
<p>Fear not, my young linux adventurers. There IS a better way! Pop that cold beer, pull up some sweats, and feast your eyes on my hand dandy little bash script for automatically setting up yon website. Here&#8217;s what it does, in a nutshell:</p>
<ol>
<li>Asks for the new domain name</li>
<li>Creates a new folder in the user folder with the domain name (/home/user/DOMAIN.COM)</li>
<li>Creates a basic index.html file in the new domain folder that displays the name of the domain when accessed.</li>
<li>Rolls 2d6 for Hacker Shield, to prevent magic-based attacks against your website. (planned for version 0.2)</li>
<li>Generates a vanilla Apache vhost config file spelling out how Apache should handle requests for that domain.</li>
<li>Generates an access log and an error log</li>
<li>Generates a cgi-bin folder within the DOMAIN.COM folder</li>
</ol>
<p>The script assumes you have Apache 2.2+ installed.</p>
<h3>The non-compliance disclosure</h3>
<p>Keep in mind that this script was written by me, for me, to help save me some effort. Because of that, it uses some non-standard locations for things. Why? Because I likes my shit where I likes my shit, that&#8217;s why!</p>
<p>I like having my apache vhost config files in my user folder, so that I don&#8217;t have to hassle with permissions. You can do the same thing with these two commands. First, make yourself a few new directories:</p>
<p><code>mkdir -p ~/www-config/sites-available</code><br />
Then, link the apache site config folder to your new folder. Make sure this all goes on one line:</p>
<p><code>sudo ln -s /home/USERNAME/www-config/sites-available /etc/apache2/sites-available/</code></p>
<p>So where are things placed with this script?</p>
<p>config:<br />
/home/USERNAME/www-config/sites-available/DOMAIN.COM</p>
<p>website documents:<br />
/home/USERNAME/DOMAINNAME.COM</p>
<p>index page:<br />
/home/USERNAME/DOMAIN.COM/index.html</p>
<p>access log:<br />
/home/USERNAME/logs/DOMAINNAME.COM/access.log</p>
<p>error log:<br />
/home/USERNAME/logs/DOMAINNAME.COM/error.log</p>
<p>cgi-bin:<br />
/home/USERNAME/DOMAIN.COM/cgi-bin</p>
<h3>The Script</h3>
<p>Here &#8217;tis. Click here to view or download a .txt file with the script.</p>
<p><a href="http://commandlineidiot.com/scripts/siteup.txt">http://commandlineidiot.com/scripts/siteup.txt</a></p>
<p>To use it, do the following:</p>
<p><code>mkdir ~/bin<br />
cd ~/bin<br />
wget http://commandlineidiot.com/scripts/siteup.txt<br />
mv siteup.txt siteup<br />
chmod 755 siteup<br />
</code></p>
<p>Now, to invoke the script, type the following:<br />
<code>. ~/bin/siteup</code></p>
<p>If you want to find out more about bash scripts, including how to handle permissions and setting paths so that your scripts can be called by name, I highly recommend the following tutorial by William Shotts Jr. at LinuxCommands.org: <a href="http://linuxcommand.org/writing_shell_scripts.php" title="LinuxCommand.org: Writing shell scripts.">Writing Shell Scripts</a></p>
<p>Questions? Comments? Feck Off! I&#8217;m too busy drinking this cold beer and fiddling my diddly.</p>
<img src="http://www.commandlineidiot.com/blog/?ak_action=api_record_view&id=18&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.commandlineidiot.com/blog/2007/plate-up-bash-script-for-apache-vhost-setup/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>postfix, dovecot, emailtastic!</title>
		<link>http://www.commandlineidiot.com/blog/2007/postfix-dovecot-emailtastic/</link>
		<comments>http://www.commandlineidiot.com/blog/2007/postfix-dovecot-emailtastic/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 16:15:09 +0000</pubDate>
		<dc:creator>command line idiot</dc:creator>
				<category><![CDATA[VPS]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.commandlineidiot.com/blog/2007/postfix-dovecot-emailtastic/</guid>
		<description><![CDATA[I&#8217;ve gots the email! I gots the email! Christopher Haas has written what might be the best tutorial I&#8217;ve ever run across for linux. It&#8217;s accurate, complete, breaks things down into manageable steps, and explains what you&#8217;re doing while you do it. It also contains several &#8220;check&#8221; steps, where it shows you how to check [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve gots the email! I gots the email!</p>
<p>Christopher Haas has written what might be the best tutorial I&#8217;ve ever run across for linux. It&#8217;s accurate, complete, breaks things down into manageable steps, and explains what you&#8217;re doing while you do it. It also contains several &#8220;check&#8221; steps, where it shows you how to check your system logs to see if the previous steps went as planned.</p>
<p>This is what a tutorial should be!</p>
<p><a href="http://workaround.org/articles/ispmail-etch/">Howto: ISP-style Email Server with Debian-Etch and Postfix 2.3</a></p>
<p>If you&#8217;re trying to get email up and running on your debian VPS, this is the place to start. It shows how to use postfix and dovecot, with secure login, spam and virus checkers. Everything you need for POP or IMAP.</p>
<p>Take note of the warning up front about the proper naming scheme for your host. Almost every VPS image that I&#8217;ve run across uses a default naming in /etc/hosts and /etc/hostname that is incorrect for proper configuration of postfix (or even apache!). This article explains why and what to do about it:</p>
<p><a href="http://cbl.abuseat.org/hostname.html">Naming Issues with Linux and xBSD</a></p>
<p>Happy installing of email!</p>
<img src="http://www.commandlineidiot.com/blog/?ak_action=api_record_view&id=17&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.commandlineidiot.com/blog/2007/postfix-dovecot-emailtastic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>show version</title>
		<link>http://www.commandlineidiot.com/blog/2007/show-version/</link>
		<comments>http://www.commandlineidiot.com/blog/2007/show-version/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 01:01:19 +0000</pubDate>
		<dc:creator>command line idiot</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.commandlineidiot.com/blog/2007/show-version/</guid>
		<description><![CDATA[Just ran across a very useful little utility called apt-show-versions. It shows you the version installed for each of the apps you have on your server, along with whether or not they are the latest version. Used in conjunction with the apt-cache show command, this makes for a handy little set of tools for working [...]]]></description>
			<content:encoded><![CDATA[<p>Just ran across a very useful little utility called <a href="http://www.debianadmin.com/list-your-installed-package-versions-with-apt-show-versions.html">apt-show-versions</a>. It shows you the version installed for each of the apps you have on your server, along with whether or not they are the latest version. Used in conjunction with the <a href="http://www.commandlineidiot.com/blog/2007/i-c-u-scurvey-dev-core/">apt-cache show</a> command, this makes for a handy little set of tools for working your way through tutorials.</p>
<p>It&#8217;s available through the repository on Debian Etch and Ubuntu</p>
<p><code>sudo apt-get install apt-show-versions</code><br />
To see everything installed via apt, use the bare command<br />
<code>apt-show-versions</code><br />
Or you can use it to check on a single package<br />
<code>apt-show-version nano</code></p>
<img src="http://www.commandlineidiot.com/blog/?ak_action=api_record_view&id=16&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.commandlineidiot.com/blog/2007/show-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>i c u, scurvey-dev-core</title>
		<link>http://www.commandlineidiot.com/blog/2007/i-c-u-scurvey-dev-core/</link>
		<comments>http://www.commandlineidiot.com/blog/2007/i-c-u-scurvey-dev-core/#comments</comments>
		<pubDate>Wed, 20 Jun 2007 19:47:03 +0000</pubDate>
		<dc:creator>command line idiot</dc:creator>
				<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.commandlineidiot.com/blog/2007/i-c-u-scurvey-dev-core/</guid>
		<description><![CDATA[I have a bug up me arse about most linux tutorials. 90% of linux tutorials are written for one of two reasons: As a handy checklist for the person who is writing it. They&#8217;re using it instead of a pad of yellow legal paper to keep track of how they set things up. These tutorials [...]]]></description>
			<content:encoded><![CDATA[<p>I have a bug up me arse about most linux tutorials. 90% of linux tutorials are written for one of two reasons:</p>
<ol>
<li><em>As a handy checklist for the person who is writing it.</em> They&#8217;re using it instead of a pad of yellow legal paper to keep track of how they set things up. These tutorials tend to have almost no notation about what things actually do, they&#8217;re just a running list of commands</li>
<li><em>To demonstrate how remarkably clever the person is.</em> These tutorials tend to veer off into lengthly political rants in the middle, all about how infantile and shortsighted the distro developers were when they decided to include XYZ in the canonical sources list, rather than forcing users to follow this 97 step process that is marginally more secure, so long as you don&#8217;t accidentally leave off the semicolon at the end of one of the commands.</li>
</ol>
<p>Where are the tutorials for people like me? I&#8217;m not a mouth-breathing moron, just ignorant about linux. I don&#8217;t want a running list of things to copy and paste into the command line, I want to understand what I&#8217;m doing. And, I want to know when you&#8217;re presenting alternatives that are your own personal hobby-horse rather the standard method. Don&#8217;t tell me &#8220;this is the best way&#8221; and then point me in some obscure direction that&#8217;s going to cause a dozen headaches later on when I have to alter every other tutorial I try to follow.</p>
<h3>On Tutorial to Rule Them</h3>
<p>So, I hereby present to you my first tutorial. This tutorial will allow you to rescue all of the other bad tutorials and make them useful again. It only does one thing, and there are only two steps, but they work.</p>
<h4>wtf <em>is</em> this?</h4>
<p>So, you&#8217;re following a tutorial, and it tells you to apt-get a dozen packages, If you&#8217;re like me, this makes you very nervous. I want to actually know what these things do before I dump them onto my server. Let&#8217;s say one of the packages is &#8220;php5-dev&#8221;</p>
<p>Enter the following in the command line:<br />
<code>apt-cache show php5-dev</code></p>
<p>You&#8217;ve just told the apt package manager application to get you information about this package. It doesn&#8217;t install anything, just tells you what the package does, along with some nifty info about other packages it&#8217;s dependent on. In this case, it shows the following:</p>
<blockquote><p>Package: php5-dev<br />
Priority: optional<br />
Section: devel<br />
Installed-Size: 2680<br />
Maintainer: Debian PHP Maintainers &lt;pkg-php-maint@lists.alioth.debian.org&gt;<br />
Architecture: amd64<br />
Source: php5<br />
Version: 5.2.0-8+etch1<br />
Depends: autoconf, automake1.4, libssl-dev, libtool, shtool, php5-common (&gt;= 5.2.0-8+etch1)<br />
Filename: pool/main/p/php5/php5-dev_5.2.0-8+etch1_amd64.deb<br />
Size: 342036<br />
 &#8230; snip &#8230;<br />
Description: Files for PHP5 module development<br />
This package provides the files from the PHP5 source needed for compiling additional modules.<br />
.<br />
PHP5 is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.<br />
Tag: devel::lang:php, role::devel-lib</p></blockquote>
<p>Sweet! So now I know that it contains the tools to compile additional modules for PHP5. I&#8217;m now smarter!</p>
<h4>bash it</h4>
<p>If you are following a lot of tutorials, you&#8217;ll end up typing the words &#8220;apt-cache show&#8221; until you go blind, or develop ganglion cysts on your tendons. Let&#8217;s make the automatic computrix machine do it for is. Open your .bash_profile file with your favorite text editor. I like nano:<br />
<code>nano ~/.bash_profile</code><br />
hit control+v until your cursor reaches the end of the file, then add the following line:<br />
<code>alias c="apt-cache show"</code><br />
hit control+x, then enter, and you&#8217;re out of the text editor. We want to force bash to reload the profile, so type the following:<br />
<code>. ~/.bash_profile</code><br />
To see if it worked, type this:<br />
<code>c php5-dev</code><br />
It should bring you back exactly the same info you saw up above. Huzzah!</p>
<p>Now, no matter how shitty the tutorial is that you&#8217;re following, you can check out the packages and see what they do before you apt-get install scurvey-dev-core and it translates all of your config files into Cyrillic.</p>
<img src="http://www.commandlineidiot.com/blog/?ak_action=api_record_view&id=7&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.commandlineidiot.com/blog/2007/i-c-u-scurvey-dev-core/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
