<?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>Jason Antman's Blog</title> <link>http://blog.jasonantman.com</link> <description>Information, thoughts, tips and tricks from a professional system administrator / monitoring and automation nut, open source junkie, troubleshooter, sometime software developer and ceaseless tinkerer. And some occasional commentary on my hobbies and non-tech interests.</description> <lastBuildDate>Tue, 14 May 2013 12:00:25 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/JasonAntman" /><feedburner:info uri="jasonantman" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>JasonAntman</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><title>Git Cheat Sheet</title><link>http://feedproxy.google.com/~r/JasonAntman/~3/h3KNkcomSzE/</link> <comments>http://blog.jasonantman.com/2013/05/git-cheat-sheet/#comments</comments> <pubDate>Tue, 14 May 2013 10:00:03 +0000</pubDate> <dc:creator>Jason Antman</dc:creator> <category><![CDATA[Tech HowTos]]></category> <category><![CDATA[git]]></category><guid isPermaLink="false">http://blog.jasonantman.com/?p=1379</guid> <description><![CDATA[A quick cheat sheet of some of the git commands that I usually forget. <a href="http://blog.jasonantman.com/2013/05/git-cheat-sheet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I use <a href="http://git-scm.com/">git</a> quite a bit these days, both with an internal server at work and with a bunch of my projects and random code that now live on <a href="https://github.com/jantman/">my github account</a>. The transition from SVN hasn&#8217;t always been easy. Here&#8217;s a quick cheat sheet of some of the things that I usually forget.</p><ul><li>Show diff of the last commit:<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git diff</span> HEAD^..HEAD</pre></td></tr></table></div></li><li>Roll back to version xyz of a specific file <em>(where xyz is a SHA1 commit ref)</em>:<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git checkout</span> xyz path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">file</span></pre></td></tr></table></div></li><li>Undo any <em>unstaged</em> changes to your branch:<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git checkout</span> <span style="color: #660033;">-f</span></pre></td></tr></table></div></li><li>Undo any staged and working directory changes:<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git reset</span> <span style="color: #660033;">--hard</span></pre></td></tr></table></div></li><li>Update submodules after cloning a repository:<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git submodule</span> update <span style="color: #660033;">--init</span></pre></td></tr></table></div><li>Rebase on current master to pull in new changes:<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git rebase</span> master</pre></td></tr></table></div></li><li>Rebase on current master, but for files that changed, take our version <em>(for some reason, a plain rebase seems to sometimes show conflicts on files that haven&#8217;t changed in ages on master)</em>:<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git rebase</span> <span style="color: #660033;">-s</span> recursive <span style="color: #660033;">-Xtheirs</span> master</pre></td></tr></table></div></li><li>Delete a local branch:<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git branch</span> <span style="color: #660033;">-d</span> BranchName</pre></td></tr></table></div></li><li>Delete a remote branch from origin:<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git push</span> origin <span style="color: #660033;">--delete</span> BranchName</pre></td></tr></table></div></li></ul> <img src="http://feeds.feedburner.com/~r/JasonAntman/~4/h3KNkcomSzE" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.jasonantman.com/2013/05/git-cheat-sheet/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.jasonantman.com/2013/05/git-cheat-sheet/</feedburner:origLink></item> <item><title>Search for a small-scale but automated RPM build system</title><link>http://feedproxy.google.com/~r/JasonAntman/~3/lLRXWaA6_B0/</link> <comments>http://blog.jasonantman.com/2013/05/search-for-a-small-scale-but-automated-rpm-build-system/#comments</comments> <pubDate>Mon, 13 May 2013 10:00:03 +0000</pubDate> <dc:creator>Jason Antman</dc:creator> <category><![CDATA[Tech HowTos]]></category> <category><![CDATA[build]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[nodejs]]></category> <category><![CDATA[package]]></category> <category><![CDATA[packaging]]></category> <category><![CDATA[repository]]></category> <category><![CDATA[rpm]]></category> <category><![CDATA[rpmbuild]]></category> <category><![CDATA[software]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[yum]]></category><guid isPermaLink="false">http://blog.jasonantman.com/?p=1367</guid> <description><![CDATA[What I'm looking for in a small-scale automated RPM build system, and an overview of the current landscape of RPM build systems. <a href="http://blog.jasonantman.com/2013/05/search-for-a-small-scale-but-automated-rpm-build-system/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><strong><em>This post is part of a series of older draft posts from a few months ago that I&#8217;m just getting around to publishing. Unfortunately, I have yet to find a build system that meets my requirements (see the last paragraph).</em></strong></p><p>At work, we have a handful &#8211; currently a really small number &#8211; of RPM packages that we need to build and deploy internally for our CentOS server infrastructure. A number of them are just pulled down from specific third-party repositories and rebuilt to have the vendor set as us, and some are internally patched or developed software. We run websites, and on the product side, we&#8217;re a Python/<a href="https://www.djangoproject.com/">Django</a> shop (in fact, probably one of the largest Django apps out there). We don&#8217;t deploy our Django apps via RPM, so building and distributing RPMs is definitely not one of our core competencies. In fact, we really only want to do it when we&#8217;re testing/deploying a new distro, or when an upstream package is updated.</p><p>Last week I pulled a ticket to deploy <a href="http://nodejs.org/">node.js</a> to one of our build hosts, and we&#8217;ve got a few things in the pipeline that also rely on it. I found the <a href="https://github.com/puppetlabs/puppetlabs-nodejs">puppetlabs-nodejs</a> module on Github that&#8217;s supposed to install it on RHEL/CentOS, but it pulls packages from <a href="http://patches.fedorapeople.org/oldnode/stable/">http://patches.fedorapeople.org/oldnode/stable/</a>, and the newest version of nodejs there is 0.6.18, which is quite old. I can&#8217;t find any actively maintained sources of newer nodejs packages for RHEL/CentOS (yeah, I know, that&#8217;s one down side to the distributions&#8230;). However, I did find that nodejs 0.9.5 is being <a href="http://koji.fedoraproject.org/koji/packageinfo?packageID=15154">built for Fedora 18/19 in the Fedora build system</a>, is already in the Fedora 18 Testing and Fedora Rawhide repos, but is failing its EL6 builds in their system. The decision I&#8217;ve come to is to use the puppetlabs-nodejs module to install it, but try and rebuild the Fedora 18 RPMs under CentOS 5 and 6.</p><p>So that&#8217;s the background. Now, my current task: to search for an RPM build system for my current job. My core requirements, in no specific order, are:</p><ul><li>Be relatively easy and quick to use for people who have a specfile or SRPM and want to be able to &#8220;ensure =&gt; present&#8221; the finished RPM on a system. i.e., require as little per-package configuration as possible.</li><li>Be able to handle rebuilding &#8220;all&#8221; of our RPMs when we roll out a new distro version. Doesn&#8217;t necessarily need to be automatic, but should be relatively simple.</li><li>Ideally, not need to be running constantly &#8211; i.e. something that will cope well with build hosts being VMs that are shut down when they&#8217;re not needed.</li><li>Handle automatically putting successfully built packages into a repository, ideally with some sort of (manual) promotion process from staging to stable.</li><li>Have minimal external (infrastructure) dependencies that we can&#8217;t satisfy with existing systems.</li></ul><p> So, the first step was to research existing RPM build systems and how others do this. Here&#8217;s a list of what I could find online, though most of these are from distributions and software vendors/projects, not end-user companies that are only building for internal use.</p><ul><li><a href="https://fedorahosted.org/koji/wiki">Koji</a> is the build system used by <a href="http://fedoraproject.org/wiki/Koji">Fedora</a> and RedHat. It&#8217;s about as full-featured as any can be, and I&#8217;m familiar with it from my time at <a href="http://koji.rutgers.edu/koji/">Rutgers University</a>, as it&#8217;s used to maintain their CentOS/RHEL packages. It&#8217;s based largely on Mock. However, <a href="http://fedoraproject.org/wiki/Koji/ServerHowTo">setting up the build server</a> is no trivial task; there are few installations outside of Fedora/RedHat, and it relies on either Kerberos or an SSL CA infrastructure to authenticate machines and clients. So, it&#8217;s designed for too large a scale and too much infrastructure for me.</li><li>PLD Linux has a <a href="https://www.pld-linux.org/developingpld/builderscript">builder script</a> that seems to automate <tt>rpmbuild</tt> as well as fetching sources and resolving/building dependencies. I haven&#8217;t looked at the script yet, but apparently it&#8217;s in PLD&#8217;s &#8220;rpm-build-tools&#8221; package.</li><li>PLD Linux also has a CVS repository for something called <a href="http://cvs.pld-linux.org/cgi-bin/cvsweb/pld-builder.new">pld-builder.new</a>. The <a href="http://cvs.pld-linux.org/cgi-bin/cvsweb/pld-builder.new/doc/README?rev=1.5">README</a> and <a href="http://cvs.pld-linux.org/cgi-bin/cvsweb/pld-builder.new/doc/ARCHITECTURE?rev=1.6">ARCHITECTURE</a> files make it sound like a relatively simple mainly-Python system that builds SRPMS and binary packages when requested, and most importantly, seems like a simple system that uses little more than shared filesystem access for communication and coordination.</li><li>ALT Linux has <a href="http://en.altlinux.org/Sisyphus">Sisyphus</a>, which combines repository management and web interface tools, package building and testing tools, and more.</li><li>The Dries RPM repository uses (or at least used&#8230; my reference is quite old) <a href="http://dries.ulyssis.org/rpm/pydar2/index.html">pydar2</a>, &#8220;a distributed client/server program which allows you to build multiple spec files on multiple distribution/architecture combinations automatically.&#8221; That sounds like it could be what I need, but the last update says that it isn&#8217;t finished yet, and that was in <strong>2005</strong>.</li><li>Mandriva Linux has pretty extensive information on their build system <a href="http://wiki.mandriva.com/en/Category:Build_System">on their wiki</a> and a <a href="http://wiki.mandriva.com/en/Development/Packaging/BuildSystem/Theory">build system theory page</a>, but it seems to be largely a hodgepodge of shell scripts and cronjobs, and is likely not a candidate for use by anyone other than its designers.</li><li>Argeo provides the <a href="https://www.argeo.org/wiki/SLC">SLC framework</a> which has a &#8220;RPM Factory&#8221; component, but I can&#8217;t seem to find much more than a wiki page, and can&#8217;t tell if it&#8217;s a build automation system or just handles mocking packages and putting them in a repo on a single host.</li><li>Dag Wieers&#8217; repositories use (or used) a set of python scripts called <a href="http://dag.wieers.com/home-made/dar/">DAR, &#8220;Dynamic Apt Repository builder&#8221;</a>. They&#8217;re on <a href="https://github.com/dagwieers/dar">github</a> but are listed as &#8220;old&#8221; and haven&#8217;t been updated in at least 2 years. The features sound quite interesting, and though it&#8217;s based on the Apt repo format, it might provide some good ideas for implementing a similar system.</li></ul><p><strong>Update four months later:</strong> I&#8217;ve yet to find a build system that meets my requirements above. For the moment I&#8217;m only managing ~20 packages, so my &#8220;build system&#8221; is a single shell script that reads in some environment variables and runs through using <a href="http://fedoraproject.org/wiki/Projects/Mock">mock</a> to build them in the correct order (including pushing the finished RPMs back into the local repository that mock reads from) and then pushing the finished packages to our internal repository. Maybe when I have some spare time, I&#8217;ll consider a project to either make a slightly better (but simple) RPM build system based on Python, or get our <a href="http://jenkins-ci.org/">Jenkins</a> install to handle this for me.</p> <img src="http://feeds.feedburner.com/~r/JasonAntman/~4/lLRXWaA6_B0" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.jasonantman.com/2013/05/search-for-a-small-scale-but-automated-rpm-build-system/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.jasonantman.com/2013/05/search-for-a-small-scale-but-automated-rpm-build-system/</feedburner:origLink></item> <item><title>Environment Variable Substitution in Apache httpd Configs</title><link>http://feedproxy.google.com/~r/JasonAntman/~3/ASxXzOqRSo8/</link> <comments>http://blog.jasonantman.com/2013/05/environment-variable-substitution-in-apache-httpd-configs/#comments</comments> <pubDate>Sat, 11 May 2013 17:01:59 +0000</pubDate> <dc:creator>Jason Antman</dc:creator> <category><![CDATA[SysAdmin]]></category> <category><![CDATA[Tech HowTos]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[environment]]></category> <category><![CDATA[httpd]]></category> <category><![CDATA[variable]]></category><guid isPermaLink="false">http://blog.jasonantman.com/?p=1423</guid> <description><![CDATA[Using environment variable substitution in Apache httpd 2.2 and 2.4 configurations to allow configs to be tested and promoted between environments the same way code and other configuration management is. <a href="http://blog.jasonantman.com/2013/05/environment-variable-substitution-in-apache-httpd-configs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been configuring Apache httpd for over a decade, from a single personal web server to web farms running thousands of vhosts. In most of the &#8220;real&#8221; environments I&#8217;ve worked in, we&#8217;ve had some variation of production, stage/test/QA and development hosts; and usually some method of managing configurations between them, whether it&#8217;s source control or generating them from template. And in all of these environments, there has invariably been drift between the configurations in the various environments, whether it&#8217;s because of poor tools to maintain a unified configuration or many of those emergency redirect requests that make it into production but are never backported. This is made all the worse because everywhere I&#8217;ve worked, the real difference between what production and other environments <em>should</em> be is really just a string replacement in Apache configurations &#8211; <tt>/prod/</tt> to <tt>/test/</tt> or <tt>www.example.com</tt> to <tt>www.dev.example.com</tt> or something along those lines.</p><p>Well a few days ago I was having a discussion with some co-workers that dovetailed into this topic, and when I started some research, I found (<em>finally after using httpd for years</em>) that the <a href="http://httpd.apache.org/docs/2.2/configuring.html#syntax">Apache httpd 2.2 configuration file syntax documentation</a> states that httpd supports environment variable interpolation anywhere in the config files (and <a href="http://httpd.apache.org/docs/2.4/configuring.html#syntax">httpd 2.4</a> supports it with Defines as well).</p><p>Yup, that&#8217;s right. All those different Apache configs I&#8217;ve worked with for years that define separate vhosts, document roots, rewrite targets, ServerAliases, etc. for <tt>www.example.com</tt> and <tt>www.qa.example.com</tt> and <tt>www.dev.example.com</tt> really only had to be <tt>www.${ENV_URL_PART}example.com</tt>, and set <tt>ENV_URL_PART</tt> in the init script or sysconfig file. (Of course this all assumes that you have your different environments served by different httpd instances, which you do, of course&#8230;)</p><p>For me, this is a very big deal. It means that finally, instead of maintaining separate sets of configs for different environments which are (theoretically, except for those emergencies) kept identical by hand, or updating templates and then re-generating each environment&#8217;s configs, we can finally follow the same commit/merge/promotion-between-environments workflow that we use for other production code and Puppet configuration. It also means that those pesky little rewrites and other minor tweaks will make it all the way back to development environments.</p><p>So, here&#8217;s a little example of how this would work in reality. Let&#8217;s assume that we have 3 main environments, <tt>prod</tt>, <tt>qa</tt> and <tt>dev</tt> (though this should work for N environments) and that domains are prefixed with &#8220;qa.&#8221; or &#8220;dev.&#8221; for the respective internal environments. We set environment variables before httpd is started, on a per-host basis, depending on what environment that host is in. On RedHat based systems, we&#8217;d add the variables to <tt>/etc/sysconfig/httpd</tt> for production:</p><div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">HTTPD_ENV_NAME</span>=<span style="color: #ff0000;">&quot;prod&quot;</span>
<span style="color: #007800;">HTTPD_ENV_URL_PART</span>=<span style="color: #ff0000;">&quot;&quot;</span></pre></td></tr></table></div><p>or for QA:</p><div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">HTTPD_ENV_NAME</span>=<span style="color: #ff0000;">&quot;qa&quot;</span>
<span style="color: #007800;">HTTPD_ENV_URL_PART</span>=<span style="color: #ff0000;">&quot;qa.&quot;</span></pre></td></tr></table></div><p>Those variables will now be available to httpd within the configurations (and also to any applications or scripts that have access to the web server&#8217;s environment variables).</p><p>Now let&#8217;s look at an example vhost configuration file that uses the environment variables:</p><div class="wp_syntax"><table><tr><td class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">80</span>&gt;
<span style="color: #00007f;">ServerName</span> example.com
<span style="color: #00007f;">ServerAlias</span> www.example.com
<span style="color: #adadad; font-style: italic;"># Aliases including proper environment name</span>
<span style="color: #00007f;">ServerAlias</span> www.${HTTPD_ENV_NAME}.example.com ${HTTPD_ENV_NAME}.example.com
&nbsp;
<span style="color: #00007f;">ErrorLog</span> /var/log/httpd/example.com-error_log
<span style="color: #00007f;">CustomLog</span> /var/log/httpd/example.com-access_log combined
&nbsp;
<span style="color: #00007f;">DocumentRoot</span> /sites/example.com/${HTTPD_ENV_NAME}/
&nbsp;
<span style="color: #adadad; font-style: italic;"># Environment-specific configuration, if we absolutely need it:</span>
<span style="color: #00007f;">Include</span> /etc/httpd/sites/${HTTPD_ENV_NAME}/env.conf
&nbsp;
&lt;<span style="color: #000000; font-weight:bold;">Location</span> <span style="color: #7f007f;">&quot;/testrewrite&quot;</span>&gt;
<span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">on</span>
<span style="color: #00007f;">RewriteRule</span> /foobar/.* http://www.${HTTPD_ENV_URL_PART}example.com/baz/ [R=<span style="color: #ff0000;">302</span>,L]
&lt;/<span style="color: #000000; font-weight:bold;">Location</span>&gt;
&nbsp;
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;</pre></td></tr></table></div><p>Every instance of <tt>${HTTPD_ENV_NAME}</tt> will be replaced with the value set in the sysconfig file, and likewise with every instance of <tt>${HTTPD_ENV_URL_PART}</tt>. This way, we can have one set of configurations and use our normal source control branch/promotion process to both test and promote changes through the environments along with application code, and ensure that any straight-to-production emergency changes (everyone has customer-ordered rewrites like that, right?) make it back to development and qa.</p><p>One caveat is that, if the environment variable is not defined, the <tt>${VAR_NAME}</tt> will be left as a literal string in the configuration file. There doesn&#8217;t seem to be any way to protect against this in httpd 2.2, other than making sure the variables are set before the server starts (and maybe setting logical default values, like an empty string, in your init script which should be overridden by the sysconfig file).</p><p>If you&#8217;re running httpd 2.4+, you can turn on <a href="http://httpd.apache.org/docs/2.4/mod/mod_info.html">mod_info</a> and browse to <tt>http://servername/server-info?config</tt> to dump the current configuration, which will show the variable substitution.</p> <img src="http://feeds.feedburner.com/~r/JasonAntman/~4/ASxXzOqRSo8" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.jasonantman.com/2013/05/environment-variable-substitution-in-apache-httpd-configs/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.jasonantman.com/2013/05/environment-variable-substitution-in-apache-httpd-configs/</feedburner:origLink></item> <item><title>RPM Spec Files for nodejs 0.9.5 and v8 on CentOS 5</title><link>http://feedproxy.google.com/~r/JasonAntman/~3/ZuNMCEs3LtQ/</link> <comments>http://blog.jasonantman.com/2013/01/rpm-spec-files-for-nodejs-0-9-5-and-v8-on-centos-6/#comments</comments> <pubDate>Thu, 31 Jan 2013 19:13:12 +0000</pubDate> <dc:creator>Jason Antman</dc:creator> <category><![CDATA[Tech HowTos]]></category> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[build]]></category> <category><![CDATA[centos]]></category> <category><![CDATA[node]]></category> <category><![CDATA[nodejs]]></category> <category><![CDATA[package]]></category> <category><![CDATA[packaging]]></category> <category><![CDATA[redhat]]></category> <category><![CDATA[RHEL]]></category> <category><![CDATA[rpm]]></category> <category><![CDATA[specfile]]></category><guid isPermaLink="false">http://blog.jasonantman.com/?p=1382</guid> <description><![CDATA[Specfiles to build nodejs 0.9.5 on CentOS 6. <a href="http://blog.jasonantman.com/2013/01/rpm-spec-files-for-nodejs-0-9-5-and-v8-on-centos-6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>The latest version of nodejs that I could find as an RPM for CentOS was 0.6.16, from <a href="http://patches.fedorapeople.org/oldnode/stable/">http://patches.fedorapeople.org/oldnode/stable/</a>. That&#8217;s the one that puppetlabs currently uses in their <a href="https://github.com/puppetlabs/puppetlabs-nodejs">puppetlabs-nodejs</a> module. There is, however, a nodejs 0.9.5 RPM in the Fedora Rawhide (19) repository. Below are some patches to that specfile, and the specfile for its v8 dependency, to get them to build on CentOS 6. You can also find the full specfiles on my <a href="https://github.com/jantman/specfiles">github specfile repository</a>. I had originally wanted to get them built on CentOS 5 as well, but after following the dependency tree from nodejs to http-parser to gyp, and then finding issues in the gyp source that are incompatible with CentOS 5&#8242;s python 2.4, I gave up on that target.</p><p><strong>nodejs.spec</strong>, diff from Fedora Rawhide nodejs-0.9.5-9.fc18.src.rpm, buildID=377755 (<a href="https://raw.github.com/jantman/specfiles/master/nodejs.spec">full specfile</a>)</p><div class="wp_syntax"><table><tr><td class="code"><pre class="diff" style="font-family:monospace;">diff --git a/nodejs.spec b/nodejs.spec
index 050ed86..<span style="color: #440088;">86c0</span>f4b <span style="">100644</span>
<span style="color: #888822;">--- a/nodejs.spec</span>
<span style="color: #888822;">+++ b/nodejs.spec</span>
<span style="color: #440088;">@@ -1,6 +1,6 @@</span>
 Name: nodejs
 Version: 0.9.5
<span style="color: #991111;">-Release: 9%<span style="">&#123;</span>?dist<span style="">&#125;</span></span>
<span style="color: #00b000;">+Release: 10%<span style="">&#123;</span>?dist<span style="">&#125;</span></span>
 Summary: JavaScript runtime
 License: MIT and ASL <span style="">2.0</span> and ISC and BSD
 Group: Development/Languages
<span style="color: #440088;">@@ -25,7 +25,7 @@ Source6: nodejs-fixdep</span>
 BuildRequires: v8-devel &gt;= %<span style="">&#123;</span>v8_ge<span style="">&#125;</span>
 BuildRequires: http-parser-devel &gt;= <span style="">2.0</span>
 BuildRequires: libuv-devel
<span style="color: #991111;">-BuildRequires: c-ares-devel</span>
<span style="color: #00b000;">+BuildRequires: c-ares-devel &gt;= 1.9.0</span>
 BuildRequires: zlib-devel
 # Node.js requires some features from openssl 1.0.1 for SPDY support
 BuildRequires: openssl-devel &gt;= <span style="">1</span>:1.0.1
<span style="color: #440088;">@@ -165,9 +165,13 @@ cp -p common.gypi %<span style="">&#123;</span>buildroot<span style="">&#125;</span>%<span style="">&#123;</span>_datadir<span style="">&#125;</span>/node</span>
&nbsp;
 %files docs
 %<span style="">&#123;</span>_defaultdocdir<span style="">&#125;</span>/%<span style="">&#123;</span>name<span style="">&#125;</span>-docs-%<span style="">&#123;</span>version<span style="">&#125;</span>
<span style="color: #991111;">-%doc LICENSE</span>
&nbsp;
 %changelog
<span style="color: #00b000;">+* Thu Jan 31 2013 Jason Antman &lt;Jason.Antman@cmgdigital.com&gt; - 0.9.5-10</span>
<span style="color: #00b000;">+- specify build requirement of c-ares-devel &gt;= 1.9.0</span>
<span style="color: #00b000;">+- specify build requirement of libuv-devel 0.9.4</span>
<span style="color: #00b000;">+- remove duplicate %doc LICENSE that was causing cpio 'Bad magic' error on CentOS6</span>
<span style="color: #00b000;">+</span>
 * Sat Jan <span style="">12</span> <span style="">2013</span> T.C. Hollingsworth &lt;tchollingsworth@gmail.com&gt; - 0.9.5-<span style="">9</span>
 - fix brown paper bag bug in requires generation script</pre></td></tr></table></div><p><strong>v8.spec</strong>, diff from Fedora Rawhide 3.13.7.5-2 (<a href="https://raw.github.com/jantman/specfiles/master/v8.spec">full specfile</a>)</p><div class="wp_syntax"><table><tr><td class="code"><pre class="diff" style="font-family:monospace;"><span style="color: #888822;">--- v8.spec.orig       2013-01-26 16:03:18.000000000 -0500</span>
<span style="color: #888822;">+++ v8.spec     2013-01-31 09:04:51.068029459 -0500</span>
<span style="color: #440088;">@@ -21,9 +21,11 @@</span>
&nbsp;
 # %%global svnver 20110721svn8716
&nbsp;
<span style="color: #00b000;">+%<span style="">&#123;</span>!?python_sitelib: %define python_sitelib %<span style="">&#40;</span>%<span style="">&#123;</span>__python<span style="">&#125;</span> -c &quot;import distutils.sysconfig as d; print d.get_python_lib<span style="">&#40;</span><span style="">&#41;</span>&quot;<span style="">&#41;</span><span style="">&#125;</span></span>
<span style="color: #00b000;">+</span>
 Name:          v8
 Version:       %<span style="">&#123;</span>somajor<span style="">&#125;</span>.%<span style="">&#123;</span>sominor<span style="">&#125;</span>.%<span style="">&#123;</span>sobuild<span style="">&#125;</span>.%<span style="">&#123;</span>sotiny<span style="">&#125;</span>
<span style="color: #991111;">-Release:       2%<span style="">&#123;</span>?dist<span style="">&#125;</span></span>
<span style="color: #00b000;">+Release:       5%<span style="">&#123;</span>?dist<span style="">&#125;</span></span>
 Epoch:         <span style="">1</span>
 Summary:       JavaScript Engine
 Group:         System Environment/Libraries
<span style="color: #440088;">@@ -32,7 +34,7 @@</span>
 Source0:       http://commondatastorage.googleapis.com/chromium-browser-official/v8-%<span style="">&#123;</span>version<span style="">&#125;</span>.tar.bz2
 BuildRoot:     %<span style="">&#123;</span>_tmppath<span style="">&#125;</span>/%<span style="">&#123;</span>name<span style="">&#125;</span>-%<span style="">&#123;</span>version<span style="">&#125;</span>-%<span style="">&#123;</span>release<span style="">&#125;</span>-root-%<span style="">&#40;</span>%<span style="">&#123;</span>__id_u<span style="">&#125;</span> -n<span style="">&#41;</span>
 ExclusiveArch: %<span style="">&#123;</span>ix86<span style="">&#125;</span> x86_64 %<span style="">&#123;</span>arm<span style="">&#125;</span>
<span style="color: #991111;">-BuildRequires: scons, readline-devel, libicu-devel</span>
<span style="color: #00b000;">+BuildRequires: scons, readline-devel, libicu-devel, ncurses-devel</span>
&nbsp;
 %description
 V8 is Google's open source JavaScript engine. V8 is written in C++ and is used 
<span style="color: #440088;">@@ -51,8 +53,13 @@</span>
 %setup -q -n %<span style="">&#123;</span>name<span style="">&#125;</span>-%<span style="">&#123;</span>version<span style="">&#125;</span>
&nbsp;
 # -fno-strict-aliasing is needed with gcc <span style="">4.4</span> to get past some ugly code
<span style="color: #991111;">-PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing -Wno-unused-parameter -Wno-error=strict-overflow -Wno-error=unused-local-typedefs -Wno-unused-but-set-variable\'| sed &quot;s/ /',/g&quot; | sed &quot;s/',/', '/g&quot;`</span>
<span style="color: #00b000;">+%if 0%<span style="">&#123;</span>?el5<span style="">&#125;</span></span>
<span style="color: #00b000;">+PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing -Wno-unused-parameter -lncurses\'| sed &quot;s/ /',/g&quot; | sed &quot;s/',/', '/g&quot;`</span>
<span style="color: #00b000;">+sed -i &quot;s|'-O3',|$PARSED_OPT_FLAGS,|g&quot; SConstruct</span>
<span style="color: #00b000;">+%else</span>
<span style="color: #00b000;">+PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing -Wno-unused-parameter -Wno-error=strict-overflow -Wno-unused-but-set-variable\'| sed &quot;s/ /',/g&quot; | sed &quot;s/',/', '/g&quot;`</span>
 sed -i &quot;s|'-O3',|$PARSED_OPT_FLAGS,|g&quot; SConstruct
<span style="color: #00b000;">+%endif</span>
&nbsp;
 # clear spurious executable bits
 find . \<span style="">&#40;</span> -name \*.cc -o -name \*.h -o -name \*.py \<span style="">&#41;</span> -a -executable \
<span style="color: #440088;">@@ -198,6 +205,17 @@</span>
 %<span style="">&#123;</span>python_sitelib<span style="">&#125;</span>/j*.py*
&nbsp;
 %changelog
<span style="color: #00b000;">+* Thu Jan 31 2013 Jason Antman &lt;Jason.Antman@cmgdigital.com&gt; - 1:3.13.7.5-5</span>
<span style="color: #00b000;">+- remove -Werror=unused-local-typedefs on cent6</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+* Wed Jan 30 2013 Jason Antman &lt;Jason.Antman@cmgdigital.com&gt; - 1:3.13.7.5-4</span>
<span style="color: #00b000;">+- define python_sitelib if it isn't already <span style="">&#40;</span>CentOS 5<span style="">&#41;</span></span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+* Wed Jan 30 2013 Jason Antman &lt;Jason.Antman@cmgdigital.com&gt; - 1:3.13.7.5-3</span>
<span style="color: #00b000;">+- pull 3.13.7.5-2 SRPM from Fedora 19 Koji most recent build</span>
<span style="color: #00b000;">+- add ncurses-devel BuildRequires</span>
<span style="color: #00b000;">+- modify PARSED_OPT_FLAGS to work with g++ 4.1.2 on CentOS 5</span>
<span style="color: #00b000;">+ </span>
 * Sat Jan <span style="">26</span> <span style="">2013</span> T.C. Hollingsworth &lt;tchollingsworth@gmail.com&gt; - <span style="">1</span>:3.13.7.5-<span style="">2</span>
 - rebuild for icu-<span style="">50</span>
 - ignore new GCC <span style="">4.8</span> warning</pre></td></tr></table></div><img src="http://feeds.feedburner.com/~r/JasonAntman/~4/ZuNMCEs3LtQ" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.jasonantman.com/2013/01/rpm-spec-files-for-nodejs-0-9-5-and-v8-on-centos-6/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.jasonantman.com/2013/01/rpm-spec-files-for-nodejs-0-9-5-and-v8-on-centos-6/</feedburner:origLink></item> <item><title>Fedora Linux and OSX Dual Boot on Mid-2010 (6,2) 15″ MacBook Pro Laptop</title><link>http://feedproxy.google.com/~r/JasonAntman/~3/bvUrcQUyWhY/</link> <comments>http://blog.jasonantman.com/2013/01/fedora-linux-and-osx-dual-boot-on-mid-2010-62-15-macbook-pro-laptop/#comments</comments> <pubDate>Mon, 21 Jan 2013 17:13:05 +0000</pubDate> <dc:creator>Jason Antman</dc:creator> <category><![CDATA[Tech HowTos]]></category> <category><![CDATA[bootloader]]></category> <category><![CDATA[efi]]></category> <category><![CDATA[fedora]]></category> <category><![CDATA[gpt]]></category> <category><![CDATA[grub]]></category> <category><![CDATA[installation]]></category> <category><![CDATA[laptop]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[macbook]]></category> <category><![CDATA[os x]]></category><guid isPermaLink="false">http://blog.jasonantman.com/?p=1362</guid> <description><![CDATA[The detailed steps that I used to install Fedora Linux and Mac OS X dual-boot on a Mid-2010 MacBook Pro 6,2 laptop, using pure EFI booting and GPT. <a href="http://blog.jasonantman.com/2013/01/fedora-linux-and-osx-dual-boot-on-mid-2010-62-15-macbook-pro-laptop/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>As part of the transition from a contractor to a full-time employee of <a href="http://www.cmgdigital.com">Cox Media Group Digital &#038; Strategy</a> (check out our <a href="https://github.com/cmgdigital">github</a>), I&#8217;ve been issued a <a href="http://support.apple.com/kb/SP582">Mid-2010 (6,2)</a> 15&#8243; <a href="http://en.wikipedia.org/wiki/Macbook_pro#Technical_specifications_2">MacBook Pro</a> laptop, to replace my current <a href="http://support.apple.com/kb/SP11">Early-2008 (3,1)</a> MacPro desktop. The desktop is currently running <a href="http://fedoraproject.org/">Fedora</a> 17, dual-boot with with Mac OS X (left in place for firmware updates and emergencies) using the <a href="http://www.rodsbooks.com/refind/index.html">rEFInd boot manager</a> to choose between the two OSes. It took me two days to get this working right on my desktop, but it had been my plan to duplicate this setup on my laptop. I found a lot of conflicting information online, but I decided to give it a try.</p><p>Well, I have Fedora 18 and OS X 10.8 dual-booting on the laptop, but not as planned. After a day and a half of research, troubleshooting and re-installs, here&#8217;s what I found to actually work, in the hope that nobody else will go through the ordeal I went through. Following that are some notes about the new Fedora 18 installer (Anaconda 18), especially important for anyone who&#8217;s used Linux for a while. To those who are new to Linux, don&#8217;t be dissuaded by the above. Most of the frustration I experienced is because I&#8217;ve been using Linux for a relatively long time (about 10 years), had my own ideas about exactly how I wanted things setup (which are decidedly <em>not</em> supported by Fedora), and had some assumptions about the installation process based on earlier versions.</p><p><strong>How to get it working:</strong></p><p>Forget about rEFInd. This had been the original advice from <a href="http://mjg59.dreamwidth.org/">Matthew Garrett</a>, <a href="https://twitter.com/mjg59">@mjg59</a>, kernel coder, contributor to the Anaconda project, and all-around authority on booting Linux on EFI/UEFI hardware. My advice, and the method that worked for me:</p><ol><li>Shrink your Mac partitions and leave as much free space as you want for Fedora. using the Disk Utility tool in OS X (I also created an 8GB VFAT partition that both OSes can read/write to).</li><li><a href="http://fedoraproject.org/en/get-fedora">Download Fedora 18</a> 64-bit DVD image, I chose the KDE version. Verify the sha256 sum if you want (they don&#8217;t have a readily visible link to the checksum file. Copy the download link, paste it into your address bar and remove the filename. You should get a directory index that includes a <tt>-CHECKSUM</tt> file.</li><li>Per the Installation Guide&#8217;s <a href="http://docs.fedoraproject.org/en-US/Fedora/18/html/Installation_Guide/Making_USB_Media-UNIX_Linux.html">Making Fedora USB Media page</a>, use <tt>liveusb-creator</tt> to setup the installation image on the USB flash drive (I needed to start it with the <tt>--reset-mbr</tt> option). You can also use other tools (dd if you&#8217;re not on a Fedora-based distro), or a DVD, but this is the method I chose.</li><li>Due to a <a href="https://fedorahosted.org/liveusb-creator/ticket/810">bug in liveusb-creator</a>, you may need to manually edit <tt>/EFI/boot/grub.cfg</tt> on the created USB stick if grub gives you a file not found error. If that happens, please see my bug report above for the action to take (in short, you need to mount the USB stick, <tt>chmod u+w /EFI/boot/grub.cfg</tt> then edit that file and replace every occurrence of &#8220;isolinux&#8221; with &#8220;syslinux&#8221; and every occurrence of &#8220;root=live:LABEL=Fedora-18-x86_64-Live-KDE.iso&#8221; with &#8220;root=live:LABEL=LIVE&#8221;).</li><li>Boot the USB drive (use the alt key when you turn on the laptop to select the USB drive) and just install Fedora normally, letting it do its thing. Select a boot disk and let it put GRUB2 on the EFI partition.</li></ol><p>When you boot, it will boot to GRUB. There will be some options for Mac OS there, but they don&#8217;t work (more on that below). If you want to boot Mac, hold down the alt/option key when you power on the laptop, which will bring you to the boot disk selector and you can pick the Mac disk. I know it&#8217;s not pretty or ideal, but it&#8217;s the best option right now.</p><p><strong>Making it Better:</strong></p><p>GRUB2 tries to automatically detect other OSes and configure them in the boot loader (this is done through <tt>/etc/grub.d/30_os-prober</tt>, commonly just referred to as <tt>os-prober</tt>). It tries to boot Mac directly through the xnu_kernel64 module, which not only isn&#8217;t installed on the boot partition by default, but just doesn&#8217;t work with at least Mountain Lion (10.8). So getting GRUB to boot Mac means either having the bugs in the xnu module fixed, or figuring out how to setup a chainloader to boot from GRUB to Mac. The latter is probably the method I&#8217;ll investigate, but for now, since I rarely use Mac, I&#8217;m happy having to use the alt key at boot to get there. To remove the annoying, broken Mac OS options from the grub screen, run the following commands as root (they assume you have your EFI partition mounted at <tt>/boot/efi</tt> which I believe Fedora should do by default:</p><div class="wp_syntax"><table><tr><td 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>boot<span style="color: #000000; font-weight: bold;">/</span>efi<span style="color: #000000; font-weight: bold;">/</span>EFI<span style="color: #000000; font-weight: bold;">/</span>fedora<span style="color: #000000; font-weight: bold;">/</span>grub.cfg <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>efi<span style="color: #000000; font-weight: bold;">/</span>EFI<span style="color: #000000; font-weight: bold;">/</span>fedora<span style="color: #000000; font-weight: bold;">/</span>grub.cfg.bak
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'GRUB_DISABLE_OS_PROBER=&quot;true&quot;'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>grub
grub2-mkconfig <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>efi<span style="color: #000000; font-weight: bold;">/</span>EFI<span style="color: #000000; font-weight: bold;">/</span>fedora<span style="color: #000000; font-weight: bold;">/</span>grub.cfg</pre></td></tr></table></div><p><strong>Thoughts on the Fedora 18 Anaconda Installer</strong></p><p> I found a couple of issues with the new Anaconda 18 installer that were either unweildy or confusing for someone who&#8217;s been installing Linux for a long time. Overall, the new installer is very nice. It has a clean, even elegant UI, a relatively nice flow from start to completion, and is certainly beginner-friendly. It has fewer options than any Linux installer I&#8217;ve ever used before &#8211; not even options for package selection, firewall or SELinux configuration, etc. &#8211; but I guess this is in line with the goal of making Fedora a desktop OS for the masses. I would have appreciated an &#8220;advanced mode&#8221; installer that was more like Fedora 17 (or even much older versions), but I guess I&#8217;m an edge case, at least in the Fedora community. However, I did find two things especially difficult, both related to the fact that my laptop has two main drives (a 500GB hard drive and a 120GB SSD):</p><p>First, the installer prompted me to select a &#8220;boot disk&#8221;. I guess I should have read the installation guide, but I assumed that nomenclature translated to either &#8220;which disk should the automatic partitiioning put yout <tt>/boot</tt> partition on&#8221; or &#8220;which disk should I set the bootable flag on in the partition table&#8221;. In fact, it means &#8220;which disk should I put GRUB on the EFI partition of&#8221;. I installed, rebooted, and was shocked &#8211; and somewhat distressed &#8211; to boot directly to GRUB2 instead of the rEFInd installation I had setup. The installer didn&#8217;t have any of the previously-customary &#8220;warning: this will overwrite your MBR/EFI boot partition&#8221; notices, so I felt safe letting it continue. It turned out that this was the way I ended up going, and it also turns out that there&#8217;s a bug in Anaconda that makes it fail installation if you tell it not to write a bootloader to disk (though it&#8217;s patched by one line of Python code). But I was deeply distressed that &#8211; contrary to the experience of every, admittedly more complicated, Linux installer I&#8217;d used before &#8211; the Fedora 18 installer overwrote my EFI bootloader (analogous to overwriting the MBR on a BIOS boot machine) without ever warning me or asking for a confirmation.</p><p>Secondly, the partitioning tool is clearly designed for only one destination disk. The overview screen lists configured partitions by label and mount point, but not by physical device, so figuring out which partitions are on which physical disks takes a click on each and every partition to view that information in the detail panel. When you create a new partition, it&#8217;s automatically put in a LVM volume group spanning all disks. Changing the target of the automatically created volume group requires a few clicks, as does changing the physical disks backing any new volume groups. To assign a newly created partition to a specific disk, you have to click on an unlabeled &#8220;tool&#8221; icon under the list of partitions, far away from the information on the partition in question. It&#8217;s a nice interface for someone who clicks the &#8220;partition automatically&#8221; button, or who just knows they want to add &#8220;an extra partition&#8221;, but for anyone who has a specific layout in mind (like having <tt>/</tt>, <tt>/boot</tt> and <tt>/var</tt>, specifically sized, on the SSD and <tt>/home</tt> on the rotating disk) it takes about 4-5 more clicks and dialogs to add a partition than the last Fedora installer did. Mainly, it&#8217;s lacking any sort of Advanced Mode for partitioning that allows the user to quickly and accurately layout a more complex partitioning scheme.</p><p>Below are some screenshots from the Fedora 17 and Fedora 18 Installation Guides, which contrast both the overview of all partitions and the individual partition settings:</p><p>Fedora 18 Overview, from <a href="http://docs.fedoraproject.org/en-US/Fedora/18/html/Installation_Guide/s1-diskpartitioning-x86.html">9.13. Creating a Custom Partition Layout</a>:<br /> <img src="http://www.dedoimedo.com/images/computers_years/2013_1/fedora-18-installer-configure-partitions.jpg" width="680" height="412" /><br /> Fedora 17 Overview, from <a href="http://docs.fedoraproject.org/en-US/Fedora/17/html/Installation_Guide/s1-diskpartitioning-x86.html">9.14.  Creating a Custom Layout or Modifying the Default Layout</a>:<br /> <img src="http://docs.fedoraproject.org/en-US/Fedora/17/html/Installation_Guide/images/diskpartitioning/ddmain.png" width="800" height="510" /><br /> Fedora 18 Partition Creation/Editing, from <a href="http://docs.fedoraproject.org/en-US/Fedora/18/html/Installation_Guide/Create_LVM-x86.html">9.13.3.  Create LVM Logical Volume</a>:<br /> <img src="http://docs.fedoraproject.org/en-US/Fedora/18/html/Installation_Guide/images/diskpartitioning/lvm-pv.png" width="668" height="367" /><br /> Fedora 17 Partition Creation/Editing, from <a href="http://docs.fedoraproject.org/en-US/Fedora/17/html/Installation_Guide/Adding_Partitions-x86.html">9.14.2. Adding Partitions</a>:<br /> <img src="http://docs.fedoraproject.org/en-US/Fedora/17/html/Installation_Guide/images/diskpartitioning/part-add.png" width="498" height="418" /></p> <img src="http://feeds.feedburner.com/~r/JasonAntman/~4/bvUrcQUyWhY" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.jasonantman.com/2013/01/fedora-linux-and-osx-dual-boot-on-mid-2010-62-15-macbook-pro-laptop/feed/</wfw:commentRss> <slash:comments>2</slash:comments> <feedburner:origLink>http://blog.jasonantman.com/2013/01/fedora-linux-and-osx-dual-boot-on-mid-2010-62-15-macbook-pro-laptop/</feedburner:origLink></item> <item><title>Fedora Init Script Specification Summary</title><link>http://feedproxy.google.com/~r/JasonAntman/~3/0ma8gJMWuPk/</link> <comments>http://blog.jasonantman.com/2013/01/fedora-init-script-specification-summary/#comments</comments> <pubDate>Thu, 03 Jan 2013 16:30:56 +0000</pubDate> <dc:creator>Jason Antman</dc:creator> <category><![CDATA[SysAdmin]]></category> <category><![CDATA[centos]]></category> <category><![CDATA[fedora]]></category> <category><![CDATA[init]]></category> <category><![CDATA[redhat]]></category> <category><![CDATA[startup]]></category><guid isPermaLink="false">http://blog.jasonantman.com/?p=1358</guid> <description><![CDATA[A summary of the specifications/requirements for a Fedora init script. <a href="http://blog.jasonantman.com/2013/01/fedora-init-script-specification-summary/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been deploying some new software lately (specifically <a href="https://github.com/marisaseal/selenesse">selenesse</a>, which combines <a href="http://seleniumhq.org/">Selenium</a> and <a href="http://fitnesse.org/">fitnesse</a>, <a href="http://en.wikipedia.org/wiki/Xvfb">xvfb</a>). None of these seem to come with init scripts to run as daemons, and the quality of the few Fedora/RedHat/CentOS init scripts I was able to find was quite poor. The Fedora project has a <a href="http://fedoraproject.org/wiki/Packaging:SysVInitScript">Specification for SysV-style Init Scripts in their Packaging wiki</a>, which specifies what a Fedora/RedHat/CentOS init script should look like, in excruciating detail. What follows is an overview of the more important points, which I&#8217;m using to develop or modify the scripts I&#8217;m currently working on.</p><ul><li>Scripts must be put in <tt>/etc/rc.d/init.d</tt>, not in the <tt>/etc/init.d</tt> symlink. They should have 0755 permissions.</li><li>Scripts must have a Fedora-style <a href="http://fedoraproject.org/wiki/Packaging:SysVInitScript#Chkconfig_Header">chkconfig header</a> (&#8220;chkconfig:&#8221;, &#8220;description:&#8221; lines), and may have an <a href="http://fedoraproject.org/wiki/Packaging:SysVInitScript#LSB_Header">LSB-style header</a> (BEGIN INIT INFO/END INIT INFO). See <a href="http://fedoraproject.org/wiki/Packaging:SysVInitScript#Initscript_template">Initscript template</a>.</li><li>Scripts <strong>must</strong> make use of a lockfile in <tt>/var/lock/subsys/</tt>, and the name of the lockfile must be the same as the name of the init script. (There is a technical reason for this relating to how sysv init terminates daemons at shutdown). The lockfile should be touched when the daemon successfully starts, and removed when it successfully stops.</li><li>Init scripts should not depend on any environment variables set outside the script. They should operate gracefully with an empty/uninitialized environment (or only LANG and TERM set and a CWD of <tt>/</tt>, as enforced by <tt>service(8)</tt>, or with a full environment if they are called directly by a user.</li><li><a href="http://fedoraproject.org/wiki/Packaging:SysVInitScript#Required_Actions">Required actions</a> &#8211; all of the following actions are required, and have specific definitions:<ul><li><strong>start</strong>: starts the service</li><li><strong>stop</strong>: stops the service</li><li><strong>restart</strong>: stop and restart the service if the service is already running, otherwise just start the service</li><li><strong>condrestart (and try-restart)</strong>: restart the service if the service is already running, if not, do nothing</li><li><strong>reload</strong>: reload the configuration of the service without actually stopping and restarting the service (if the service does not support this, do nothing)</li><li><strong>force-reload</strong>: reload the configuration of the service and restart it so that it takes effect</li><li><strong>status</strong>: print the current status of the service</li><li><strong>usage</strong>: by default, if the initscript is run without any action, it should list a &#8220;usage message&#8221; that has all actions (intended for use)</li></ul></li><li>There are specified exit codes for <a href="http://fedoraproject.org/wiki/Packaging:SysVInitScript#Exit_Codes_for_the_Status_Action">status actions</a> and <a href="http://fedoraproject.org/wiki/Packaging:SysVInitScript#Exit_Codes_for_non-Status_Actions">non-status actions</a>.</li><li>They must &#8220;behave sensibly&#8221;. I&#8217;ve found this to be one of the biggest problems with homegrown init scripts. If <tt>servicename start</tt> is called while the service is already running, it should simply exit 0. Likewise if the service is already stopped. Init scripts <strong>must not kill unrelated processes</strong>. I don&#8217;t know how many times I&#8217;ve seen scripts that kill every java or python process on a machine.</li></ul><p>I intend to use this as a quick checklist when developing or evaluating init scripts for RedHat/Fedora based systems. In my experience, the biggest problems with most init scripts revolve around poor handling of PID files and lockfiles, mainly:</p><ul><li>Killing processes other than the one that the script started (i.e. killing all java or python processes), usually because the PID isn&#8217;t tracked at start</li><li>Starting a second instance of the subsystem because lockfiles aren&#8217;t used, or the status function is broken.</li><li>improper exit codes</li><li>either explicitly relying on environment variables (and therefore breaking when called through <tt>service(8)</tt>), or conversely, not cleaning/resetting environment variables that are used by dependent code or processes.</li></ul> <img src="http://feeds.feedburner.com/~r/JasonAntman/~4/0ma8gJMWuPk" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.jasonantman.com/2013/01/fedora-init-script-specification-summary/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.jasonantman.com/2013/01/fedora-init-script-specification-summary/</feedburner:origLink></item> <item><title>Random Links for Wednesday, October 24th</title><link>http://feedproxy.google.com/~r/JasonAntman/~3/t-B1eCGzNT4/</link> <comments>http://blog.jasonantman.com/2012/10/random-links-for-wednesday-october-24th/#comments</comments> <pubDate>Wed, 24 Oct 2012 17:01:29 +0000</pubDate> <dc:creator>Jason Antman</dc:creator> <category><![CDATA[Interesting Links and Resources]]></category> <category><![CDATA[appliancization]]></category> <category><![CDATA[cooling]]></category> <category><![CDATA[datacenter]]></category> <category><![CDATA[google]]></category> <category><![CDATA[healthcare]]></category> <category><![CDATA[legal]]></category> <category><![CDATA[links]]></category> <category><![CDATA[malware]]></category> <category><![CDATA[pacemaker]]></category> <category><![CDATA[patents]]></category> <category><![CDATA[radio]]></category> <category><![CDATA[SDR]]></category> <category><![CDATA[security]]></category><guid isPermaLink="false">http://blog.jasonantman.com/?p=1355</guid> <description><![CDATA[Some random interesting links from Slashdot for today: The Greatest Battle of the Personal Computing Revolution Lies Ahead &#8211; Slashdot. A bit of a rant, but makes some good points that are close to my heart, and unfortunately far from &#8230; <a href="http://blog.jasonantman.com/2012/10/random-links-for-wednesday-october-24th/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Some random interesting links from Slashdot for today:</p><ul><li><a href="http://news.slashdot.org/story/12/10/23/2038220/the-greatest-battle-of-the-personal-computing-revolution-lies-ahead">The Greatest Battle of the Personal Computing Revolution Lies Ahead &#8211; Slashdot</a>. A bit of a rant, but makes some good points that are close to my heart, and unfortunately far from the thoughts of many non-techies.</li><li><a href="http://tos-dr.info/">Terms of Service; Didn&#8217;t Read</a> &#8211; an interesting project</li><li><a href="http://yro.slashdot.org/story/12/10/21/208206/how-patent-trolls-harm-the-economy">How Patent Trolls Harm the Economy &#8211; Slashdot</a> &#8211; another issue close to my heart</li><li><a href="http://www.datacenterknowledge.com/archives/2012/10/17/how-google-cools-its-armada-of-servers/">How Google Cools Its Armada of Servers » Data Center Knowledge</a></li><li><a href="http://www.google.com/about/datacenters/gallery/#/">Data centers – Google Data centers</a> &#8211; A photo tour of Google data centers, by Google, along with a <a href="https://plus.google.com/+google/posts/Gk8ScjPX23n">Google+ post</a> about the architecture photographer who did this work.</li><li><a href="http://tech.slashdot.org/story/12/10/22/0518231/darpa-funds-a-300-software-defined-radio-for-hackers">DARPA Funds a $300 Software-Defined Radio For Hackers &#8211; Slashdot</a> &#8211; way cool.</li><li><a href="http://map.honeynet.org/">Honeynet Map</a> &#8211; &#8220;realtime&#8221; map of cybersecurity incidents, from the Honeynet Project.</li><li><a href="http://science.slashdot.org/story/12/10/17/1741225/malware-is-rampant-on-medical-devices-in-hospitals">Malware Is &#8216;Rampant&#8217; On Medical Devices In Hospitals &#8211; Slashdot</a> &#8211; a bit scary, but unfortunately not that hard to guess. I&#8217;ve seen (probably unpatched) Windows 2000 workstations on hospital networks.</li><li>To top off the scary posts: <a href="http://news.slashdot.org/story/12/10/17/0325236/researcher-reverse-engineers-pacemaker-transmitter-to-deliver-deadly-shocks">Researcher Reverse-Engineers Pacemaker Transmitter To Deliver Deadly Shocks &#8211; Slashdot</a></li></ul> <img src="http://feeds.feedburner.com/~r/JasonAntman/~4/t-B1eCGzNT4" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.jasonantman.com/2012/10/random-links-for-wednesday-october-24th/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.jasonantman.com/2012/10/random-links-for-wednesday-october-24th/</feedburner:origLink></item> <item><title>Readable Nagios Log Timestamps</title><link>http://feedproxy.google.com/~r/JasonAntman/~3/s8Dr8oC6Uys/</link> <comments>http://blog.jasonantman.com/2012/10/readable-nagios-log-timestamps/#comments</comments> <pubDate>Wed, 17 Oct 2012 10:00:01 +0000</pubDate> <dc:creator>Jason Antman</dc:creator> <category><![CDATA[SysAdmin]]></category> <category><![CDATA[icinga]]></category> <category><![CDATA[Nagios]]></category> <category><![CDATA[perl]]></category> <category><![CDATA[timestamp]]></category><guid isPermaLink="false">http://blog.jasonantman.com/?p=1349</guid> <description><![CDATA[Simple command-line Perl to make your Nagios/Icinga logs readable. <a href="http://blog.jasonantman.com/2012/10/readable-nagios-log-timestamps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>If you&#8217;re like me and most humans, the Nagios logfile timestamp (a unix timestamp) isn&#8217;t terribly useful when trying to grep through the logs and correlate events:<br /> <code><br /> # head -2 nagios.log<br /> [1350360000] LOG ROTATION: DAILY<br /> [1350360000] LOG VERSION: 2.0<br /> </code><br /> Here&#8217;s a nifty Perl one-liner that you can pipe your logs through:<br /> perl -pe &#8216;s/(\d+)/localtime($1)/e&#8217;<br /> to get nicer output like:<br /> <code><br /> # head -2 nagios.log<br /> [Tue Oct 16 00:00:00 2012] LOG ROTATION: DAILY<br /> [Tue Oct 16 00:00:00 2012] LOG VERSION: 2.0<br /> </code></p> <img src="http://feeds.feedburner.com/~r/JasonAntman/~4/s8Dr8oC6Uys" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.jasonantman.com/2012/10/readable-nagios-log-timestamps/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.jasonantman.com/2012/10/readable-nagios-log-timestamps/</feedburner:origLink></item> <item><title>Custom Tombstone and Road Sign Pictures</title><link>http://feedproxy.google.com/~r/JasonAntman/~3/zerURCNhYng/</link> <comments>http://blog.jasonantman.com/2012/10/custom-tombstone-and-road-sign-pictures/#comments</comments> <pubDate>Tue, 16 Oct 2012 12:02:43 +0000</pubDate> <dc:creator>Jason Antman</dc:creator> <category><![CDATA[Miscellaneous Geek Stuff]]></category> <category><![CDATA[graphics]]></category> <category><![CDATA[humor]]></category> <category><![CDATA[road sign]]></category> <category><![CDATA[sign]]></category> <category><![CDATA[tombstone]]></category><guid isPermaLink="false">http://blog.jasonantman.com/?p=1345</guid> <description><![CDATA[On the lighter side - a site that lets you build tombstone, road sign or medal images with your text. <a href="http://blog.jasonantman.com/2012/10/custom-tombstone-and-road-sign-pictures/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>On the lighter side, I found a few web sites by <a href="http://www.pixbytom.com/">Tom Blackwell</a> that do some fun stuff with text overlays on images. seems like a nice little tool for those end-of-project powerpoints, or to send out the monthly &#8220;most rolled-back commits&#8221; medal&#8230;</p><p><a href="http://www.tombstonebuilder.com/index.php">Custom Tombstone Maker</a></p><p><img src="/GFX/my_tombstone.jpg?9d7bd4" width="400" height="313" alt="Image of tombstone, with 'Your Text Goes Here' carved into it" /></p><p><a href="http://www.customroadsign.com/">CustomRoadSign.com</p><p><img src="/GFX/menusign.jpg?9d7bd4" height="253" width="403" alt="Highway sign with 'Your Text Goes Here' written on it" /></p><p><a href="http://www.custommotelsign.com/">CustomMotelSign.com</p><p><img src="/GFX/motelsign.jpg?9d7bd4" height="298" width="367" alt="Motel-style sign with 'Your Text Goes Here' written on it" /></p><p><a href="http://www.getamedal.com/">GetAMedal.com</p><p><img src="/GFX/medal.jpg?9d7bd4" height="378" width="305" alt="Gold medal with 'Your Text Goes Here' written on it" /></p> <img src="http://feeds.feedburner.com/~r/JasonAntman/~4/zerURCNhYng" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.jasonantman.com/2012/10/custom-tombstone-and-road-sign-pictures/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.jasonantman.com/2012/10/custom-tombstone-and-road-sign-pictures/</feedburner:origLink></item> <item><title>All-Mechanical Computer Instructional Video</title><link>http://feedproxy.google.com/~r/JasonAntman/~3/Eik7sNakrys/</link> <comments>http://blog.jasonantman.com/2012/10/all-mechanical-computer-instructional-video/#comments</comments> <pubDate>Sat, 13 Oct 2012 01:54:45 +0000</pubDate> <dc:creator>Jason Antman</dc:creator> <category><![CDATA[Miscellaneous Geek Stuff]]></category> <category><![CDATA[mechanical computer]]></category><guid isPermaLink="false">http://blog.jasonantman.com/?p=1341</guid> <description><![CDATA[I saw a link to this YouTube video shared on Tom Limoncelli&#8217;s blog. It&#8217;s a 1953 US Navy instructional video about an all-mechanical fire control computer. Yes, I really mean a computer that can solve continuously changing 25-variable fire control &#8230; <a href="http://blog.jasonantman.com/2012/10/all-mechanical-computer-instructional-video/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I saw a link to <a href="http://www.youtube.com/watch?v=s1i-dnAH9Y4">this YouTube video</a> shared on <a href="http://everythingsysadmin.com/2012/10/mechanical-computer-instructio.html">Tom Limoncelli&#8217;s blog</a>. It&#8217;s a 1953 US Navy instructional video about an all-mechanical fire control computer. Yes, I really mean a <em>computer</em> that can solve continuously changing 25-variable fire control problems using only mechanical means (gears, cams, etc.). Think about it for a minute &#8211; it&#8217;s truly mind-boggling. And really gives one an amazing appreciation for the power of a simple pocket calculator, and the amazing engineering that went into solving these problems before electronic computers. I&#8217;m usually not much of a math geek, but I watched the whole 40 minute video and was in awe of both the simple ability to use three arms and a pin to multiply numbers, and the amazingly precise engineering and machining it would take to translate various rotation inputs into landing a shell on a moving ship miles away. It&#8217;s a really good watch, and will probably leave you astonished by both how far technology has come (and what we take for granted every day), and by the fact that feats of engineering like this one worked quite well.</p> <img src="http://feeds.feedburner.com/~r/JasonAntman/~4/Eik7sNakrys" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blog.jasonantman.com/2012/10/all-mechanical-computer-instructional-video/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blog.jasonantman.com/2012/10/all-mechanical-computer-instructional-video/</feedburner:origLink></item> </channel> </rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 13/16 queries in 0.044 seconds using disk: basic

Served from: blog.jasonantman.com @ 2013-05-24 06:55:58 -->
