<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>The Nubby Admin</title>
	
	<link>http://thenubbyadmin.com</link>
	<description>Just a nublet SysAdmin</description>
	<lastBuildDate>Wed, 16 May 2012 17:01:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TheNubbyAdmin" /><feedburner:info uri="thenubbyadmin" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>TheNubbyAdmin</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/TheNubbyAdmin" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2FTheNubbyAdmin" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><item>
		<title>Solving Blank or Apache 2 Test Page Problems (and more) in Plesk 10 on Linux</title>
		<link>http://feedproxy.google.com/~r/TheNubbyAdmin/~3/Bilx2Bt4wOM/</link>
		<comments>http://thenubbyadmin.com/2012/05/16/solving-blank-or-apache-2-test-page-problems-and-more-in-plesk-10-on-linux/#comments</comments>
		<pubDate>Wed, 16 May 2012 09:53:26 +0000</pubDate>
		<dc:creator>Wesley David</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[plesk]]></category>

		<guid isPermaLink="false">http://thenubbyadmin.com/?p=2619</guid>
		<description><![CDATA[This won&#8217;t be my usual &#8220;Problem, Solution, Long Story&#8221; style troubleshooting post. There are a few complexities involved that don&#8217;t allow it to fit into that template so easily.<br />
I have a client-facing server running CentOS 5.7 and Plesk 10.3. When clients need web space, I put them on my Plesk server so they have shiny buttons to click when managing their own web space. Recently I had a series of unfortunate events cause an outage on one client.<br />
It ...<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p>]]></description>
			<content:encoded><![CDATA[<p>This won&#8217;t be my usual &#8220;Problem, Solution, Long Story&#8221; style troubleshooting post. There are a few complexities involved that don&#8217;t allow it to fit into that template so easily.</p>
<p>I have a client-facing server running CentOS 5.7 and Plesk 10.3. When clients need web space, I put them on my Plesk server so they have shiny buttons to click when managing their own web space. Recently I had a series of unfortunate events cause an outage on one client.</p>
<p>It starts with my craving to have things standardized. All client account domain directories are in lower case. All, that is, except for one: AmazingClient. Their main domain&#8217;s vhost directory is /var/www/vhosts/AmazingClient which, in Plesk-land means that any reference to that client&#8217;s domain is always in that case. It bugs me. More than it should. When I created the client account several months ago, for some inexplicable reason, I used CamelCase in their name. One recent evening I decided to change the capitalization for their account&#8217;s main domain. Simple, right?</p>
<p>I <strong><em>did</em></strong> say that I&#8217;m using Plesk, did I not?</p>
<p>Before I go any further, I know what you might be thinking. &#8220;Domains aren&#8217;t case sensitive! What nonsense are you on about?!&#8221; They&#8217;re not case sensitive when approaching domains from a DNS perspective. However, I&#8217;m looking at this from a filesystem and Plesk user account perspective.</p>
<p>To change something as simple as the case of a domain&#8217;s vhost directory, one cannot merely rename it. There are many configuration files to consider as well as Plesk-specific tasks that rely on the domain&#8217;s directory not being glibly swapped out from underneath it. To change a domain&#8217;s name in Plesk, one has to go into the client&#8217;s control panel, and click on the Websites &amp; Domains tab.</p>
<p style="text-align: center;"><img class="aligncenter" title="Plesk Websites and Domains" src="http://thenubbyadmin.com/wp-content/uploads/2012/05/websites-and-domains.png" alt="" width="568" height="35" /></p>
<p style="text-align: left;">From there you will find the domain that you want to change the case of (remember, this isn&#8217;t about &#8220;domain&#8221; in the DNS sense, but rather the representation of that domain within Plesk and on the filesystem) and click on its link. From there you will come to the Host Settings page for that domain. Once on the Host Settings page, you&#8217;ll have the option to change the domain name. Here comes the trouble: you can&#8217;t change the name merely based on case. Even though Plesk sees the client domain differently in the backend based on case, in this Host Settings interface case is not taken into account. Plesk will complain that the domain already exists. You need to change the domain name to something different, then change it back to the original domain name, minus the capitalization. (Plesk FAIL #1)</p>
<p style="text-align: left;">In my case, I wanted to swing it from AwesomeClient.com, to awesomeclienttemp.com, and then back to awesomeclient.com (sans the capital &#8220;A&#8221; and &#8220;C&#8221;).</p>
<h2 style="text-align: left;">Tipping Over the Edge of Doom</h2>
<p>When trying to move from AwesomeClient.com to awesomeclienttemp.com I received this error:</p>
<div class="wp_syntax">
<div class="code">
<pre class="html" style="font-family:monospace;">Internal error: [domain path] is out of webspace
Message is out of webspace
File Webspace.php
Line 334
Type PleskFatalException</pre>
</div>
</div>
<p>After that error, the Websites &amp; Domains tab is no longer accessible to that client account. Trying to use it receives the same &#8220;Internal Error: [domain path] is out of webspace&#8221; error.</p>
<p>You see, it appears that Plesk, upon requesting a domain rename, copies the domain&#8217;s existing files and then deletes the old ones. It does not perform a mere rename action (Plesk FAIL #2). This client uses quite a bit of space and it apparently maxed out their quota. I say &#8220;apparently&#8221; because, by a strict accounting for free space and quotas on the server, it should have been allowed &#8211; but just barely. Perhaps there&#8217;s more space that Plesk needs than a simple doubling of existing files. (Plesk FAIL #3?) Plesk certainly didn&#8217;t perform any kind of filesystem or account limitation checking prior to attempting the move. (Plesk FAIL #4)</p>
<p>The client site was still responsive; there didn&#8217;t appear to be any negative effects. I needed to investigate further, but as the night wore on I decided to postpone a thorough examination until another day.</p>
<h2>Ask Not For Whom Your Cell Phone Tolls</h2>
<p>Bright and early the next morning, I got a call. It was from the client.</p>
<p>&#8220;Our website seems to be down, so&#8230; uhh&#8230; if you could look into that&#8230;&#8221;</p>
<p>Super.</p>
<p>Nothing was being served up in response to any page requests for this domain. Apache&#8217;s error logs were showing requests for this client&#8217;s files as hitting in the default vhost root, not their own. Then, it hit me.</p>
<p>Plesk does not use the standard Apache configuration files. I mean, it <em>does</em>, but not really. It auto-generates Apache configuration files based on the information that is stored in its own customer database within MySQL. That&#8217;s why the domain was just fine the evening before, but didn&#8217;t fail until the wee hours of the morning. The configuration files had been latently generated based on the failed attempt at changing the domain account name.</p>
<p>Silly me&#8230; I expected there to be rollback statements in any of the SQL DML statements made to the database. I expected that a fatal error would be caught and changes rolled back. They weren&#8217;t. (Plesk FAIL #5) Silly, silly me.</p>
<p>Of course, I wasn&#8217;t going to be able to change the domain information because the Websites &amp; Domains tab bombed out permanently with an internal error. I couldn&#8217;t access the officially sanctioned means of modifying the domain account. This called for some database mangling.</p>
<h2>Let Pry Through the Portage of the Database</h2>
<p>I logged into <code>mysql</code> and dumped the <code>psa</code> database. From there, I used grep to scour the .sql file for any mention of <code>awesomeclienttemp</code>. Sure enough, the bad change was recorded in the database. There were dozens of records in several tables that pointed to the bad domain. That was causing Apache configuration files to be written with bad data, among other applications. There was also mention of the original, unsullied domain. I guess not all of the SQL statements that are part and parcel of a domain change were able to be executed before the error condition was achieved. (Side note: <em><strong>ROLLBACK!! ROLLBACK!! ROLLBACK!!</strong></em>)</p>
<p>Solving the problem was a simple as searching for and replacing the string awesomeclienttemp with AwesomeClient. I used mysql to perform that, but it could have been done on the dump file and then imported. For those interested, I used the replace() function and performed a select statement first just to make sure that I was changing the data that I expected to. Once satisfied with the results I performed an update statement also using the replace() function. Here&#8217;s an example of changing some values in the <code>dns_recs</code> table of Plesk&#8217;s <code>psa</code> database:</p>
<div class="wp_syntax">
<div class="code">
<pre class="sql" style="font-family:monospace;">mysql&amp;gt<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>displayVal<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'clienttemp'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Client'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> dns_recs <span style="color: #993333; font-weight: bold;">WHERE</span> displayVal <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%clienttemp%'</span>;
<span style="color: #66cc66;">+</span><span style="color: #808080; font-style: italic;">--------------------------------------------+</span>
<span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>displayVal<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'clienttemp'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Client'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">+</span><span style="color: #808080; font-style: italic;">--------------------------------------------+</span>
<span style="color: #66cc66;">|</span> mail<span style="color: #66cc66;">.</span>AwesomeClient<span style="color: #66cc66;">.</span>com<span style="color: #66cc66;">.</span>                    <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span> AwesomeClient<span style="color: #66cc66;">.</span>com<span style="color: #66cc66;">.</span>                         <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span> AwesomeClient<span style="color: #66cc66;">.</span>com<span style="color: #66cc66;">.</span>                         <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span> AwesomeClient<span style="color: #66cc66;">.</span>com<span style="color: #66cc66;">.</span>                         <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">+</span><span style="color: #808080; font-style: italic;">--------------------------------------------+</span>
mysql<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">UPDATE</span> dns_recs <span style="color: #993333; font-weight: bold;">SET</span> displayVal<span style="color: #66cc66;">=</span><span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>displayVal<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'clienttemp'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Client'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> displayVal <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%clienttemp%'</span>;</pre>
</div>
</div>
<p>With the database in a better state, there is still one more thing left to do. Plesk doesn&#8217;t dynamically look to the database for configuration information. It looks to regular files that have been dynamically generated from the database&#8217;s information. That generation happens on a schedule, but can be expedited using the <code>httpdmng</code> command. Specifically, I used:</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>psa<span style="color: #000000; font-weight: bold;">/</span>admin<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>httpdmng <span style="color: #660033;">--reconfigure-domain</span> AwesomeClient.com</pre>
</div>
</div>
<p>You could also use the &#8211;reconfigure-all option to perform a regeneration of all domain configuration files. After running <code>httpdmng</code> the domain was up and running.</p>
<h2>Apache Test Page or Blank Page Problems</h2>
<p>I glossed over some of the troubleshooting techniques I used while tracing the problem to its root. If you&#8217;re having trouble with seeing the Apache test page, then search through your httpd.conf file and make sure that your DirectoryIndex directive is set to look for all of the variants of an index.html page that you use. For example, index.html, index.htm. index.php, etc.</p>
<p>Furthermore, just to reiterate, check all of your vhost conf files, such as yourdomain/conf/vhost.conf (or any conf files that reside in that directory) for the DocumentRoot directive and make sure that it&#8217;s pointed to what you want it to be pointed at. Do not edit the files that are named similar to 13279881860.14852200_httpd.include. Those are auto-generated by Plesk and at worst you could cause destruction of files in your domain; at best you will have to re-edit those files every time a new one is generated.</p>
<p>Of course, do a dummy check to make sure that the domain you are trying to access is really resolving to the IP address of your web server. Just&#8230; do it. It takes 5 seconds and you have the outside chance of being pleasantly surprised.</p>
<h2>The Takeaway</h2>
<p>Plesk is rickety. If anyone has used a better control panel for client-facing servers, let me know. I&#8217;ve worked with cPanel and Plesk, but never with any of the others that I&#8217;ve listed in <a href="http://thenubbyadmin.com/2011/12/06/definitive-list-of-web-based-server-control-panels/">this giant list of web based server control panels</a>. Most people will shout &#8220;Just don&#8217;t use a control panel!&#8221; but that&#8217;s not a terribly client friendly option. I&#8217;m not categorically against control panels when used in the correct situations. I <em><strong>am</strong></em>, however, against misbehaving control panels.</p>
<p>Let me know your experiences in the comments below.
<div style='clear:both'></div>
<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p><img src="http://feeds.feedburner.com/~r/TheNubbyAdmin/~4/Bilx2Bt4wOM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://thenubbyadmin.com/2012/05/16/solving-blank-or-apache-2-test-page-problems-and-more-in-plesk-10-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://thenubbyadmin.com/2012/05/16/solving-blank-or-apache-2-test-page-problems-and-more-in-plesk-10-on-linux/</feedburner:origLink></item>
		<item>
		<title>“My Neckbeard Grew Three Sizes That Day” or How I Beat a GNU tool with Perl</title>
		<link>http://feedproxy.google.com/~r/TheNubbyAdmin/~3/QF8BcFNf9q0/</link>
		<comments>http://thenubbyadmin.com/2012/05/14/my-neckbeard-grew-three-sizes-that-day-or-how-i-beat-a-gnu-tool-with-perl/#comments</comments>
		<pubDate>Mon, 14 May 2012 09:32:58 +0000</pubDate>
		<dc:creator>ScottPack</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://thenubbyadmin.com/?p=2596</guid>
		<description><![CDATA[(Today is another guest post from security expert Scott Pack!)<br />
I spend a lot of time doing text based data processing. A *lot* of time. During an analysis, I often want to do things like look at &#8216;Top Talkers&#8217;, &#8216;Most Frequent Visitors&#8217;, or really anything that comprises a list of unique identifiers sorted by count. As a result, I&#8217;ve translated two actions into a series of pipes:<br />
<br />
What&#8217;s the count of events per thingy: &#8220; &#124; sort &#124; uniq ...<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p>]]></description>
			<content:encoded><![CDATA[<p><em>(Today is another guest post from security expert Scott Pack!)</em></p>
<p>I spend a lot of time doing text based data processing. A *lot* of time. During an analysis, I often want to do things like look at &#8216;Top Talkers&#8217;, &#8216;Most Frequent Visitors&#8217;, or really anything that comprises a list of unique identifiers sorted by count. As a result, I&#8217;ve translated two actions into a series of pipes:</p>
<ol>
<li>What&#8217;s the count of events per thingy: &#8220;<span style="font-family: monospace"> | sort | uniq -c | sort -n</span>&#8220;</li>
<li>Who has been doing whatever: &#8220;<span style="font-family: monospace"> | sort -u</span>&#8220;</li>
</ol>
<p>This tends to work pretty well in most cases. Today, however, was not one of those cases. While attempting get a list of unique MACs I started out with a source (i.e. non-uniqued) 16GB text file with one MAC per line. This is where things got annoying. Muscle memory kicked in and since this matched Action #2, I ran the following command: <span style="font-family: monospace">cat macs_all.txt | sort -u &gt;; macs_unique.txt</span></p>
<p>I expected it to take a few minutes, so I went back to the other things I was doing and let it go. I checked back 15 minutes later, and it was still running. Waited 5 minutes&#8230;still running. When the command had been running for 45 minutes, I got fed up and decided that I could do better. Perl, being my go to tool, came to the rescue in the form of hashes. I won&#8217;t go into gritty detail, but a Perl hash is a data structure that consists of a list of key/value pairs. Whenever you assign a value to a key it will add an entry for the key if it doesn&#8217;t exist, or update the value if it does. Since a key cannot be in the same hash multiple times, it makes for a pretty good hack to generate a unique list. This is what I ended up doing:</p>
<div class="wp_syntax">
<div class="code">
<pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl -w</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%unique</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$line</span> <span style="color: #339933;">=</span>  <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">next</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">$line</span><span style="color: #339933;">;</span>
  <span style="color: #000066;">chomp</span> <span style="color: #0000ff;">$line</span><span style="color: #339933;">;</span>
  <span style="color: #0000ff;">$unique</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$line</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">''</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$key</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066;">keys</span> <span style="color: #0000ff;">%unique</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$key<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre>
</div>
</div>
<p>This worked significantly better for me. The output was not sorted, but that&#8217;s fine, I didn&#8217;t need it sorted, only unique. The timing information looked a lot better too.</p>
<div class="wp_syntax">
<div class="code">
<pre class="erlang" style="font-family:monospace;">packs@ node1:~&amp;gt<span style="color: #6bb810;">;</span> time cat macs_all<span style="color: #6bb810;">.</span>txt | sort <span style="color: #014ea4;">-</span>u &amp;gt<span style="color: #6bb810;">;</span> macs_unique<span style="color: #6bb810;">.</span>txt
&nbsp;
real    181m12<span style="color: #6bb810;">.</span>417s
user    176m13<span style="color: #6bb810;">.</span>926s
sys     1m42<span style="color: #6bb810;">.</span>335s
packs@ node1:~&amp;gt<span style="color: #6bb810;">;</span> time cat macs_all<span style="color: #6bb810;">.</span>txt | <span style="color: #6bb810;">.</span><span style="color: #014ea4;">/</span>fast_uniq<span style="color: #6bb810;">.</span>pl &amp;gt<span style="color: #6bb810;">;</span> macs_fast_uniqed<span style="color: #6bb810;">.</span>txt
&nbsp;
real    8m9<span style="color: #6bb810;">.</span>074s
user    7m28<span style="color: #6bb810;">.</span>176s
sys     0m46<span style="color: #6bb810;">.</span>271s</pre>
</div>
</div>
<p>The times can&#8217;t really be directly compared, since output from fast_uniq.pl isn&#8217;t actually sorted. Given the pretty substantial difference I think we can reasonably accept the fact that fast_uniq.pl is better in this use case. After seeing this, I&#8217;m tempted to add some functionality so I stop using both sort and uniq entirely.</p>
<p>I&#8217;m interested to hear if anyone else has done something similar or explain to me how much my code sucks.
<div style='clear:both'></div>
<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p><img src="http://feeds.feedburner.com/~r/TheNubbyAdmin/~4/QF8BcFNf9q0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://thenubbyadmin.com/2012/05/14/my-neckbeard-grew-three-sizes-that-day-or-how-i-beat-a-gnu-tool-with-perl/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://thenubbyadmin.com/2012/05/14/my-neckbeard-grew-three-sizes-that-day-or-how-i-beat-a-gnu-tool-with-perl/</feedburner:origLink></item>
		<item>
		<title>Restricting and Automating User Commands Through SSH and the authorized_keys File</title>
		<link>http://feedproxy.google.com/~r/TheNubbyAdmin/~3/gC6pWrf6XCk/</link>
		<comments>http://thenubbyadmin.com/2012/05/11/2582/#comments</comments>
		<pubDate>Fri, 11 May 2012 10:45:19 +0000</pubDate>
		<dc:creator>Wesley David</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://thenubbyadmin.com/?p=2582</guid>
		<description><![CDATA[Previously I explored how to limit a user&#8217;s ability to runs commands with sudo. As a tangential topic, I needed to restrict the commands that a user account had access to when they connected to the server via SSH. Specifically, I needed just a few commands to be strung together and executed every time this account connected.<br />
The mechanism that I used to do this was with the authorized_keys file. For a thorough explanation of that file, take a peak ...<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p>]]></description>
			<content:encoded><![CDATA[<p>Previously I explored <a href="http://thenubbyadmin.com/2012/04/11/how-to-restrict-a-users-sudo-rights-to-only-specific-commands/">how to limit a user&#8217;s ability to runs commands with sudo</a>. As a tangential topic, I needed to restrict the commands that a user account had access to when they connected to the server via SSH. Specifically, I needed just a few commands to be strung together and executed every time this account connected.</p>
<p>The mechanism that I used to do this was with the authorized_keys file. For a thorough explanation of that file, take a peak at the <a href="http://linux.die.net/man/8/sshd">man page for sshd</a>. To explain it very simply, the authorized_keys file holds the public keys of other users/systems that are allowed to connect to that machine. For example, I place my main user account&#8217;s public RSA key into the authorized_keys file on the Linux servers that I manage. When I connect to the remote servers using SSH, it checks to see if I&#8217;m who I say I am by challenging me with the public key that it has stored. The user account on my laptop uses the private key to validate itself (yes, the private key is password protected) and I am then allowed to haxor on the servers to my heart&#8217;s content.</p>
<p>Here&#8217;s an example of a public key:</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">ssh-rsa AAAB3NzaC1yc2EAAAADAQABAAABAQDclBxY7lOaolHGaogdcc9GaTQLWMcn2PK4hnQfWlJgeeGqgS66jL4XJyiR9HcgaebBW88Z2sevUxd7g25WhuuRAazfOcElEaE+h6MMPZ94gHY+x+iVAdlNKxLT<span style="color: #000000; font-weight: bold;">/</span>bTvCUXLEft<span style="color: #000000; font-weight: bold;">/</span>yZFpnknnv7jX4ChfSiII9OiAiCzuSdyHt1<span style="color: #000000; font-weight: bold;">/</span>1LgEHgvDIwKMzvTgImm5X<span style="color: #000000; font-weight: bold;">/</span>3IhtOitjJY3Q6yhKQ6LdenQtG<span style="color: #000000; font-weight: bold;">/</span>v+ANqKe6opDuUKc3k9hRmj7aHROxL52paQTEgEMoVLbIoZY4<span style="color: #000000; font-weight: bold;">/</span>yGUzmrZQU45jNqMrbXdAxG4XexZxb7bpTLu91s0DJQGx43JNXwhJVinPgxHLmfyoCSqR1WPqn8E3 testuser<span style="color: #000000; font-weight: bold;">@</span>testserver</pre>
</div>
</div>
<p>The public key, when placed in a system&#8217;s authorized_keys file, can have some extra tidbits added to it that sshd honors. An SSH protocol 2 public key follows this format:</p>
<blockquote><p>options, keytype, base64-encoded key, comment</p></blockquote>
<p>In the above public key, you see the keytype as &#8216;ssh-rsa&#8217; followed by a space, then the key itself followed by a space and finally a comment, which in this case is a username and hostname combination. That&#8217;s a helpful hint to know who this key supposedly belongs to. Notice that there are no options included in the above key, which would come before the keytype.</p>
<p>Some of the options that are available to be parsed by sshd include:</p>
<ul>
<li><strong><code>environment=</code></strong> Changes an environmental variable for the user that is on the receiving end of the connection.</li>
<li><strong><code>from=</code></strong> Only allows connections that use this public key to be initiated from certain hosts. Helpful for the extremely paranoid or the very security conscious (the only difference between the two being pay grade).</li>
<li><strong><code>no-X11-forwarding</code></strong> Because we don&#8217;t need users installing xorg and then browsing the web on a remote instance of Chrome.</li>
</ul>
<p>There are plenty of other options, however the final one that I&#8217;ll mention is the most crucial to this topic: <code>command="command"</code></p>
<p>With the <code>command=</code> option, you can cause a command to be run immediately upon a successful connection to a remote host. Once the command is run, the connection is closed. Notice how that works. The command is immediately run and then once the command finishes, the connection is closed. This is not something that you&#8217;d want to do to a key that is intended to be used interactively by a human.</p>
<p>What could this be good for? In my specific scenario, I am using a backup tool that moves all of the data to stdout which is then piped to ssh for a secure transfer to remote storage. The remote connection would normally look like this: ssh remoteuser@remoteserver &#8221; cat &gt; backupfile.zip&#8221; However, if I edit the authorized keys file, I can restrict the incoming ssh connection to only be allowed to use that specific command.</p>
<p>It&#8217;s just another layer of security to keep people from doing things that they shouldn&#8217;t be doing. Have different ways of achieving a similar goal? Any caveats you know about? Let me know in the comments.
<div style='clear:both'></div>
<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p><img src="http://feeds.feedburner.com/~r/TheNubbyAdmin/~4/gC6pWrf6XCk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://thenubbyadmin.com/2012/05/11/2582/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://thenubbyadmin.com/2012/05/11/2582/</feedburner:origLink></item>
		<item>
		<title>The Downfall of a Meta Server or “Why a Mac Mini Makes a Terrible NMS Server”</title>
		<link>http://feedproxy.google.com/~r/TheNubbyAdmin/~3/oyQo2wRyzcw/</link>
		<comments>http://thenubbyadmin.com/2012/05/09/the-downfall-of-a-meta-server-or-why-a-mac-mini-makes-a-terrible-nms-server/#comments</comments>
		<pubDate>Wed, 09 May 2012 10:51:55 +0000</pubDate>
		<dc:creator>Wesley David</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://thenubbyadmin.com/?p=2562</guid>
		<description><![CDATA[In a recent post named The Making of a Meta Server or “Why I Bought a Mac Mini as a NMS” I explained why I had chosen a brand new, 2012 Mac Mini as my NMS hardware. After two weeks of mind numbing work, I have officially declared the Mac-Mini-as-a-NMS project a failure.<br />
The main problem surrounded Apple&#8217;s custom EFI. Apple hardware does not use a BIOS, but instead uses EFI (note: not, specifically speaking, UEFI). Or rather, it uses an ancient, bastardized ...<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p>]]></description>
			<content:encoded><![CDATA[<p>In a recent post named <a href="http://thenubbyadmin.com/2012/04/25/the-making-of-a-meta-server-or-why-i-bought-a-mac-mini-as-a-nms/">The Making of a Meta Server or “Why I Bought a Mac Mini as a NMS”</a> I explained why I had chosen a brand new, 2012 Mac Mini as my NMS hardware. After two weeks of mind numbing work, I have officially declared the Mac-Mini-as-a-NMS project a failure.</p>
<p>The main problem surrounded Apple&#8217;s custom <a href="http://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface">EFI</a>. Apple hardware does not use a BIOS, but instead uses EFI (note: not, specifically speaking, UEFI). Or rather, it uses an ancient, bastardized version of EFI 1.1. There is a BIOS compatibility layer that allows OSs that can only communicate with a BIOS to operate on the hardware. Most notably Windows. Apple&#8217;s OS also runs on a hard disk that has been partitioned using the GPT partitioning scheme, which isn&#8217;t itself a huge deal, but you might be surprised at the anemic support for GPT boot disks in even modern operating systems.</p>
<p>To use the Mac Mini to boot an OS that needs BIOS compatibility and a MBR disk should be relatively easy. Right? Right!</p>
<h2>Unless Apple is involved.</h2>
<p>There are several things that Apple has mutated away from the EFI standard, one of them being not using the EFI system partition for anything except firmware updates. Their custom EFI implementation has the boot process (as well as some extra filesystem drivers) baked in. The whole EFI experience just never worked like I expected it to. The other trouble is that Boot Camp has been changed in OS X Lion. If you wanted to be hand held through the partitioning process and the creation of a hybrid GPT/MBR disk, you&#8217;re invited to use Boot Camp. However the latest alterations only allow media with Windows images to be accepted. You can no longer (from my ability to understand) use Boot Camp to install non-Windows OSs. Of course, it was always unsupported, but at least it was doable.</p>
<p>During the whole process, I used the EFI boot manager <a href="http://refit.sourceforge.net/">rEFIt</a> which apparently only recently works with OS X Lion. I read more about the GPT partitioning scheme than I ever have previously. I learned more about EFI than I ever wanted to know (although all of that information will come in very handy in the near future). I hand-rolled bootable USB thumbdrives. I tweaked partition tables. I did very nearly everything I could think of except rolling my own EFI boot partition. After the hours had steadily ticked away I decided it was no longer worth it.</p>
<p>After countless errors concerning boot media, partition problems, and blinking cursors, I concede that the latest Mac Mini has defeated me. It has been shipped back to Amazon and I can go back to my Apple-less existence. Speaking of Amazon, I believe that they deserve some praise in this.</p>
<p>Amazon made the returns process easier than any return I have ever made. Anywhere. I stated that the reason I returned it was because software I had intended to use with it was not compatible. As a result of the return not being their fault, I had to pay return shipping. Within just a few clicks, Amazon created a return label. I printed it out, boxed the mini up, taped the label to the box and handed it over to the man behind the UPS Store counter. Within 15 seconds I was walking out of the store. I have the fortune of living just a few hundred miles from an Amazon return center located in the Las Vegas area so the return was processed and money credited back within two days. Thank you, Amazon. You were the only bright spot in this debacle.</p>
<p>I am now investigating other pieces of hardware for this project based on the recommendations of several colleagues. If you have a recommendation, share it with me and the rest of my readers in the comments below. I&#8217;ll certainly write about my second attempt at this project as it happens.</p>
<p>In the end, I&#8217;m not mad. The Apple wasn&#8217;t designed to do what I was asking it to do. It was my fault. My only lingering frustration is that the Mac seems to take any standard technology that it uses and twists it in new and different ways so that your familiairty with a standard becomes more of a liability than an asset. Sound like another familiar company that SysAdmins like to pick on? Then again, Apple isn&#8217;t intended to be in the business market. Let us pause and mourn the passing of the Xserve (I handed my G5 Xserve over to Best Buy for free recycling last year. So, so sad&#8230;).</p>
<p>Any similar experiences with an Apple product? Have you managed to wedge an alternate OS on 2012 Apple hardware? Let me know in the comments below.
<div style='clear:both'></div>
<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p><img src="http://feeds.feedburner.com/~r/TheNubbyAdmin/~4/oyQo2wRyzcw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://thenubbyadmin.com/2012/05/09/the-downfall-of-a-meta-server-or-why-a-mac-mini-makes-a-terrible-nms-server/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://thenubbyadmin.com/2012/05/09/the-downfall-of-a-meta-server-or-why-a-mac-mini-makes-a-terrible-nms-server/</feedburner:origLink></item>
		<item>
		<title>Remind Me How to Set Up a SOCKS Proxy</title>
		<link>http://feedproxy.google.com/~r/TheNubbyAdmin/~3/SNzubFfASV0/</link>
		<comments>http://thenubbyadmin.com/2012/05/07/remind-me-how-to-set-up-a-socks-proxy/#comments</comments>
		<pubDate>Mon, 07 May 2012 10:18:51 +0000</pubDate>
		<dc:creator>Wesley David</dc:creator>
				<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://thenubbyadmin.com/?p=2564</guid>
		<description><![CDATA[I have had to repeatedly jog my faulty memory concerning how to set up a SOCKS proxy. Thus, I am using this blog as my public sticky note to remind myself. Specifically, I forget what options I like to pass through the SOCKS aware SSH client when connecting to the SOCKS aware SSH server.<br />
A SOCKS proxy is easy to set up. It&#8217;s nothing more than an SSH server and an SSH client that speak the SOCKS protocol. In my ...<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p>]]></description>
			<content:encoded><![CDATA[<p>I have had to repeatedly jog my faulty memory concerning how to set up a SOCKS proxy. Thus, I am using this blog as my public sticky note to remind myself. Specifically, I forget what options I like to pass through the SOCKS aware SSH client when connecting to the SOCKS aware SSH server.</p>
<p>A SOCKS proxy is easy to set up. It&#8217;s nothing more than an SSH server and an SSH client that speak the SOCKS protocol. In my case, I use OpenSSH. If you use a different SSH server or some other form of making a SOCKS proxy, this little post will be of little use to you. However, stick around because there&#8217;s a note down below concerning the false sense of security many people have when using a SOCKS proxy.</p>
<p>There&#8217;s a handy little option in the OpenSSH client that allows for the creation of a a local port binding that immediately forwards traffic to that port to another machine: -D. After that part of the command, simply include the username and host for the OpenSSH server that you want all local traffic bound for that local port to be relayed through. It makes it all the sweeter if you have RSA keypairs set up between hosts.</p>
<p>In my case, I usually use this set of options:</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-fCND</span> localhost:<span style="color: #000000;">8080</span> user<span style="color: #000000; font-weight: bold;">@</span>myserver.thenubbyadmin.com</pre>
</div>
</div>
<p>Let me peel back those other three options that I use:</p>
<ul>
<li><code>-f</code> sends ssh to the background just before the command is executed.</li>
<li><code>-N</code> refuses to execute remote commands. This way I know nothing is going to be run via the SSH connection on the remote machine. I&#8217;m paranoid.</li>
<li><code>-C</code> compresses the TCP traffic. This might not be ideal if you have a good connection as it is stated in the man pages for the OpenSSH client that -C slows down your throughput on fast connections.</li>
</ul>
<h2>Application Support</h2>
<p>The applications that you want to use with the SOCKS proxy need to have explicit options to support it. It&#8217;s not something that can be done underneath the application without its knowledge. For example, most web browsers have an option to use a SOCKS proxy within their advanced options section.</p>
<p>You will want to go to the options page of your application and search for SOCKS support. From there, tell the application to use localhost:port# as the proxy. In my case, I made port 8080 to be the local port that listens for traffic and then forwards it to my remote server.</p>
<p>If you need a secure connection that can be put in place without an application&#8217;s knowledge, you&#8217;ll need to implement a VPN.</p>
<h2>You&#8217;re Not as Anonymous as You Think You Are</h2>
<p>If you&#8217;re using the SOCKS proxy for the purposes of secure browsing, know that your DNS requests are an entirely different application layer traffic. Unless your DNS client is also set up to use the SOCKS proxy, your DNS requests will be plainly visible on the network that you are trying to remain anonymous / protected on. This can cause problems if you&#8217;re on an untrusted network. Owning the DNS servers that a machine is using is one of the most sure ways of wreaking havoc.</p>
<p>Have any other SOCKS tips? Do you use a different client or server? Let me know in the comments.
<div style='clear:both'></div>
<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p><img src="http://feeds.feedburner.com/~r/TheNubbyAdmin/~4/SNzubFfASV0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://thenubbyadmin.com/2012/05/07/remind-me-how-to-set-up-a-socks-proxy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://thenubbyadmin.com/2012/05/07/remind-me-how-to-set-up-a-socks-proxy/</feedburner:origLink></item>
		<item>
		<title>How to Make a Bootable CentOS 6 USB Drive</title>
		<link>http://feedproxy.google.com/~r/TheNubbyAdmin/~3/K8OCeRzarN8/</link>
		<comments>http://thenubbyadmin.com/2012/05/04/how-to-make-a-bootable-centos-6-usb-drive/#comments</comments>
		<pubDate>Fri, 04 May 2012 14:14:29 +0000</pubDate>
		<dc:creator>Wesley David</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://thenubbyadmin.com/?p=2555</guid>
		<description><![CDATA[When making a bootable USB drive to install CentOS 6 from, you will need two primary partitions, one of them marked with the boot flag. One partition will be the boot partition and one will be a data partition that has the ISO file on it. As of this blog post, to make a CentOS 6 bootable USB drive, you&#8217;ll need a USB drive that has a little more than twice the space that your ISO file itself takes up. ...<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p>]]></description>
			<content:encoded><![CDATA[<p>When making a bootable USB drive to install CentOS 6 from, you will need two primary partitions, one of them marked with the boot flag. One partition will be the boot partition and one will be a data partition that has the ISO file on it. As of this blog post, to make a CentOS 6 bootable USB drive, you&#8217;ll need a USB drive that has a little more than twice the space that your ISO file itself takes up. There is a bug that requires the ISO&#8217;s <em>contents</em> to be on the boot partition and the .iso file itself to be on the data partition. In essence you&#8217;re duplicating the ISO file and you still need some space left over for bootloader information. In my case, I&#8217;m using the minimal CentOS image, so space requirements are under 1GB.</p>
<p>At this point, go out and grab the CentOS ISO that interests you. Have it on your filesystem because we&#8217;ll be mounting it and copying some files from it. Once you&#8217;ve got the ISO you can move on to partitioning the drive.</p>
<h2>Partitioning</h2>
<p>First, you&#8217;ll want to partition the USB drive. We&#8217;ll be using plain ol&#8217; MBR style partition tables and two primary partitions. I&#8217;m not going to hand-hold you through this part of the process. Use whatever partitioning tool you want and follow the guidelines below. <a href="http://en.wikipedia.org/wiki/GParted">GParted</a> is fine if you use Gnome, <code>parted</code> is great if you want to use a shell, and <a href="http://en.wikipedia.org/wiki/Fdisk">fdisk</a> works on both Windows and *NIX environments.</p>
<p>The partition layout will be thus:</p>
<ol>
<li>A primary partition that uses the FAT16 filesystem and is at least as big as your ISO plus about 50MB. You need to give it the boot flag.</li>
<li>A primary partition that uses ext2 and is at least as big as your ISO. Preferably you&#8217;ll just use up the rest of your USB drive&#8217;s free space for this partition.</li>
</ol>
<p>Once your partitions are set up, we&#8217;ve got some file moving to do.</p>
<h2>Setting the Filesystems Up</h2>
<p>You&#8217;ll want to mount your two partitions so that you can access them. In my case, the first partition (the FAT16 boot partition) is /dev/sdc1 and the data partition (the one formatted in ext2) is /dev/sdc2. I&#8217;ve mounted sdc1 as /mnt/usbboot and sdc2 as /mnt/usbdata. I will be using that nomenclature throughout the rest of this post.</p>
<p>You&#8217;ll also want to mount your CentOS ISO as a filesystem because we need to copy some files off of it. In my case, I ran <code>mount -o loop /path/to/iso/file.iso /mnt/centosiso</code> and will be using /mnt/centosiso in my examples below. Now that we&#8217;ve got all of our filesystems mounted, we&#8217;ll start the procedures.</p>
<p>First, go to the mounted CentOS iso and copy the /isolinux directory to the boot partition of the USB drive.</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>centosiso<span style="color: #000000; font-weight: bold;">/</span>isolinux <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>usbboot</pre>
</div>
</div>
<p>Rename the isolinux folder on the USB drive to syslinux</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>usbboot<span style="color: #000000; font-weight: bold;">/</span>isolinux <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>usbboot<span style="color: #000000; font-weight: bold;">/</span>syslinux</pre>
</div>
</div>
<p>Rename the isolinux.cfg file to syslinux.cfg</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>usbboot<span style="color: #000000; font-weight: bold;">/</span>syslinux<span style="color: #000000; font-weight: bold;">/</span>isolinux.cfg <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>usbboot<span style="color: #000000; font-weight: bold;">/</span>syslinux<span style="color: #000000; font-weight: bold;">/</span>syslinux.cfg</pre>
</div>
</div>
<p>Now we need to copy the <em>contents</em> of the /mnt/centosiso/images folder to the USB boot partition. Notice that I emphasis that this is a copy of the contents within the ISO&#8217;s images folder. A little later on we&#8217;ll be copying over the entire ISO as a file.</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>centosiso<span style="color: #000000; font-weight: bold;">/</span>images <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>usbboot</pre>
</div>
</div>
<p>Finally, we copy the .iso file itself to the <em>data</em> partition (not the boot partition that we were just working with!):</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>iso<span style="color: #000000; font-weight: bold;">/</span>file.iso <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>usbdata</pre>
</div>
</div>
<p>Once all that is done, we have to install a bootloader. I&#8217;ll use the simple syslinux loader. We want to use our smaller volume (the one that we set the boot flag on up in the partitioning section) as the target for the syslinux command.</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">syslinux <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdc1</pre>
</div>
</div>
<p>Now, we dismount our USB drive and test it out by booting from it on another system!</p>
<h2 style="text-align: left;"><img class="aligncenter" title="Install CentOS Bootloader" src="http://thenubbyadmin.com/wp-content/uploads/2012/04/install-centos.png" alt="" width="578" height="434" /> </p>
<hr />
<em>Finoto!</em></h2>
<p>You should now have a bootable CentOS 6 USB drive. CentOS 6 is somewhat unique as a result of the bug that requires the images directory to be included on the boot partition, but other than that it&#8217;s relatively straight forward.
<div style='clear:both'></div>
<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p><img src="http://feeds.feedburner.com/~r/TheNubbyAdmin/~4/K8OCeRzarN8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://thenubbyadmin.com/2012/05/04/how-to-make-a-bootable-centos-6-usb-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://thenubbyadmin.com/2012/05/04/how-to-make-a-bootable-centos-6-usb-drive/</feedburner:origLink></item>
		<item>
		<title>Finding OS X Version and Build Information From the Command Line</title>
		<link>http://feedproxy.google.com/~r/TheNubbyAdmin/~3/3GTBUreHIcY/</link>
		<comments>http://thenubbyadmin.com/2012/05/02/finding-os-x-version-and-build-information-from-the-command-line/#comments</comments>
		<pubDate>Wed, 02 May 2012 14:32:57 +0000</pubDate>
		<dc:creator>Wesley David</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://thenubbyadmin.com/?p=2537</guid>
		<description><![CDATA[To find out what version (and often build number as well) of OS X you&#8217;re running using the Terminal, you&#8217;ve got several options. The first and likely the most obvious (and simple) is using sw_version.<br />
<br />
<br />
macmeta:~ user$ sw_vers<br />
ProductName: Mac OS X<br />
ProductVersion: 10.7.3<br />
BuildVersion: 11D50d<br />
<br />
<br />
You can retrieve the specific information that you want using the following options: -productName &#124; -productVersion &#124; -buildVersion<br />
<br />
<br />
macmeta:~ aoi$ sw_vers -productVersion<br />
10.7.3<br />
<br />
<br />
You can cat out ...<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p>]]></description>
			<content:encoded><![CDATA[<p>To find out what version (and often build number as well) of OS X you&#8217;re running using the Terminal, you&#8217;ve got several options. The first and likely the most obvious (and simple) is using sw_version.</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">macmeta:~ user$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.7.3
BuildVersion: 11D50d</pre>
</div>
</div>
<p>You can retrieve the specific information that you want using the following options: <code>-productName | -productVersion | -buildVersion</code></p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">macmeta:~ aoi$ sw_vers <span style="color: #660033;">-productVersion</span>
10.7.3</pre>
</div>
</div>
<p>You can cat out <code>/System/Library/CoreServices/SystemVersion.plist</code> and eyeball the XML that comes back. In my case:</p>
<div class="wp_syntax">
<div class="code">
<pre class="xml" style="font-family:monospace;">macmeta:~ user$ cat /System/Library/CoreServices/SystemVersion.plist
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plist</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProductBuildVersion<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>11D50d<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProductCopyright<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1983-2012 Apple Inc.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProductName<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Mac OS X<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProductUserVisibleVersion<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>10.7.3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProductVersion<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>10.7.3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre>
</div>
</div>
<p>Or you could merely add <code>grep -C 2 ProductVersion</code>.</p>
<div class="wp_syntax">
<div class="code">
<pre class="xml" style="font-family:monospace;">macmeta:~ user$ cat /System/Library/CoreServices/SystemVersion.plist | grep -C 2 ProductVersion
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProductUserVisibleVersion<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>10.7.3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProductVersion<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>10.7.3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre>
</div>
</div>
<p>Using <code>system_profiler SPSoftwareDataType</code> gives you lots of information including kernel version:</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">macmeta:~ user$ system_profiler SPSoftwareDataType
Software:
&nbsp;
    System Software Overview:
&nbsp;
      System Version: Mac OS X 10.7.3 <span style="color: #7a0874; font-weight: bold;">&#40;</span>11D50d<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      Kernel Version: Darwin 11.3.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: macmeta
      User Name: USER <span style="color: #7a0874; font-weight: bold;">&#40;</span>user<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      Secure Virtual Memory: Enabled
      <span style="color: #000000;">64</span>-bit Kernel and Extensions: Yes
      Time since boot: <span style="color: #000000;">56</span> minutes</pre>
</div>
</div>
<p>Those accustomed to using ye olden *NIX uname -a will find that it only gives the Darwin kernel information.</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">macmeta:~ user$ <span style="color: #c20cb9; font-weight: bold;">uname</span> <span style="color: #660033;">-a</span>
Darwin macmeta.tc.ph.cox.net 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan <span style="color: #000000;">12</span> <span style="color: #000000;">18</span>:<span style="color: #000000;">47</span>:<span style="color: #000000;">41</span> PST <span style="color: #000000;">2012</span>; root:xnu-1699.24.23~<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>RELEASE_X86_64 x86_64</pre>
</div>
</div>
<p>And I saved the ugliest for last! <code>osascript</code> is a tool that can be used to run AppleScript. with the <code>-e</code> option, it will run a single line script that you enter. Let&#8217;s try <code>osascript -e 'system info'</code>:</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">macmeta:~ user$ osascript <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'system info'</span>
AppleScript version:2.2.1, AppleScript Studio version:1.5.2, system version:10.7.3, short user name:aoi, long user name:AOI, user ID:<span style="color: #000000;">501</span>, user locale:en_US, home directory:<span style="color: #7a0874; font-weight: bold;">alias</span> Macintosh HD:Users:aoi:, boot volume:Macintosh HD, computer name:macmeta, host name:macmeta.tc.ph.cox.net, IPv4 address:192.168.11.119, primary Ethernet address:<span style="color: #000000;">40</span>:6c:8f:0d:<span style="color: #000000;">48</span>:a6, CPU <span style="color: #7a0874; font-weight: bold;">type</span>:Intel <span style="color: #000000;">80486</span>, CPU speed:<span style="color: #000000;">2300</span>, physical memory:<span style="color: #000000;">2048</span></pre>
</div>
</div>
<p>As you can see, it brings back a ton of info, including the system version.</p>
<p>Know of any other ways to find the system version and build numbers of OS X? Let me know in the comments.
<div style='clear:both'></div>
<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p><img src="http://feeds.feedburner.com/~r/TheNubbyAdmin/~4/3GTBUreHIcY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://thenubbyadmin.com/2012/05/02/finding-os-x-version-and-build-information-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://thenubbyadmin.com/2012/05/02/finding-os-x-version-and-build-information-from-the-command-line/</feedburner:origLink></item>
		<item>
		<title>What version of EFI is my Mac OS X Computer Running?</title>
		<link>http://feedproxy.google.com/~r/TheNubbyAdmin/~3/_GL1u3l4ufU/</link>
		<comments>http://thenubbyadmin.com/2012/04/30/what-version-of-efi-is-my-mac-os-x-computer-running/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 13:47:17 +0000</pubDate>
		<dc:creator>Wesley David</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://thenubbyadmin.com/?p=2532</guid>
		<description><![CDATA[There comes a time when it is expedient to know some version information about the EFI firmware running on Apple OS X. In my case, I just wanted to make sure that I had EFI64. I knew I did, but&#8230; seeing is believing.<br />
As of OS X 10.7.3, to find out information concerning what version of Apple&#8217;s EFI firmware you are running, perform the following command at a terminal:<br />
<br />
<br />
ioreg -p IODeviceTree -b -n efi &#124; grep efi ...<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p>]]></description>
			<content:encoded><![CDATA[<p>There comes a time when it is expedient to know some version information about the EFI firmware running on Apple OS X. In my case, I just wanted to make sure that I had EFI64. I knew I did, but&#8230; seeing is believing.</p>
<p>As of OS X 10.7.3, to find out information concerning what version of Apple&#8217;s EFI firmware you are running, perform the following command at a terminal:</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">ioreg <span style="color: #660033;">-p</span> IODeviceTree <span style="color: #660033;">-b</span> <span style="color: #660033;">-n</span> efi <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> efi <span style="color: #660033;">-C</span> <span style="color: #000000;">4</span></pre>
</div>
</div>
<p>In my case, the output is as follows:</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">+-o Root  <span style="color: #000000; font-weight: bold;">&lt;</span>class IORegistryEntry, <span style="color: #c20cb9; font-weight: bold;">id</span> 0x100000100, retain <span style="color: #000000;">10</span><span style="color: #000000; font-weight: bold;">&gt;</span>
  +-o <span style="color: #000000; font-weight: bold;">/</span>  <span style="color: #000000; font-weight: bold;">&lt;</span>class IOPlatformExpertDevice, <span style="color: #c20cb9; font-weight: bold;">id</span> 0x100000110, registered, matched, active, busy <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">15221</span> ms<span style="color: #7a0874; font-weight: bold;">&#41;</span>, retain <span style="color: #000000;">37</span><span style="color: #000000; font-weight: bold;">&gt;</span>
    +-o chosen  <span style="color: #000000; font-weight: bold;">&lt;</span>class IOService, <span style="color: #c20cb9; font-weight: bold;">id</span> 0x100000101, <span style="color: #000000; font-weight: bold;">!</span>registered, <span style="color: #000000; font-weight: bold;">!</span>matched, active, busy <span style="color: #000000;">0</span>, retain <span style="color: #000000;">5</span><span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">|</span> +-o memory-map  <span style="color: #000000; font-weight: bold;">&lt;</span>class IOService, <span style="color: #c20cb9; font-weight: bold;">id</span> 0x100000102, <span style="color: #000000; font-weight: bold;">!</span>registered, <span style="color: #000000; font-weight: bold;">!</span>matched, active, busy <span style="color: #000000;">0</span>, retain <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">&gt;</span>
    +-o efi  <span style="color: #000000; font-weight: bold;">&lt;</span>class IOService, <span style="color: #c20cb9; font-weight: bold;">id</span> 0x100000103, <span style="color: #000000; font-weight: bold;">!</span>registered, <span style="color: #000000; font-weight: bold;">!</span>matched, active, busy <span style="color: #000000;">0</span>, retain <span style="color: #000000;">8</span><span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span>   <span style="color: #ff0000;">&quot;firmware-revision&quot;</span> = <span style="color: #000000; font-weight: bold;">&lt;</span>0a000100<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span>   <span style="color: #ff0000;">&quot;device-properties&quot;</span> = <span style="color: #000000; font-weight: bold;">&lt;</span>fe04000001000000040000000e0200000500000002010c00d041030a000000000101060000027fff04001e00000073006100760065006400$
    <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span>   <span style="color: #ff0000;">&quot;firmware-abi&quot;</span> = <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #ff0000;">&quot;EFI64&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span>   <span style="color: #ff0000;">&quot;name&quot;</span> = <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #ff0000;">&quot;efi&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span>   <span style="color: #ff0000;">&quot;firmware-vendor&quot;</span> = <span style="color: #000000; font-weight: bold;">&lt;</span>4100700070006c0065000000<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span>
    <span style="color: #000000; font-weight: bold;">|</span> +-o kernel-compatibility  <span style="color: #000000; font-weight: bold;">&lt;</span>class IOService, <span style="color: #c20cb9; font-weight: bold;">id</span> 0x100000104, <span style="color: #000000; font-weight: bold;">!</span>registered, <span style="color: #000000; font-weight: bold;">!</span>matched, active, busy <span style="color: #000000;">0</span>, retain <span style="color: #000000;">4</span><span style="color: #000000; font-weight: bold;">&gt;</span></pre>
</div>
</div>
<p>And the text that I&#8217;m most interested in is &#8220;firmware-abi&#8221; = &lt;&#8221;EFI64&#8243;&gt;</p>
<p>To explain the above, ioreg is used to query the <a href="http://developer.apple.com/library/mac/#documentation/DeviceDrivers/Conceptual/IOKitFundamentals/TheRegistry/TheRegistry.html">Apple I/O registry</a>. We then need to select the Device Tree plane and do so with -p IODeviceTree. -b is just a nicety to put the object name in bold letters. -n scopes the query down to only those things that have a certain name in them. In our case, we want the name of &#8220;efi&#8221;.</p>
<p>We then pipe the whole mess to grep where we search for the word &#8220;efi&#8221; and then, with -C, give four lines of context above and below each mention of the word &#8220;efi&#8221;.</p>
<p>Simple!
<div style='clear:both'></div>
<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p><img src="http://feeds.feedburner.com/~r/TheNubbyAdmin/~4/_GL1u3l4ufU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://thenubbyadmin.com/2012/04/30/what-version-of-efi-is-my-mac-os-x-computer-running/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://thenubbyadmin.com/2012/04/30/what-version-of-efi-is-my-mac-os-x-computer-running/</feedburner:origLink></item>
		<item>
		<title>Solving Failed VNC Connections to OS X</title>
		<link>http://feedproxy.google.com/~r/TheNubbyAdmin/~3/ZFe1VsBmSrQ/</link>
		<comments>http://thenubbyadmin.com/2012/04/27/solving-failed-vnc-connections-to-os-x/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 13:53:24 +0000</pubDate>
		<dc:creator>Wesley David</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://thenubbyadmin.com/?p=2529</guid>
		<description><![CDATA[My Problem<br />
I have a new Mac Mini running OS X Lion that I need remote access to. I&#8217;ve enabled &#8220;Screen Sharing&#8221; in Sharing Preferences, created a VNC password and ensured that Screen Sharing is allowed through the firewall.<br />
Using various VNC clients, I receive different forms of bizarre errors and refused connections. In Remmina on Fedora 14, I cannot connect to the Apple VNC server. Either a connection is made and I see a very brief flicker of a ...<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p>]]></description>
			<content:encoded><![CDATA[<h2>My Problem</h2>
<p>I have a new Mac Mini running OS X Lion that I need remote access to. I&#8217;ve enabled &#8220;Screen Sharing&#8221; in Sharing Preferences, created a VNC password and ensured that Screen Sharing is allowed through the firewall.</p>
<p>Using various VNC clients, I receive different forms of bizarre errors and refused connections. In Remmina on Fedora 14, I cannot connect to the Apple VNC server. Either a connection is made and I see a very brief flicker of a remote connection before the window is closed or the connection perpetually hangs at the &#8220;Connecting&#8230;&#8221; stage.</p>
<p>Using UltraVNC on Windows 7 I receive the error:</p>
<blockquote><p>Server closed connection</p>
<p>- the server running as application</p></blockquote>
<h2>My Solution</h2>
<p>Edit your bit-depth settings in your VNC client (not on the receiving Apple computer). Change the bit depth to something other than 256 colors or 32-bit. For example, I can connect to the Mac&#8217;s VNC server using 15, 16 or 24-bit color depths. As soon as I choose 256 colors or 32-bit I am unable to make a connection.</p>
<p>I suppose Apple wants their GUI to be enjoyed in its full glory and 256 colors is just too shabby. 32-bit? Well, that&#8217;s not minimalistic enough.
<div style='clear:both'></div>
<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p><img src="http://feeds.feedburner.com/~r/TheNubbyAdmin/~4/ZFe1VsBmSrQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://thenubbyadmin.com/2012/04/27/solving-failed-vnc-connections-to-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://thenubbyadmin.com/2012/04/27/solving-failed-vnc-connections-to-os-x/</feedburner:origLink></item>
		<item>
		<title>The Making of a Meta Server or “Why I Bought a Mac Mini as a NMS”</title>
		<link>http://feedproxy.google.com/~r/TheNubbyAdmin/~3/1dMDjIFzb20/</link>
		<comments>http://thenubbyadmin.com/2012/04/25/the-making-of-a-meta-server-or-why-i-bought-a-mac-mini-as-a-nms/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 14:35:11 +0000</pubDate>
		<dc:creator>Wesley David</dc:creator>
				<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://thenubbyadmin.com/?p=2523</guid>
		<description><![CDATA[There&#8217;s a small office that I&#8217;ve done consistent work with for the last five years. I&#8217;m their contracted IT director on a part-time schedule. Anything that could even loosely be called &#8220;technology&#8221; is up to me to understand, explain, and make work. More than just a technology worker, I have to understand the business&#8217;s goals, mission and workflows first and foremost to then be able to profitably apply technology. I&#8217;ve submitted many board reports over the years and had to ...<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a small office that I&#8217;ve done consistent work with for the last five years. I&#8217;m their contracted IT director on a part-time schedule. Anything that could even loosely be called &#8220;technology&#8221; is up to me to understand, explain, and make work. More than just a technology worker, I have to understand the business&#8217;s goals, mission and workflows first and foremost to then be able to profitably apply technology. I&#8217;ve submitted many board reports over the years and had to counsel the director and president on more technology related topics than I can ever hope to remember.</p>
<p>However, I&#8217;ve been a bad IT person. I haven&#8217;t proactively monitored their IT assets. I can make any number of excuses for myself, but none really mollifies me (nor would it satisfy anyone else with even just a <em>hint</em> of a desire to do a job right). An interesting fact is that some of my very first attempts at blogging (back in 2007 or 2008) were as a result of my attempts at making a monitoring system for this organization. That blog, a shared Drupal CMS between me and a friend, is long gone. However the nagging need for a thorough &#8220;Meta Server&#8221; has haunted me ever since.</p>
<p>The organization is suddenly expanding into a new field for them. They have high hopes and are tackling this new project head on. Their exact growth potential is unknown at the moment, but I want to put the long needed information reporting infrastructure in place now before much more moves forward. A few new websites will be made for the organization&#8217;s endeavors and both will be a large part of the success (or failure) of this new phase of growth. If I don&#8217;t know about their website / server / PC infrastructure health before I get panic-stricken phone calls, then I can consider myself a complete failure as a SysAdmin.</p>
<h2>&#8220;What is a Meta Server?!&#8221;</h2>
<p>A &#8220;Meta Server&#8221; is what I like to call any node whose sole purpose is to collect and display information that is largely of no interest to a standard user. You&#8217;re unlikely to see the term anywhere else because I just made it up (or if it <em>is</em> in use elsewhere, please, whoever came up with it, don&#8217;t sue me).</p>
<p>It&#8217;s the kind of thing that is where notes are stored, wikis are stood up, NMSs sweep, trends are graphed and bitknobs are virtually twiddled. In larger places, you might have a &#8220;Meta Rack&#8221; but I&#8217;ve never worked in an environment so large as to need stacks of meta servers. Oh if only&#8230;</p>
<p>My intention for this server is not to be just an NMS, in spite of the title of this blog post. It&#8217;s much more than that. Let&#8217;s take a look at what my plans are for it.</p>
<h2>The Software</h2>
<p>My plans for the meta server are many. I want monitoring, alerting, trending, help desk, asset/inventory management, log collection, imaging, perhaps a wiki&#8230; lots of stuff. Since it&#8217;s a small office with little need for a multitude of servers I can&#8217;t separate these roles out onto difference pieces of hardware, nor do I really <em>need</em> to unless there&#8217;s some glaring incompatibility between packages. Even if there was some kind of package incompatibility between tools, I&#8217;d prefer to just use <a href="http://linux-vserver.org/Welcome_to_Linux-VServer.org">Linux-VServer</a> or something similar to stand up a virtual instance.</p>
<p>To expand on the list of topics just above, I&#8217;m very interested in the health of the network itself as well as the nodes on the network. I want to scan the network for devices and get alerts when new things show up. I want to poll each device, PC, laptop, printer, server, WAP, modem, switch&#8230; you name it, for vital statistics. That can be through SNMP, netflow, sflow, or an agent installed onto the operating system (in the case of a PC with a full OS on it). I want speed and latency statistics for our ISP connection too. This bundle of requirements necessitates probably three, maybe four separate tools.</p>
<p>I haven&#8217;t settled 100% on the applications that I&#8217;ll be using, but I have a pretty good idea that either <a href="http://www.opennms.org/">OpenNMS</a> or <a href="http://pandorafms.org/">Pandora FMS</a> will be the main monitoring and alerting system. For prettier graphs to look at, <a href="http://www.observium.org/">Observium</a> is high on my list. I might use <a href="http://www.ntop.org/">ntop</a> for netflow analysis, <a href="http://rembrandt0.uva.netherlight.nl/rtpl/das3/doc/manual/install.html">rTPL</a> for scheduled throughput tests and <a href="http://oss.oetiker.ch/smokeping/">smokeping</a> for latency monitoring. <a href="http://munin-monitoring.org/">Munin</a> may play a part as well; I haven&#8217;t decided yet.</p>
<p>For log collection, I&#8217;m interested in <a href="http://www.splunk.com/">Splunk</a>&#8216;s community edition, but <a href="http://www.graylog2.org/">graylog2</a> is appealing as well. I&#8217;d probably use the <a href="http://www.intersectalliance.com/projects/SnareWindows/">Snare Agent for Windows</a> to collect logs from my Windows hosts and send it all to graylog2 &#8211; if that&#8217;s the direction I go. However, Alien Vault&#8217;s <a href="http://communities.alienvault.com/community">OSSIM</a> is also in the running.</p>
<p>For a help desk, I&#8217;m almost 100% sold on <a href="http://bestpractical.com/rt/">RT</a>. I&#8217;m currently using <a href="http://www.spiceworks.com/">SpiceWorks</a>&#8216;s help desk on a Windows server, but that&#8217;s a bit heavy for my needs. I don&#8217;t use most of its other management tools. It&#8217;s asset management and network monitoring is&#8230; okay. It&#8217;s a bit rigid for my tastes, however.</p>
<p>I&#8217;m also interested in having a simple PXE boot imaging tool on the network. I have long been a fan of the <a href="http://www.fogproject.org/">FOG project</a>. This goal of mine isn&#8217;t to start creating an extensive image library. Instead, I just want to take the occasional quick image of a PC before a major change and also to be able to boot a PC over the network onto an anti-virus image to perform an offline virus scan. I&#8217;ll need some decent storage space to keep a few images around depending on which user&#8217;s PC may need to be quickly backed up. A few hundred GBs would be nice.</p>
<p>I&#8217;m considering the use of Monit for some automated response, but since I don&#8217;t have many *nix devices to contend with, that might be wasted effort. Then again, automating things is never wasted effort!</p>
<p>There might be a documentation wiki thrown in there for good measure. Currently I use the hosted wiki service of Zoho, but I am considering moving it in-house.</p>
<p>It has occurred to me that such a small device may be a prime target for theft so I&#8217;m considering volume encryption to protect the data. If someone wants the hardware bad enough, they can have it. However, I don&#8217;t want them to have any valuable data to play with. I&#8217;m sure it&#8217;s very unlikely that a smash-and-grab thief would have the interest or skills to do much with the data, but&#8230; still.</p>
<h2>The Hardware</h2>
<p>First, let&#8217;s clear something up. As often as I refer to this needed device as a &#8220;server&#8221; it is not, in fact, a &#8220;server&#8221; by any enterprise understanding of that word. It is just a device that serves, but is not intended to be made up of components that are traditionally thought of as &#8220;server grade.&#8221;</p>
<p>Since it&#8217;s a small office, it doesn&#8217;t have a proper server rack. It has more of a closet than anything. The closet is better than the &#8220;Just set that server down next to my desk; it&#8217;ll be fine, my door locks!&#8221; situation I found myself in years ago. The device needs to be small.</p>
<p>I&#8217;ve been collecting a large list of small form factor PCs for quite some time now. I like small things, especially when the alternative is cramming a 6 year old workstation next to the building&#8217;s demarc point to act as a caching proxy (I bet you&#8217;ve done that). I&#8217;ve got to narrow the market of small PCs down to a manageable pool using some base requirements.</p>
<p>My goals for the hardware are the following:</p>
<ol>
<li>I don&#8217;t want a development board. Things like the RaspberryPi or the Hawkboard won&#8217;t cut it. I want a production piece of equipment that is manufactured in decent quantities and is intended for a broader consumer base than hardware hackers and developers. The BeagleBoard is on the edge of that grouping because of its wide acceptance, but it&#8217;s still iffy. I&#8217;m sure some will say &#8220;Oh but the Hawkboard&#8230;&#8221; or &#8220;Hey, the BeagleBoard does&#8230;&#8221; and that&#8217;s fine. It&#8217;s just that in my research, they don&#8217;t seem to be dead ringers for well supported, hard-working devices.</li>
<li>At least 250GB of internal storage. I don&#8217;t want to deal with CF cards like many micro-ITX boxes use. They don&#8217;t have enough storage and regardless of how advanced the wear leveling algorithms are, I don&#8217;t want to worry about block wear on a device that already has precious little space. NAND flash is also prone to soft read errors that makes you reliant on the ECC of the card itself. That&#8217;s too many variables for my comfort at this moment. Also, I want the storage to be internal as a matter of preference. I&#8217;m trying to get away from a &#8220;Just attach another USB hard drive!&#8221; mentality. That and I just don&#8217;t like USB buses as a rule.</li>
<li>At least 2GB of RAM. I&#8217;m going to have a lot of daemons running and I&#8217;d prefer to take a RAM ceiling out of the equation.</li>
<li>Price: I want to keep it around the $500 mark. If it can happen for less that&#8217;s great.</li>
</ol>
<p>Over the years of keeping this project on the backburner and also considering building other similar meta servers, I&#8217;ve looked at NetGate cases, the Fit-PC, BeagleBoard-based systems, SlimPRO, Pearl D series, and various models of thin clients and plug PCs. I do have a soft spot for plug PCs, but none of them meet the above criterion.</p>
<h2>The Final Choice</h2>
<p>After searching far and wide, the one PC that kept coming to the top of the pack was the <a href="http://www.fit-pc.com/web/">Fit-PC</a>. I&#8217;ve had my eye on it for years and watched as its design have iterated past version 1, through version 2 and now on to version 3. It&#8217;s a handy little thing (form-factor pun intended) that has some decent resources. The latest version can include a 250 GB platter hard drive with 2GB of RAM and a 1GHz APU G-T40N processor. The price is a tad steep at $480 plus VAT and shipping.</p>
<p>I mulled the option. After shipping and tax, it would be over $500. Could I really justify that much money for what I was getting? Certainly the value of what I was going to <strong><em>do</em></strong> with it was worth it. I just&#8230; I wasn&#8217;t sure.</p>
<p>Then it hit me. A Mac Mini. The cheapest brand-new Mac Mini one can find (legitimately) is about $569 USD. And what does one of those shiny suckers have in it? 4GB of RAM, a 500GB hard drive and an Intel i5 processor. Furthermore, I can get it on Amazon.com straight from Apple&#8217;s store with no shipping fees and no sales tax. It has twice the RAM (2GB would probably suffice, but more is always better!), twice the hard drive space (very much useful considering the imaging server portion of the project) and an Intel i5 (could come in handy for encryption and report generating). Furthermore, love or hate Apple, their hardware is rock solid (iPhone recpetion issues notwithstanding).</p>
<p>For just a handful of dollars more, I get double the resources (more than double if you consider the CPU). I had been approved for a $500 purchase, but with just one five minute phone call later a $569 Mac Mini had been approved.</p>
<p>As for the OS, I am highly unlikely to be using OS X (highly). I&#8217;ll almost certainly put CentOS 6 on it and be on my merry way.</p>
<h2>Retrospective</h2>
<p>In talking with colleagues, I&#8217;ve taken a tiny bit of flak for making such an expensive NMS. Certainly, I think I could perhaps build a similar box for <em>slightly</em> cheaper, but without the i5. I&#8217;d likely need to use an Atom processor to keep the price down. However, the time for me to build the thing still costs my client money. Perhaps other solutions exist off-the-shelf with similar specs &#8211; but I wasn&#8217;t able to find them. Once again, research time costs.</p>
<p>In the end, I&#8217;m sitting here, a brand new Mac Mini still in its box next to me. I don&#8217;t have any regrets&#8230; yet. I&#8217;m eager to get this project going and hope to blog more about its progress, starting with the installation of CentOS on Apple hardware.</p>
<p>So what do you think? Did I blow it? Did I have other compelling options that I missed? Would you be happy with a Mac Mini &#8220;Meta Server?&#8221; Let me know in the comment below.
<div style='clear:both'></div>
<p style="text-align:center;"><a href="http://www.thycotic.com/zSS_TheNubbyAdmin.html?utm_source=TheNubbyAdmin&utm_medium=banner&utm_content=rss&utm_campaign=SSTheNubbyAdmin"><img src="http://thenubbyadmin.com/wp-content/wpads/SS468by60.jpg"></a></p><img src="http://feeds.feedburner.com/~r/TheNubbyAdmin/~4/1dMDjIFzb20" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://thenubbyadmin.com/2012/04/25/the-making-of-a-meta-server-or-why-i-bought-a-mac-mini-as-a-nms/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://thenubbyadmin.com/2012/04/25/the-making-of-a-meta-server-or-why-i-bought-a-mac-mini-as-a-nms/</feedburner:origLink></item>
	</channel>
</rss>

