<?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>Sean Jordan &#187; Linux</title>
	<atom:link href="http://seanjordan.me/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanjordan.me</link>
	<description>supernerd</description>
	<lastBuildDate>Wed, 25 Aug 2010 06:04:22 +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>PHP Bitwise Operators and Access Control Lists</title>
		<link>http://seanjordan.me/2009/11/php-bitwise-operators-and-access-control-lists/</link>
		<comments>http://seanjordan.me/2009/11/php-bitwise-operators-and-access-control-lists/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 02:09:55 +0000</pubDate>
		<dc:creator>Sean Jordan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://seanjordan.me/?p=94</guid>
		<description><![CDATA[Bitwise operators are a very handy tool that can be used in PHP.  The problem is they just aren&#8217;t used very often.  I really like bitwise operators, but like other PHP developers, I just don&#8217;t use them very often.  I think the cause of this is that developers just don&#8217;t realize when they COULD be [...]]]></description>
			<content:encoded><![CDATA[<p>Bitwise operators are a very handy tool that can be used in PHP.  The problem is they just aren&#8217;t used very often.  I really like bitwise operators, but like other PHP developers, I just don&#8217;t use them very often.  I think the cause of this is that developers just don&#8217;t realize when they COULD be using bitwise operators.</p>
<p>A very good example of where you should be using bitwise operators is in Access Control Lists (ACLs).  An ACL is basically a list of who has access to what.  Well, a simple way to introduce you to access control is via Unix permissions.  Most of you are probably familiar with the <span class="code">chmod</span> command.  Most of you also probably don&#8217;t have the codes memorized.  Here is a great little PHP script that will:</p>
<p><strong>A</strong>: Help you understand bitwise operators and how you might use them, and<br />
<strong>B</strong>: Help you understand and memorize the <span class="code">chmod</span> codes.</p>
<pre name="code" class="php">
define("EXECUTE", 1);
define("WRITE", 2);
define("READ", 4);

for($i = 0; $i &lt;= 7; $i++) {
$x = ($i &amp; EXECUTE) ? "x" : "-";
$w = ($i &amp; WRITE) ? "w" : "-";
$r = ($i &amp; READ) ? "r" : "-";

echo "{$i} = {$r}{$w}{$x}&lt;br /&gt;";
}
</pre>
<p>This will output:</p>
<div class="code-section">
0 = &ndash;&ndash;&ndash;<br />
1 = &ndash;&ndash;x<br />
2 = &ndash;w&ndash;<br />
3 = &ndash;wx<br />
4 = r&ndash;&ndash;<br />
5 = r&ndash;x<br />
6 = rw&ndash;<br />
7 = rwx
</div>
<p>A little note, about <span class="code">chmod</span>, just in case you were wondering now: a <span class="code">chmod</span> code is three digits.  The first digit is the access code for the file&#8217;s owner, the second digit is the access code for the group of the file&#8217;s owner, and the third digit is the access code for everyone else.  So, let&#8217;s take a code: 754.  What does this mean? Well, let&#8217;s use that list we just created to look it up.  The first digit, 7, as stated, maps to the file&#8217;s owner, so according to our list, the owner has full permissions, rwx.  Next, the second digit is a 5, and that maps to the file owner&#8217;s group; the group has r-x access: read and execute, but no write permissions.  The final digit, everyone else, is a 4: read-only access.</p>
<p>Now, how can you apply this to your code? Well, as long as you keep the integer assignments as powers of 2, you can have an infinite number of access codes:</p>
<pre name="code" class="php">
define("MAGIC", 8);

$wizard = READ | WRITE | EXECUTE | MAGIC;

if($wizard &amp; MAGIC) {
echo "Wizards can do magic &lt;br /&gt;";
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanjordan.me/2009/11/php-bitwise-operators-and-access-control-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 9.10 &#8211; Karmic Koala Reviewed</title>
		<link>http://seanjordan.me/2009/11/ubuntu-9-10-karmic-koala-reviewed/</link>
		<comments>http://seanjordan.me/2009/11/ubuntu-9-10-karmic-koala-reviewed/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 01:25:26 +0000</pubDate>
		<dc:creator>Sean Jordan</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://seanjordan.me/?p=75</guid>
		<description><![CDATA[Released at the end of October, &#8220;Karmic Koala&#8221; is the latest release of Canonical&#8217;s hugely popular user-friendly Ubuntu flavor of Linux.  I&#8217;ve been an avid Ubuntu user since 6.06.  I&#8217;ve been a huge fan.  It&#8217;s Linux, so I have the power of the command-line.  I like to do things via command line when possible.  I [...]]]></description>
			<content:encoded><![CDATA[<p>Released at the end of October, &#8220;Karmic Koala&#8221; is the latest release of Canonical&#8217;s hugely popular user-friendly Ubuntu flavor of Linux.  I&#8217;ve been an avid Ubuntu user since 6.06.  I&#8217;ve been a huge fan.  It&#8217;s Linux, so I have the power of the command-line.  I like to do things via command line when possible.  I guess it just makes me feel like I&#8217;m more in control.</p>
<p>Last night I finally got around to getting 9.10 installed.  Since I just started to learn <a title="Latest reading..." href="http://seanjordan.me/2009/11/latest-reading/" target="_self">Flex</a>, I decided to go with the 32bit OS, since Flash&#8217;s 64bit Linux support isn&#8217;t that great.  Flash 10 introduced Adobe Flash Player to the 64bit Linux Kernel, however its still just in <a title="Adobe Flash Player 10 for 64-bit Linux" href="http://labs.adobe.com/technologies/flashplayer10/64bit.html" target="_blank">Alpha</a>.  I also used the alternate &#8220;text&#8221; installer.  This is the version to use if you want to get the install completed quicker, or set up an LVM.  Also, thanks to my good buddy, Wikipedia, I learned that a LOT of users are <a title="Early adopters bloodied by Ubuntu's Karmic Koala" href="http://www.theregister.co.uk/2009/11/03/karmic_koala_frustration/" target="_blank">experiencing problems when upgrading from 9.04</a>.  Good thing I chose to do a clean install.  Typically, I won&#8217;t upgrade until the new release has been out for a while, but I wanted to do a review, so I decided to install from scratch.  I&#8217;m glad I made that decision.  I wasn&#8217;t thrilled with 9.04, however, so I couldn&#8217;t wait to try out 9.10.</p>
<p>Years ago, Mark Shuttleworth proclaimed that <a title="&quot;Pretty&quot; is a feature" href="http://www.markshuttleworth.com/archives/63" target="_blank">["Pretty" is a feature]</a>.  Understanding the trend of the &#8220;wow&#8221; effect to impress users, Ubuntu comes &#8220;pretty&#8221; out of the box&#8230; unlike most Linux installs.  Minus the added files and links on the taskbar, here is how mine looked, out-of-the-box:</p>
<p><img title="Almost &quot;Out-of-the-box&quot; appearance" src="http://seanjordan.me/wp-content/uploads/2009/11/default.png" alt="Ubuntu default background and theme" width="683" height="384" /></p>
<p>After playing around for a while, I got things comfortable.  Got to have those transparent terminals, people!</p>
<p><img class="size-full wp-image-80" title="My Ubuntu 9.04 Karmic Koala Desktop" src="http://seanjordan.me/wp-content/uploads/2009/11/mydesktop.png" alt="My Ubuntu 9.04 Karmic Koala Desktop" width="683" height="384" /></p>
<p>My favorite new feature is <a title="Ubuntu One" href="http://one.ubuntu.com" target="_blank">Ubuntu One</a>.  In a nutshell, it automagically ryncs the contents of my ~/Ubuntu One folder to Canonical&#8217;s cloud servers.  For FREE, users are given a 2gb limit (and more can be purchased via monthly subscriptions).  I can access my files anywhere via web-browser by logging into the interface.  I&#8217;m still working on learning exactly how it works.  But I picture using this feature almost daily.  I&#8217;m working on figuring out how to sync my /var/www (apache ServerRoot) directory, so I can access my web projects from anywhere real-time.  I could have set this up myself using on of my own domains, but this is way cooler.  Once I&#8217;ve learned more about the system, I&#8217;ll probably dedicate a post to it.  This seems like the type of service that can set Ubuntu apart from the crowd.  It seems that the sync doesn&#8217;t follow symlinks, so I created a cronjob to locally rsync the contents of my /var/www folder to my /home/sean/Ubuntu\ One folder.  One of my complaints, is the use of a directory name that requires escaping.  This is one of my pet-peeves.. but for now it is the only folder that can be synced.  I read in the plans, where it was mentioned that allowing the syncing of other folders would be good.. it even used /var/www as an example folder that people would like synced.</p>
<p>On a less exciting note, it seems the kernel version I&#8217;m using (Linux version 2.6.31-14-generic (buildd@rothera) (gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8) ) #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009) seems to have brought back the troubles of Sleep/Hibernate in Linux.  Every time I wake my laptop up (HP G60), I get one of these pretty icons in the top right of my screen:</p>
<p><img class="size-full wp-image-82" title="Crash Report Detected" src="http://seanjordan.me/wp-content/uploads/2009/11/crashReportDetected.jpg" alt="Crash Report Detected" width="251" height="54" /></p>
<p>How exciting!  So I figure, lets see whats up.. I click on the icon, and thats when I discovered it.  My least favorite new feature.  A long-time staple in Redmond&#8217;s operating sytsems: the worthless error message:</p>
<p><img class="size-full wp-image-83" title="Helpful Error Message" src="http://seanjordan.me/wp-content/uploads/2009/11/helpfulErrorMsg.jpg" alt="Helpful Error Message" width="511" height="259" /></p>
<p>I would at least like to know what process triggered the error!! But, I get it, Ubuntu is targeting users new to Linux, and providing them with that kind of information might be a bad idea.</p>
<p>I decided to report the error, just to see the process.. which eventually told me that it was indeed related to the sleep functionality. Here is the error from my syslog:</p>
<p>Nov 14 17:55:37 ubuntu kernel: [12229.569342] WARNING: at /build/buildd/linux-2.6.31/kernel/power/suspend_test.c:52 suspend_test_finish+0&#215;80/0&#215;90()</p>
<p>As far as load times, etc, I don&#8217;t really have much to report.  The start-up time seems to have improved greatly, which is good.</p>
<p>Overall, I&#8217;m pretty happy with the latest Ubuntu.  Most things just worked after the install.  I had to install the nonfree nvidia driver, not a big deal.  On my old laptop, I was still using 8.04, which has been my favorite version.  It also happens to be the most recent LTS (Long Term Support) release.  Luckily, the next release, 10.04, scheduled for 04/2010, Lucid Lynx will be the next LTS release.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanjordan.me/2009/11/ubuntu-9-10-karmic-koala-reviewed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with Linux and the Command Line</title>
		<link>http://seanjordan.me/2009/10/getting-started-with-linux-and-the-command-line/</link>
		<comments>http://seanjordan.me/2009/10/getting-started-with-linux-and-the-command-line/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 08:30:44 +0000</pubDate>
		<dc:creator>Sean Jordan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://seanjordan.me/?p=22</guid>
		<description><![CDATA[Linux is great.  If you are in to developing websites, chances are, you&#8217;ll be working with Linux.  Problem is, a lot of people are afraid of the command line, or just don&#8217;t know enough commands to be comfortable working on a server via SSH. Here are a few commands you&#8217;ll need to know to get [...]]]></description>
			<content:encoded><![CDATA[<p>Linux is great.  If you are in to developing websites, chances are, you&#8217;ll be working with Linux.  Problem is, a lot of people are afraid of the command line, or just don&#8217;t know enough commands to be comfortable working on a server via SSH.</p>
<p>Here are a few commands you&#8217;ll need to know to get started:</p>
<p>1. cd</p>
<p>cd stands for &#8216;change directory&#8217; and is one you&#8217;ll probably use most frequently.  The syntax is very simple:</p>
<p>cd <em>destination</em></p>
<p>A few tricks to know when working with this command:</p>
<p>cd ..</p>
<p>Changes to the directory UP one hierarchical level.</p>
<p>cd ../..</p>
<p>Changes to the director UP two hierarchical levels.. etc.</p>
<p>cd ../myFolder</p>
<p>Changes to a folder called &#8216;myFolder&#8217; which is a subfolder of the current parent folder.  This is a <em>relative</em> path.</p>
<p>cd /</p>
<p>Changes to the root folder of the filesystem.</p>
<p>cd /var/www</p>
<p>Change to an <em>absolute</em> path.</p>
<p>cd ~</p>
<p>Change to your shell&#8217;s home directory.  By default, this is your system home directory, such as /home/yourUsername</p>
<p>cd ~/Desktop</p>
<p>Change to the Desktop folder under your home directory, equivalent to something such as cd /home/yourUsername/Desktop</p>
<p>2. cp</p>
<p>cp is the copy command, and is another frequently used command.  This is another command with very simple syntax.  Learning the syntax of cd is useful for using cp. The syntax is:</p>
<p>cp file-to-be-copied.php /destination/newfilename.php</p>
<p>Here are a few examples and tips for working with cp:</p>
<p>cp index.php home.php</p>
<p>Creates a copy of the index.php file, named home.php</p>
<p>cp index.php /someDirectory</p>
<p>Creates an index.php under the folder /someDirectory.  Not supplying the new name gives the copy the same name, index.php</p>
<p>cp someDirectory/ /destination/</p>
<p>Creates a folder &#8216;someDirectory&#8217; under the &#8216;/destination&#8217; folder.  This doesn&#8217;t copy any of the files, just the folder itself.</p>
<p>cp someDirectory/ newDirectoryName/</p>
<p>Creates a folder in the same directory with the name &#8216;newDirectoryName&#8217; .. again, no files are copied just the folder (and its ownership/permissions). Apply a relative or absolute path before the directory name to create it somewhere else.</p>
<p>cp -r someDirectory/ newDirectoryName/</p>
<p>Creates a copy of the directory &#8216;someDirectory&#8217; named &#8216;newDirectoryName&#8217;.  using the &#8216;-r&#8217; flag will copy the folders contents &#8220;recursively.&#8221;</p>
<p>3. ls</p>
<p>ls is the command used to list all of the files in your present working directory.  It is as simple as typing: ls.  You can add flags for more views:</p>
<p>ls -a</p>
<p>will show you ALL files .. includes the hidden files (hidden files start with period, such as &#8220;.htaccess&#8221;)</p>
<p>ls -l</p>
<p>will show you the files in a list format. This method shows you more information about the file, such as the owner, the size, and the last modification date.</p>
<p>Combine the two flags, to get ls -al and you will see all files in a list format</p>
<p>4. pwd</p>
<p>pwd echoes out your &#8220;Present Working Directory&#8221; to the screen.  Cool.</p>
<p>5. rm</p>
<p>rm is the always useful remove command.  Type</p>
<p>rm filename.php</p>
<p>to remove the file &#8216;filename.php&#8217;. There are a lot of flags to be used with rm, but they can be dangerous. We&#8217;ll wait until you are more comfortable in the command line.</p>
<p>6. rmdir</p>
<p>rmdir is rm&#8217;s brother. rmdir clearly stands for &#8220;Remove Directory&#8221;.  You can only remove a directory that is empty.  If its not empty, you&#8217;ll first need to delete all of the files in the directory.  There are easier ways to remove things in bulk, or to remove non-empty directories, but as I said, they can be dangerous.  We&#8217;ll wait until you are more comfortable in the command line. <img src='http://seanjordan.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>7. mv</p>
<p>mv stands for Move.  It is the command you&#8217;ll use to relocate files.  You can consider moving a file to be the same thing as renaming it.  Renaming a file from &#8220;fileA.php&#8221; to &#8220;fileB.php&#8221; is the same as moving its location to be &#8220;/directory/fileA.php to /directory/fileB.php.</p>
<p>Use mv as:</p>
<p>mv fileA.php fileB.php</p>
<p>to rename fileA to fileB.  Or you can use mv like:</p>
<p>mv fileA.php /some/other/dir/</p>
<p>to relocate fileA.php to /some/other/dir/fileA.php</p>
<p>This is all I have for now.  There will hopefully be more later.  Enjoy, n00bs <img src='http://seanjordan.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://seanjordan.me/2009/10/getting-started-with-linux-and-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
