<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Tom Moertel's Weblog: Tag fedora</title>
    <link>http://blog.moertel.com/articles/tag/fedora?tag=fedora</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Quality rants on programming theory and stuff geeks like</description>
    <item>
      <title>How to hotsync the Palm Centro with a Fedora 7 Linux desktop via USB</title>
      <description>&lt;p&gt;I just got a Palm Centro smartphone, and I love it. Getting it to sync
with my Linux workstation, however, was tricky, so I&amp;#8217;m posting this
recipe in hopes that it might save you some time.&lt;/p&gt;


	&lt;p&gt;The &amp;#8220;visor&amp;#8221; kernel driver is supposed to make compatible Palm
handhelds look like serial devices when attached via a &lt;span class="caps"&gt;USB&lt;/span&gt; cable.  For
me, it didn&amp;#8217;t work.  Instead, I had to blacklist the driver and
then use libusb to talk to the Centro.  Here&amp;#8217;s the recipe:&lt;/p&gt;


	&lt;p&gt;First, blacklist the &amp;#8220;visor&amp;#8221; kernel driver:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;# echo blacklist visor &amp;gt;&amp;gt; /etc/modprobe.conf
# modprobe -qr visor
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Second, make sure libusb is installed:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;# yum install libusb
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Third, edit the system&amp;#8217;s udev rules to make sure your user account can
access the device files used to talk to the Centro.  On my Fedora 7
setup, I found the right rule in /etc/udev/rules.d/50-udev.rules:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;ACTION=="add", SUBSYSTEM=="usb_endpoint", \
ATTR{bEndpointAddress}=="?*", ATTRS{devnum}=="?*", ATTRS{busnum}=="?*", \
NAME="bus/usb/$attr{busnum}/$attr{devnum}_ep/$attr{bEndpointAddress}", \
MODE="0644", SYMLINK+="%k" 
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;I edited the last line of the rule, changing the mode to 0664 and adding
a &lt;span class="caps"&gt;GROUP&lt;/span&gt; key to assign the Centro devices to my exclusive user group:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;MODE="0664", SYMLINK+="%k", GROUP="thor" 
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This change lets my account talk to the Centro without having to
take on root privileges. (For bonus points you could set up a more-specific rule to match just your Centro. The rule above, as is, will actually match other devices, too.)&lt;/p&gt;


	&lt;p&gt;Fourth, tell udev to reload the rules:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;# udevcontrol reload_rules
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Finally, set up a Palm-device connection via gnome-pilot.  Be sure to
select &lt;span class="caps"&gt;USB&lt;/span&gt; for the Type and &amp;#8220;usb:&amp;#8221; from the Device drop-down list.&lt;/p&gt;


	&lt;p&gt;That&amp;#8217;s it.  If you&amp;#8217;re lucky like me, you should now be ready to
hotsync your Palm Centro!&lt;/p&gt;


&lt;div class="update"&gt;

	&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Even better, &lt;a href="http://howto.pilot-link.org/bluesync/index.html"&gt;this handy &lt;span class="caps"&gt;HOWTO&lt;/span&gt;&lt;/a&gt; shows you to
sync via Bluetooth, which is more convenient than hooking up a &lt;span class="caps"&gt;USB&lt;/span&gt;
cable.  I&amp;#8217;m now using this method.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Update 2:&lt;/strong&gt; If you want to use &lt;span class="caps"&gt;USB&lt;/span&gt; to hotsync your Centro, there is a
method that&amp;#8217;s more convenient than setting up udev rules.  Just create a perms file for
pam_console_apply that tells it to give the console user permission to
access your Centro.  To do so, create a file
/etc/security/console.perms.d/60-libpisock.perms and put the following in it:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;&amp;lt;libpisock&amp;gt;=/dev/usbdev* /dev/bus/usb/[0-9]*/[0-9]*
&amp;lt;console&amp;gt; 0644 &amp;lt;libpisock&amp;gt; 0644 root
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;That&amp;#8217;s it. (You&amp;#8217;ll still need to use libusb.)&lt;/p&gt;


