<?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>Everything is Crap &#187; ubuntu</title>
	<atom:link href="http://everythingiscrap.com/tag/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://everythingiscrap.com</link>
	<description>Notes on the crap we&#039;ve been subjected to</description>
	<lastBuildDate>Wed, 11 Jan 2012 21:10:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Log file rotation in Ubuntu</title>
		<link>http://everythingiscrap.com/test/</link>
		<comments>http://everythingiscrap.com/test/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 21:04:04 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[log files]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://everythingiscrap.com/?p=774</guid>
		<description><![CDATA[Ubuntu handles log rotation with a utility called logrotate. By adding your own profile to /etc/logrotate.d (just follow the examples already there) the utility will rotate any logs you want. Who knew?]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-775 alignnone" title="Logbook" src="http://everythingiscrap.com/wp-content/uploads/2011/07/logbook2-300x225.jpg" alt="" width="300" height="225" /></p>
<p>Ubuntu handles log rotation with a utility called <a href="http://manpages.ubuntu.com/manpages/jaunty/man8/logrotate.8.html">logrotate</a>. By adding your own profile to /etc/logrotate.d (just follow the examples already there) the utility will rotate any logs you want.</p>
<p>Who knew?</p>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu to Ubuntu &#8211; Replacing a web server</title>
		<link>http://everythingiscrap.com/moving-to-a-new-web-server/</link>
		<comments>http://everythingiscrap.com/moving-to-a-new-web-server/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 21:02:09 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.everythingiscrap.com/?p=704</guid>
		<description><![CDATA[So, the old web server is acting slow and I don't know why. Solution? Move to a new webserver, and upgrade to the latest OS along the way. It needs to be upgraded anyway, right?! That's what I just did and here are the most valuable command line arguments for doing so: Of course, those [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.everythingiscrap.com/wp-content/uploads/2010/06/DSC00379-320-12-300x225.jpg" alt="" title="DSC00379-320-12" width="300" height="225" class="alignnone size-medium wp-image-499" /><br />
So, the old web server is acting slow and I don't know why. Solution? Move to a new webserver, and upgrade to the latest OS along the way. It needs to be upgraded anyway, right?!</p>
<p>That's what I just did and here are the most valuable command line arguments for doing so:</p>
<p><code>tar -pcvzf www.tar.gz www/
mysqldump -u root -pPassword --all-databases &gt; alldata.sql

tar -pxvzf www.tar.gz
mysql -u root -pPassword &lt; alldata.sql<!--formatted--></code></p>
<p>Of course, those commands are not all that I needed to do, but they are the ones that I will want in the future when I move to another web server. So, I guess you could say they're more like a personal note on how to transfer a directory without losing permissions and how to move an entire MySQL install.</p>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/moving-to-a-new-web-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If you want to use Sendmail, install it, dummy!</title>
		<link>http://everythingiscrap.com/installing-sendmail/</link>
		<comments>http://everythingiscrap.com/installing-sendmail/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 16:14:46 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.everythingiscrap.com/?p=667</guid>
		<description><![CDATA[Right&#8230;I must have forgotten to install sendmail, because mail wasn't working for WordPress. First, to verify that sendmail wasn't working I ran this PHP script (thanks to phpeasystep.com) That confirmed it. And the fix was easy: Doing this exposed a flaw in my hosts file and ZYXware.com had the answer sudo gedit /etc/hosts &#8230; 127.0.0.1 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://everythingiscrap.com/wp-content/uploads/2010/11/Sendmail-Inc.png" alt="" title="Sendmail Inc" width="240" height="35" class="alignnone size-full wp-image-668" /></p>
<p>Right&#8230;I must have forgotten to install sendmail, because mail wasn't working for WordPress. First, to verify that sendmail wasn't working I ran this PHP script (<a href="http://www.phpeasystep.com/phptu/23.html">thanks to phpeasystep.com</a>)</p>
<p><code>&lt;?
// send e-mail to ...
$to=&quot;me@localhost&quot;;

// Your subject
$subject=&quot;Test&quot;;

// From
$header=&quot;from: your name &lt;your email&gt;&quot;;

// Your message
$message=&quot;Hello rn&quot;;
$message.=&quot;This is testrn&quot;;
$message.=&quot;Test again &quot;;

// send email
$sentmail = mail($to,$subject,$message,$header);

// if your email succesfully sent
if($sentmail){
echo &quot;Email Has Been Sent .&quot;;
}
else {
echo &quot;Cannot Send Email &quot;;
}

?&gt;<!--formatted--></code></p>
<p>That confirmed it. And the fix was easy:</p>
<p><code>apt-get install sendmail</code><br />
Doing this exposed a flaw in my hosts file and <a href="http://www.zyxware.com/articles/641/fixed-ubuntu-startup-slows-down-at-starting-mail-transport-agent-mta-sendmail">ZYXware.com had the answer</a></p>
<blockquote><p>
sudo gedit /etc/hosts<br />
&#8230;<br />
127.0.0.1	localhost.localdomain	localhost<br />
127.0.1.1	zyxware01.localdomain zyxware01<br />
&#8230;<br />
If you have a static IP you can replace 127.0.1.1 with your static IP.<br />
&#8230;
</p></blockquote>
<p>So, now mail works from php and, more importantly, WordPress.</p>
<p>[EDIT]<br />
Sheesh&#8230;Ubuntu is picky. Here's (almost) exactly what I have for the top half of my hosts file<br />
<code>127.0.0.1    myhostname    localhost.localdomain    localhost
::1    myhostname    localhost6.localdomain6    localhost6
127.0.1.1    myhostname
192.168.1.100    myhostname.mydomain.com
</code></p>
<p>The spaces are actually tabs, I don't know if it matters. </p>
<p>I also don't know what is needed and what is not, but I mimicked this layout on a new server and it worked; the MTA blah-blah service no longer takes forever and sendmail works nice and quickly.<br />
[/EDIT]</p>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/installing-sendmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More cron stuff in Ubuntu</title>
		<link>http://everythingiscrap.com/more-cron-stuff-in-ubuntu/</link>
		<comments>http://everythingiscrap.com/more-cron-stuff-in-ubuntu/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 14:26:23 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.everythingiscrap.com/?p=651</guid>
		<description><![CDATA[So, I needed to make a cron job that runs every hour. This is crazy simple; at least in Ubuntu! Ubuntu has folders in the /etc/ folder&#8230; cron.daily cron.hourly cron.monthly cron.weekly It's pretty easy. As long as you don't need to control exactly when a process executes, just throw a script file in one of [...]]]></description>
			<content:encoded><![CDATA[<p>So, I needed to make a cron job that runs every hour. This is crazy simple; at least in Ubuntu! Ubuntu has folders in the /etc/ folder&#8230;</p>
<p>cron.daily<br />
cron.hourly<br />
cron.monthly<br />
cron.weekly</p>
<p>It's pretty easy. As long as you don't need to control exactly when a process executes, just throw a script file in one of those folders and you're done (just don't forget to make your script executable). There is one more folder, cron.d, that acts as an extension to the system crontab and uses the crazy crontab job scheduling syntax, but I'm not using that. These periodic folders are way easier.</p>
<p>I should mention that I learned about the <a href="http://www.unixgeeks.org/security/newbie/unix/cron-1.html">periodic cron folders</a> from cogNiTioN, and about the <a href="http://www.pantz.org/software/cron/croninfo.html">cron.d</a> from pantz.com. Thanks guys.</p>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/more-cron-stuff-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Self Signing a Certificate for a Test Server</title>
		<link>http://everythingiscrap.com/self-signing-a-certificate-for-a-test-server/</link>
		<comments>http://everythingiscrap.com/self-signing-a-certificate-for-a-test-server/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 20:56:32 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.everythingiscrap.com/?p=648</guid>
		<description><![CDATA[While messing around with a new membership database I ran into a wall. The script that gives me a web interface simply would not continue until I secured my connection properly. So, I found myself in need of a do-it-yourself certificate (since I wasn't willing to pay $500+ for a real certificate yet). I found [...]]]></description>
			<content:encoded><![CDATA[<p>While messing around with a new membership database I ran into a wall. The script that gives me a web interface simply <em>would not continue</em> until I secured my connection properly. So, I found myself in need of a do-it-yourself certificate (since I wasn't willing to pay $500+ for a real certificate yet).</p>
<p>I found a great set of instructions on <a href="http://www.tc.umn.edu/~brams006/">Paul Bramscher's Site</a>:</p>
<p><a href="http://www.tc.umn.edu/~brams006/selfsign.html">Creating Certificate Authorities and self-signed SSL certificates</a><br />
<a href="http://www.tc.umn.edu/~brams006/selfsign_ubuntu.html">Setting up SSL  Ubuntu and Apache 2</a></p>
<p>I read through them and, although I didn't understand all the steps fully, I was able to make it work.</p>
<p>Thanks Paul Bramscher!</p>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/self-signing-a-certificate-for-a-test-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strip out a bracketed piece of text using PHP</title>
		<link>http://everythingiscrap.com/strip-out-a-bracketed-piece-of-text-using-php/</link>
		<comments>http://everythingiscrap.com/strip-out-a-bracketed-piece-of-text-using-php/#comments</comments>
		<pubDate>Mon, 20 Sep 2010 14:50:02 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[regular expressions]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.everythingiscrap.com/?p=641</guid>
		<description><![CDATA[In WordPress I have a free, third-party theme that is displaying my image captions in article excerpts for some reason. The captions show up as a sort of bracketed markup. I tracked down the part of code that prepares the article excerpts and ran this regular expression to strip out any square-bracketed text: The 'Us' [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.everythingiscrap.com/wp-content/uploads/2009/06/120px-php-logo-svg.png" alt="" title="120px-php-logo-svg" width="120" height="64" class="alignleft size-full wp-image-249" /><br />
In WordPress I have a free, third-party theme that is displaying my image captions in article excerpts for some reason. The captions show up as a sort of bracketed markup. I tracked down the part of code that prepares the article excerpts and ran this regular expression to strip out any square-bracketed text:</p>
<p><code>preg_replace(&quot;([.*])Us&quot;, &quot;&quot;, $excerpt)<!--formatted--></code></p>
<p>The 'Us' at the end makes the search Ungreedy (U) and ignores newlines (s).</p>
<p>By the way, I think preg_replace() is one of the worst function names I've come across in a public language/API; but maybe that's just me.</p>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/strip-out-a-bracketed-piece-of-text-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove a directory: rm -rf</title>
		<link>http://everythingiscrap.com/remove-a-directory-rm-rf/</link>
		<comments>http://everythingiscrap.com/remove-a-directory-rm-rf/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 14:53:20 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.everythingiscrap.com/?p=610</guid>
		<description><![CDATA[I've Googled this about 10 times now, maybe if I write it down I'll remember: The -r means recursive, and the -f means force; which means it will ignore the fact that the directory is full.]]></description>
			<content:encoded><![CDATA[<p>I've Googled this about 10 times now, maybe if I write it down I'll remember:</p>
<p><code>rm -rf</code></p>
<p>The -r means recursive, and the -f means force; which means it will ignore the fact that the directory is full.</p>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/remove-a-directory-rm-rf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Samba: Meh.</title>
		<link>http://everythingiscrap.com/samba-meh/</link>
		<comments>http://everythingiscrap.com/samba-meh/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 14:24:23 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.everythingiscrap.com/?p=604</guid>
		<description><![CDATA[I'll start by saying Samba is not as easy as it should be, even when it's fully set up and working, but it gets the job done, and SFTP gets so tedious after a while. Here's what I had to do to get it working. First, install it: Next, edit /etc/samba/smb.conf and add something like [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://everythingiscrap.com/wp-content/uploads/2010/07/Samba.logo_.png" alt="" title="Samba Logo" width="400" height="206" class="size-full wp-image-605" /></p>
<p>I'll start by saying Samba is not as easy as it should be, even when it's fully set up and working, but it gets the job done, and SFTP gets so tedious after a while.</p>
<p>Here's what I had to do to get it working. First, install it:</p>
<p><code>apt-get install samba</code></p>
<p>Next, edit /etc/samba/smb.conf and add something like this:</p>
<p><code>[www]
comment = My Shared Stuff
path = /my/folder
browseable = yes
read only = no</code></p>
<p>(I added it at the bottom of the file so that I could find it quickly)</p>
<p>I reloaded samba at that point, but I'm not positive it's necessary:</p>
<p><code>service smbd reload</code></p>
<p>Then, and this is the part I had forgotten from setting it up last time, I added my user to the list of samba users:</p>
<p><code>smbpasswd -L -a username</code></p>
<p>Done. Now get back to work!</p>
<p><strong>Edit:</strong><br />
Now that I have installed the GUI, just do it from there. Right click on the folder to share it then run this command&#8230;</p>
<p><code>sudo smbpasswd -a username</code> </p>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/samba-meh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>There&#039;s inheritance, and then there&#039;s inheritance</title>
		<link>http://everythingiscrap.com/theres-inheritance-and-then-theres-inheritance/</link>
		<comments>http://everythingiscrap.com/theres-inheritance-and-then-theres-inheritance/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 20:09:50 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[acl]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.everythingiscrap.com/?p=596</guid>
		<description><![CDATA[&#8230;no, not the money kind of inheritance. I'm talking about the ownership and permissions in Linux. Linux permissions are tricky for a Windows guy like me. When I copy a file to a directory on a server I expect the file to inherit the permission of the containing folder on the server. Period. Why? Because [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://everythingiscrap.com/wp-content/uploads/2010/07/wq-money-woman.jpg" alt="" title="Inheritance" width="400" height="384" class="alignnone size-full wp-image-597" /><br />
&#8230;no, not the <em>money</em>  kind of inheritance. I'm talking about the ownership and permissions in Linux. </p>
<p>Linux permissions are tricky for a Windows guy like me. When I copy a file to a directory on a server I expect the file to inherit the permission of the containing folder on the server. Period. Why? Because that's what NTFS does; that's how it works! Linux it's a bit more complex. </p>
<p>I don't understand it enough to explain it, but here are some of the links and notes on what I've learned so far.</p>
<p>I <a href="http://www.windowsitpro.com/article/interoperability/acl-on-unix.aspx">activated ACL</a> for the volume I was working on.</p>
<p><code>apt-get install acl</code></p>
<p>I had to edit /etc/fstab so that the / line read something like "/dev/sda1/ ext3acl,defaults,errors=remount-ro 0 1" then reboot.</p>
<p>This allowed me to <a href="http://www.vanemery.com/Linux/ACL/linux-acl.html">set permissions and default permissions for each folder using ACL</a>. Here's the command I used:</p>
<p><code>setfacl -R --set u::rwx,g::r-x,o::- /www/
setfacl -R -d --set u::rwx,g::r-x,o::- /www/

setfacl -R -m g::rwx /www/wordpress/wp-content/
setfacl -R -d -m g::rwx /www/wordpress/wp-content/</code></p>
<p>This pretty much took care of what permissions were allowed for each new object. But I wanted my new objects to have the <a href="http://www.linuxforums.org/articles/file-permissions_94.html">same group as the parent</a>, and I wanted it's <a href="http://www.gtkc.net/kb/entry/7/">subdirectories to inherit that group</a>:</p>
<p><code>chmod g+s /www/wordpress/
cd /www/wordpress/
find . -type d -exec chmod g+s {} \;</code></p>
<p>That's about as good as I could make it. It's not the Windows way, but it will do.</p>
<p>EDIT: Having thought about it some more, I'm thinking that I didn't need to activate ACL for my purposes. So I'll probably end up restoring a snapshot that I took before I started messing with ACL. Still, it was a learning experience.</p>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/theres-inheritance-and-then-theres-inheritance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hrmph, you mean GD wasn&#039;t installed?</title>
		<link>http://everythingiscrap.com/hrmph-you-mean-gd-wasnt-installed/</link>
		<comments>http://everythingiscrap.com/hrmph-you-mean-gd-wasnt-installed/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 14:03:22 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.everythingiscrap.com/?p=590</guid>
		<description><![CDATA[I couldn't embed thumbnail sizes on my new WordPress install on my new Ubuntu server; I could only embed the original size (which was 3072&#215;2048). The options to embed other sizes were just grayed out. It turns out that the default LAMP install doesn't include php-gd, the graphics library that creates thumbnails. Well&#8230; I guess [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://everythingiscrap.com/wp-content/uploads/2010/07/WordPress.jpg" alt="" title="WordPress" width="316" height="73" class="alignnone size-full wp-image-591" /></p>
<p>I couldn't embed thumbnail sizes on my new WordPress install on my new Ubuntu server; I could only embed the original size (which was 3072&#215;2048). The options to embed other sizes were just grayed out. It turns out that the default LAMP install doesn't include php-gd, the graphics library that creates thumbnails. Well&#8230; <a href="http://wordpress.org/support/topic/199390?replies=3">I guess that's easy enough to fix</a>:</p>
<blockquote><p>apt-get install php5-gd</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/hrmph-you-mean-gd-wasnt-installed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