&lt;/div&gt;</description>
      <pubDate>Wed, 31 Oct 2007 00:35:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:32b55049-6f05-4eae-8d46-3c1c350afa4f</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2007/10/31/how-to-hotsync-the-palm-centro-with-a-fedora-7-linux-desktop-via-usb</link>
      <category>linux</category>
      <category>linux</category>
      <category>fedora</category>
      <category>palm</category>
      <category>centro</category>
      <category>hotsync</category>
      <category>usb</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/608</trackback:ping>
    </item>
    <item>
      <title>New Fedora Core RPMS for CRAN packages arm, Matrix, lme4, car, coda, leaps, and mlmRev</title>
      <description>&lt;p&gt;Just a quick note for folks using the &lt;a href="http://www.r-project.org"&gt;R statistics
system&lt;/a&gt; on &lt;a href="http://fedoraproject.org/"&gt;Fedora
Linux&lt;/a&gt;.  I have packaged for Fedora a
bunch of R packages from the &lt;a href="http://cran.r-project.org/"&gt;&lt;span class="caps"&gt;CRAN&lt;/span&gt;&lt;/a&gt;.  (R
packages have to be packaged again, as &lt;span class="caps"&gt;RPM&lt;/span&gt; packages, to integrate with
Fedora Linux.)&lt;/p&gt;


	&lt;p&gt;My initial goal was to package
&lt;a href="http://cran.r-project.org/src/contrib/Descriptions/arm.html"&gt;arm&lt;/a&gt;,
which contains tools for working with various regression models.
(This package accompanies Andrew Gelman and Jennifer Hill&amp;#8217;s wonderful
book &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0521867061/ref=nosim/tommoertesweb-20"&gt;Data Analysis Using Regression and Multilevel/Hierarchical Models&lt;/a&gt;.)
Packaging &amp;#8220;arm,&amp;#8221; however, quickly snowballed into packaging a bunch of
prerequisites.  Thankfully, I have now completed that task and can
share the fruits of my labor with you.&lt;/p&gt;


	&lt;p&gt;All in all, to install &amp;#8220;arm,&amp;#8221; you will need the following RPMs:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;R-arm-1.0-2&lt;/li&gt;
		&lt;li&gt;R-car-1.2-1&lt;/li&gt;
		&lt;li&gt;R-lme4-0.9975-1&lt;/li&gt;
		&lt;li&gt;R-Matrix-0.9975-1&lt;/li&gt;
		&lt;li&gt;R-R2WinBUGS-2.0-1&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;The following RPMs are optional (but you will need them if you
want to rebuild the RPMs):&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;R-coda-0.10-1&lt;/li&gt;
		&lt;li&gt;R-leaps-2.7-1&lt;/li&gt;
		&lt;li&gt;R-mlmRev-0.995-1&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;You can download the packages from the &lt;a href="http://community.moertel.com/ss/space/RPMs"&gt;RPMs
section&lt;/a&gt; of the Community
Projects site.  Better yet, you can use Yum to
download them for you.  Just add the &lt;em&gt;moertel-community&lt;/em&gt;
Yum repository to your /etc/yum.repos.d directory (see &lt;a href="http://community.moertel.com/ss/space/RPMs"&gt;RPMs&lt;/a&gt; for the recipe) and then use the
following command:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo yum install R-arm
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Yum will automatically resolve dependencies and install the required
packages.  If you want any of the optional packages, add them after
&amp;#8220;R-arm&amp;#8221; on the command line.&lt;/p&gt;


	&lt;p&gt;I have built the packages for Fedora Core 6 on the x86_64 architecture, but the
&lt;a href="http://community.moertel.com/rpms/fedora/6/SPECS/"&gt;&lt;span class="caps"&gt;RPM&lt;/span&gt; specs are available&lt;/a&gt;
if you want to rebuild the packages for other architectures.  (See
the instructions for &lt;a href="http://community.moertel.com/ss/space/Rebuilding+RPMs"&gt;rebuilding RPMs&lt;/a&gt; for help.)&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Caveat:&lt;/strong&gt;
I&amp;#8217;m not sure that the R-R2WinBUGS package is fully functional.  It
depends on BRugs, which doesn&amp;#8217;t yet build on the Linux platform.  To
get around this problem, I made R-R2WinBUGS&amp;#8217;s dependency on BRugs
weak; the first package no longer requires the second to install.&lt;/p&gt;</description>
      <pubDate>Wed, 25 Apr 2007 14:07:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:1f62fc7e-a01e-462d-b4ca-e7d8f92f3648</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2007/04/25/new-fedora-core-rpms-for-cran-packages</link>
      <category>statistics</category>
      <category>linux</category>
      <category>fedora</category>
      <category>R</category>
      <category>statistics</category>
      <category>rpms</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/446</trackback:ping>
    </item>
    <item>
      <title>Engauge Digitizer: a handy tool for extracting data from charts</title>
      <description>&lt;p&gt;Today I wanted to extract the data that were visualized in a
chart I saw on &lt;a href="http://www.blog.sethroberts.net/2007/04/14/omega-3-and-arithmetic-continued/"&gt;Seth Roberts&amp;#8217;s blog&lt;/a&gt;.  That is, I had a &lt;em&gt;picture&lt;/em&gt; of a data set, and I wanted the numbers behind the picture.&lt;/p&gt;


	&lt;p&gt;This task turned out to be surprisingly easy &amp;#8211; once I found &lt;a href="http://digitizer.sourceforge.net/"&gt;Engauge Digitizer&lt;/a&gt;, an open-source (GPL) tool made for this very task.  After I launched Engauge, the digitization process was straightforward:&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;I established the chart&amp;#8217;s coordinate system by clicking in the corners and entering the associated coordinates.&lt;/li&gt;
		&lt;li&gt;Then I had Engauge identify data points.  With the mouse, I selected a data point by hand, teaching Engauge what a point looks like. Then Engauge identified spots on chart that looked like data points and locked on to them.  I was able to step through the points to tell Engauge to skip the few it misidentified.&lt;/li&gt;
		&lt;li&gt;I manually selected a few more data points that were scrunched into blobs and had eluded Engauge&amp;#8217;s point-detection heuristics.&lt;/li&gt;
		&lt;li&gt;Finally, I exported the data set in &lt;span class="caps"&gt;CSV&lt;/span&gt; format.&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;If you ever need to extract the data behind a chart, do check out
Engauge Digitizer.  (If you use &lt;a href="http://fedoraproject.org/"&gt;Fedora Linux&lt;/a&gt;,
you&amp;#8217;ll be happy to know that I have packaged Engauge for you.
Get it at the &lt;a href="http://community.moertel.com/ss/space/RPMs"&gt;RPMs section&lt;/a&gt; 
of the community site.)&lt;/p&gt;</description>
      <pubDate>Tue, 17 Apr 2007 03:45:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:f8b0d9b7-7322-4d32-bed8-6f5ded82940f</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2007/04/17/engauge-digitizer-a-handy-tool-for-extracting-data-from-charts</link>
      <category>statistics</category>
      <category>fedora</category>
      <category>statistics</category>
      <category>data</category>
      <category>charts</category>
      <category>plots</category>
      <category>rpms</category>
      <category>tools</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/441</trackback:ping>
    </item>
    <item>
      <title>How to make sure your servers come back up after an extended power outage</title>
      <description>&lt;p&gt;If an extended power outage drains your &lt;span class="caps"&gt;UPS&lt;/span&gt;, and your servers are
forced to shut down, will they automatically start up again when the
power is eventually restored?  It&amp;#8217;s a good question, especially
if your servers are in some distant, unattended server room.
Unless you&amp;#8217;ve tested your servers, don&amp;#8217;t assume that the answer
is Yes.&lt;/p&gt;


	&lt;p&gt;Many servers offer a &lt;span class="caps"&gt;BIOS&lt;/span&gt; configuration option that forces them to
automatically power on when they receive line voltage.  If your
servers have this option, just set it and you&amp;#8217;re done.&lt;/p&gt;


	&lt;p&gt;Unfortunately, some servers, including a Dell PowerEdge 1600SC
that I&amp;#8217;m using, lack this configuration option.  When these servers
turn themselves off as the final step of a &lt;span class="caps"&gt;UPS&lt;/span&gt;-controlled
shutdown, they don&amp;#8217;t start up again when the power is restored.
Because they were shut down &lt;em&gt;before&lt;/em&gt; the power was cut off, they think
they are supposed to remain off when the power is restored.  That is,
they remember their on/off status across power outages.&lt;/p&gt;


	&lt;p&gt;Fortunately, there is a way to make sure these servers automatically
power on: shut them  down without powering them off; halt them
instead.  That way, when the &lt;span class="caps"&gt;UPS&lt;/span&gt; finally cuts off the supply voltage,
the servers will still be in their &amp;#8220;on&amp;#8221; state, and they will remember
this state across the outage. Later, when the power is restored, the servers
will automatically restore their pre-outage state and power up.&lt;/p&gt;


	&lt;p&gt;With Fedora Core Linux and &lt;a href="http://www.networkupstools.org/"&gt;Network &lt;span class="caps"&gt;UPS&lt;/span&gt;
Tools&lt;/a&gt;, it&amp;#8217;s not difficult to make
sure the servers are halted instead of powered off, but the implementation
isn&amp;#8217;t obvious.  To spare you the digging, here are the
important bits.&lt;/p&gt;


&lt;ol&gt;

&lt;li&gt;When the power fails and the &lt;span class="caps"&gt;UPS&lt;/span&gt;-monitoring software decides that
the batteries are almost depleted, it will initiate a server shutdown
using the command defined in the &lt;code&gt;/etc/ups/upsmon.conf&lt;/code&gt;
file.  The default command is this:

&lt;pre&gt;&lt;code&gt;SHUTDOWNCMD "/sbin/shutdown -h +0" 
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;The shutdown command will tell the &lt;code&gt;init&lt;/code&gt; process
to enter runlevel 0, which is the prepare-to-halt-the-system runlevel.&lt;/li&gt;

&lt;li&gt;The &lt;code&gt;init&lt;/code&gt; process will stop all of the running
services in an orderly fashion, and then, as the last step, invoke the
final script in the shutdown process:
&lt;code&gt;/etc/rc.d/rc0.d/S01halt&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;The final lines of the &lt;code&gt;S01halt&lt;/code&gt; script will
power off the server.  Unless, that is, the file &lt;code&gt;/halt&lt;/code&gt; is
present, in which case the script will halt the server instead.&lt;/li&gt;

&lt;/ol&gt;

	&lt;p&gt;Thus the trick is to make sure that the &lt;code&gt;/halt&lt;/code&gt;
file &lt;em&gt;does&lt;/em&gt; exist.  The trick turns out to be easy to pull off;
just redefine the shutdown command in &lt;code&gt;/etc/ups/upsmon.conf&lt;/code&gt;:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;SHUTDOWNCMD "/bin/touch /halt; /sbin/shutdown -h +0" 
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;And that&amp;#8217;s all there is to it!&lt;/p&gt;</description>
      <pubDate>Wed, 09 Aug 2006 00:35:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:488c24a8-dcb3-4015-8d8e-09f6267e6051</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2006/08/09/how-to-make-sure-your-servers-come-back-up-after-an-extended-power-outage</link>
      <category>linux</category>
      <category>hardware</category>
      <category>sysadmin</category>
      <category>hardware</category>
      <category>ups</category>
      <category>linux</category>
      <category>fedora</category>
      <category>nut</category>
      <category>power</category>
      <category>shutdown</category>
      <category>halt</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/151</trackback:ping>
    </item>
  </channel>
</rss>
