<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>crashingdaily</title>
	<atom:link href="http://crashingdaily.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://crashingdaily.wordpress.com</link>
	<description>life in shell</description>
	<lastBuildDate>Fri, 27 Jan 2012 11:50:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='crashingdaily.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>crashingdaily</title>
		<link>http://crashingdaily.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://crashingdaily.wordpress.com/osd.xml" title="crashingdaily" />
	<atom:link rel='hub' href='http://crashingdaily.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Missing RPM package conflicts when installing updates</title>
		<link>http://crashingdaily.wordpress.com/2010/11/15/missing-rpm-package-conflicts-when-installing-updates/</link>
		<comments>http://crashingdaily.wordpress.com/2010/11/15/missing-rpm-package-conflicts-when-installing-updates/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 02:41:06 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[RPM]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=240</guid>
		<description><![CDATA[While making some custom RPMs and then remaking them with altered build steps, I stumbled across the behaviour that rpm will let you install updated packages even when an older package is already installed, provided that none of the files in the new package have changed. Here&#8217;s a demonstration using a simple spec file (Listing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=240&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While making some custom RPMs and then remaking them with altered build steps, I stumbled across the behaviour that rpm will let you install updated packages even when an older package is already installed, provided that none of the files in the new package have changed.</p>
<p>Here&#8217;s a demonstration using a simple spec file (Listing 1) for an RPM package that installs a <code>README</code> file in <code>/tmp/rpmtest/</code>. Note the <code>%install</code> process creates the <code>README</code> file with some text in it.</p>
<p>Build the RPM package from the spec file:</p>
<pre>
$ rpmbuild -bb rpmtest.spec
</pre>
<p>and install it:</p>
<pre>
$ sudo rpm -i /scratch/RPM/RPMS/x86_64/rpmtest-1-1.x86_64.rpm
</pre>
<p>Now, the single <code>README</code> file is installed:</p>
<pre>
$ ls -l /tmp/rpmtest/README
-rw-r--r-- 1 cdaily cdaily 10 Nov 14 16:39 /tmp/rpmtest/README
</pre>
<p>Now we&#8217;ll update the <code>rpmtest.spec</code> file to build Version 1, Release 2. Then we change the rpm&#8217;s install process but not the <code>README</code> contents. For example, in the <code>rpmtest.spec</code> change the defattr, line 22, from </p>
<pre>
%defattr(-, %(%{__id_u} -n), %(%{__id_u} -n), -)
</pre>
<p>to</p>
<pre>
%defattr(-, root, root)
</pre>
<p>and change the spec file&#8217;s <code>Release</code> to
<pre>Release: 2</pre>
<p> (line 4). </p>
<p>The generated <code>README</code> file will be the same, only the file ownership changes between releases.</p>
<p>Build as before and try to install.</p>
<pre>
$ sudo rpm -ivh /scratch/RPM/RPMS/x86_64/rpmtest-1-2.x86_64.rpm
</pre>
<p>That worked. I&#8217;m able to install Version 1, Release 2 and it does not conflict with Release 1.<br />
The <code>README</code> is now owned by root.</p>
<pre>
$ ls -l /tmp/rpmtest/README
-rw-r--r-- 1 root root 10 Nov 14 16:47 /tmp/rpmtest/README
</pre>
<p>I have both packages installed:</p>
<pre>
$ rpm -qa rpmtest
rpmtest-1-1
rpmtest-1-2
</pre>
<p>And the <code>README</code> is owned by both packages:</p>
<pre>
$ rpm -qf /tmp/rpmtest/README
rpmtest-1-1
rpmtest-1-2
</pre>
<p>The same happens if you increment the Version. As long as the checksums for all the package files are unchanged, the rpm install will proceed.</p>
<p>Remove them both:</p>
<pre>
$ sudo rpm -e rpmtest-1-1 rpmtest-1-2
</pre>
<p>Let&#8217;s see what happens when the change a package file. In the <code>rpmtest.spec</code> file, change line 16</p>
<pre>
echo "This is a readme" &gt; $RPM_BUILD_ROOT/tmp/rpmtest/README
</pre>
<p>to</p>
<pre>
echo VERSION %{version} RELEASE %{release} &gt; $RPM_BUILD_ROOT/tmp/rpmtest/README
</pre>
<p>That is, the <code>README</code> contents will now have the version and release numbers and so will change with each release.</p>
<p>After building and installing Release 1, then building Release 2, I am unable to install Release 2.</p>
<pre>
$ sudo rpm -i /scratch/RPM/RPMS/x86_64/rpmtest-1-2.x86_64.rpm
	file /tmp/rpmtest/README from install of rpmtest-1-2.x86_64 conflicts with file from package rpmtest-1-1.x86_64
</pre>
<p>This time because the <code>README</code> has changed between releases, rpm reports a conflict.</p>
<p>In contrast to installing, upgrading a package release (<code>rpm -U rpmtest-1-2.x86_64.rpm </code>) will replace Release 1 with Release 2 even when no files have changed. The upgrade option will also install the rpm if an earlier version/release is not already installed, so if you routinely use the upgrade command instead of the install, you don&#8217;t have to be concerned with ending up with multiple package release installations.</p>
<p>In summary, rpm only reports install conflicts if files change, it doesn&#8217;t make any comparisons of Version or Release numbers. </p>
<p>This seemed odd to me at first but the flexibility it provides does make sense after I thought about it more. So what if multiple packages own the same file? It happens. One common case is with packages for multiple architectures. Consider the neon library as a random example. I have versions installed for both the i386 and x86_64 architectures. The documentation is the same between the two, only the libneon.so shared objects differ and these are installed in different directories so there&#8217;s no conflict.</p>
<p>On the other hand, the observation that a second package installation can change file ownership and permissions of the first package could conceivably be a problem.</p>
<h4>Related:</h4>
<p><a href="http://www.rpm.org/max-rpm/index.html">Maximum RPM</a><br /><span id="more-240"></span>Listing 1. rpmtest.spec, a simple RPM spec file.<br />
<pre class="brush: plain;">
Summary: Simple RPM
Name: rpmtest
Version: 1
Release: 1
License: GPL
Group: Utilities/System

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}

%description
Simple RPM installation of one README file in /tmp/rpmtest

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/tmp/rpmtest
echo &quot;This is a readme&quot; &gt; $RPM_BUILD_ROOT/tmp/rpmtest/README

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, %(%{__id_u} -n), %(%{__id_u} -n), -)
/tmp/rpmtest
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crashingdaily.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crashingdaily.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crashingdaily.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crashingdaily.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/240/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=240&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2010/11/15/missing-rpm-package-conflicts-when-installing-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/071fdc9a426bd695bda2b2061b5fcea9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Fixing the mmr.pl script for SSL</title>
		<link>http://crashingdaily.wordpress.com/2010/11/13/fixing-the-mmr-pl-script-for-ssl/</link>
		<comments>http://crashingdaily.wordpress.com/2010/11/13/fixing-the-mmr-pl-script-for-ssl/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 02:24:43 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
				<category><![CDATA[Fedora Directory Server]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[389 directory server]]></category>
		<category><![CDATA[fedora directory server]]></category>
		<category><![CDATA[multimaster replication]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=229</guid>
		<description><![CDATA[The Howto:MultiMasterReplication wiki page for the 389 Directory Server documents use of the mmr.pl script for setting up replication. The mmr.pl --with-ssl option is used to setup SSL for replication. I have seen a couple of postings on various forums that the script hangs when using --with-ssl option. That happened to me as well at [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=229&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://directory.fedoraproject.org/wiki/Howto:MultiMasterReplication">Howto:MultiMasterReplication</a> wiki page for the 389 Directory Server documents use of the <a href="http://github.com/richm/scripts/blob/master/mmr.pl">mmr.pl</a> script for setting up replication. </p>
<p>The mmr.pl <code>--with-ssl</code> option is used to setup SSL for replication. I have seen a couple of postings on various forums that the script hangs when using  <code>--with-ssl</code> option. That happened to me as well at first. I haven&#8217;t seen any answers on how to resolve this so I posting my patch to the script. (<strike>Maybe someone will submit it to the script&#8217;s maintainer, I&#8217;m too lazy.</strike> Update 1/14/2011: the maintainer, Rich Megginson, accepted the patch so refer to <a href="https://github.com/richm/scripts">his repository</a> for the latest version.) </p>
<p>The problem is that in the current version of the script the <code>--with-ssl</code> option also sets the port used for connections &#8211; port 636 by default. Just setting the port to 636 is not sufficient to inform the script&#8217;s underlying <a href="http://search.cpan.org/~gbarr/perl-ldap/lib/Net/LDAP.pod">Net::LDAP</a> perl library that SSL communication is expected. Specifying a <code>ldaps</code> scheme with the host name triggers the required SSL support in Net::LDAP.</p>
<p>So, I prepended <code>ldaps://</code> to the server in each occurrence of <code>Net::LDAP-&gt;new()</code>. For example,</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
my $ldap = Net::LDAP-&gt;new(&#8220;ldaps://$server&#8221;, port =&gt; $prt) || die &#8220;$@&#8221;;
</div>
<p>(full source is provided below)</p>
<p>Note that the <code>--with-ssl</code> servers two purposes. One is to tell the script to configure the directory to use SSL for all future replication transactions. That is, the communication between the two directory servers will be encrypted. The other action of <code>--with-ssl</code> is to encrypt the communications the script makes to each directory server during the setup and querying (the Net::LDAP business we just resolved). So, you will also want to use both the <code>--with-ssl</code> option for the script&#8217;s other subcommands, such as <code>--display</code> and <code>--remove</code> so those communications are consistently held over secure channels.</p>
<h4>Related:</h4>
<p><a href="https://www.redhat.com/archives/fedora-directory-users/2007-December/msg00141.html">Another MMR setup script.</a> I&#8217;ve not used it.<br /><span id="more-229"></span><pre class="brush: perl;">
#!/usr/bin/perl -w
#
# mmr.pl - configure multimaster replication between two 389 servers
#
# Mike Jackson &amp;lt;mj@sci.fi&amp;gt; 19.11.2005
# Federico Roman added the --port option. 10-08-2007
# Marc Sauton changed --port into --port1 and --port2 options. 15-10-2010
#
# Professional LDAP consulting for large and small projects
#
#       http://www.netauth.com
#
# GPLv2 License
#
#
#
use strict;
use Getopt::Long;
use Net::LDAP qw(LDAP_ALREADY_EXISTS LDAP_TYPE_OR_VALUE_EXISTS);
use Pod::Usage;

my %o;
GetOptions(
    \%o,
    'base=s',       # optional, default to get_base()
    'binddn=s',     # optional, default to &amp;quot;cn=directory manager&amp;quot;
    'bindpw=s',
    'repmanpw=s',
    'host1=s',
    'host2=s',
    'host1_id=i',
    'host2_id=i',
    'port1=i',
    'port2=i',
    'create',
    'display',
    'remove',
    'with-ssl',
    'help',
    'man',
);

pod2usage(-verbose =&amp;gt; 1) if ($o{help});
pod2usage(-verbose =&amp;gt; 2) if ($o{man} );

pod2usage(-verbose =&amp;gt; 1) if (! ($o{create} || $o{display} || $o{remove}) );

# mandatory in all cases
my $host1     = $o{host1};
my $host2     = $o{host2};
my $bindpw    = $o{bindpw};

# mandatory in create case
my $create    = $o{create};
my $host1_id  = $o{host1_id};
my $host2_id  = $o{host2_id};
my $repmanpw  = $o{repmanpw};

# mandatory in display case
my $display   = $o{display};

# mandatory in remove case
my $remove    = $o{remove};

# optional in create case
my $with_ssl  = $o{'with-ssl'};

my $scheme = ($with_ssl &amp;amp;&amp;amp; &amp;quot;ldaps&amp;quot;) || &amp;quot;ldap&amp;quot;;

# optional in all cases
my $port1     = $o{port1}    || ($with_ssl &amp;amp;&amp;amp; &amp;quot;636&amp;quot;) || &amp;quot;389&amp;quot;;
my $port2     = $o{port2}    || ($with_ssl &amp;amp;&amp;amp; &amp;quot;636&amp;quot;) || &amp;quot;389&amp;quot;;
my $base      = $o{base}    || get_base($host1, $port1);
my $binddn    = $o{binddn}  || &amp;quot;cn=directory manager&amp;quot;;

# all cases check
if (!($host1 &amp;amp;&amp;amp; $host2 &amp;amp;&amp;amp; $bindpw))
{
    pod2usage(-verbose =&amp;gt; 1);
    exit(1);
}



###############################################
# create
###############################################
if ($create)
{
    if (!($host1_id &amp;amp;&amp;amp; $host2_id &amp;amp;&amp;amp; $repmanpw))
    {
        pod2usage(-verbose =&amp;gt; 1);
        exit(1);
    }
    else
    {
        # configure suppliers
        config_supplier($host1, $port1, $host1_id, $repmanpw);
        config_supplier($host2, $port2, $host2_id, $repmanpw);

        # add replication agreements
        add_rep_agreement($host1, $port1, $host2, $port2, $repmanpw);
        add_rep_agreement($host2, $port2, $host1, $port1, $repmanpw);

        # initialize host2 from host1
        initialize($host1, $port1, $host2, $port2);
    }
}

###############################################
# remove
###############################################
if ($remove)
{
    if (!($host1 &amp;amp;&amp;amp; $host2))
    {
        pod2usage(-verbose =&amp;gt; 1);
        exit(1);
    }
    else
    {
        # remove agreements
        remove_agreement($host1, $port1, $host2);
        remove_agreement($host2, $port2, $host1);
    }
}

###############################################
# display
###############################################
if ($display)
{
    if (!($host1 &amp;amp;&amp;amp; $host2))
    {
        pod2usage(-verbose =&amp;gt; 1);
        exit(1);
    }
    else
    {
        # display agreements
        print &amp;quot;\n&amp;quot;;
        display_agreement($host1, $port1);
        print &amp;quot;\n&amp;quot;;
        display_agreement($host2, $port2);
        print &amp;quot;\n&amp;quot;;
    }
}



###############################################
# subs
###############################################
sub display_agreement
{
    my ($server, $prt) = @_;

    my $msg;
    my $res;

    my $ldap = Net::LDAP-&amp;gt;new(&amp;quot;$scheme://$server&amp;quot;, port =&amp;gt; $prt) || die &amp;quot;$@&amp;quot;;

    $msg     = $ldap-&amp;gt;bind($binddn, password =&amp;gt; $bindpw, version =&amp;gt; 3);
    $msg-&amp;gt;code &amp;amp;&amp;amp; die $msg-&amp;gt;error;

    print &amp;quot;replication agreements from $server port $prt\n&amp;quot;;
    $res = $ldap-&amp;gt;search(
                         base    =&amp;gt; &amp;quot;cn=config&amp;quot;,
                         filter  =&amp;gt; &amp;quot;(objectClass=nsDS5ReplicationAgreement)&amp;quot;,
                        );
    $res-&amp;gt;code &amp;amp;&amp;amp; die $res-&amp;gt;error;

    if ($res-&amp;gt;count)
    {
        for ($res-&amp;gt;entries)
        {
            print &amp;quot;\t -&amp;gt; to host &amp;quot; . $_-&amp;gt;get_value(&amp;quot;nsDS5ReplicaHost&amp;quot;);
            print &amp;quot; port &amp;quot; . $_-&amp;gt;get_value(&amp;quot;nsDS5ReplicaPort&amp;quot;);
            print &amp;quot; suffix &amp;quot; . $_-&amp;gt;get_value(&amp;quot;nsDS5ReplicaRoot&amp;quot;) . &amp;quot;\n&amp;quot;;
        }
    }
    else
    {
        print &amp;quot;\t -&amp;gt; none found\n&amp;quot;;
    }

    $ldap-&amp;gt;unbind;
}


sub remove_agreement
{
    my ($from, $prt, $to) = @_;

    my $msg;
    my $res;

    my $ldap = Net::LDAP-&amp;gt;new(&amp;quot;$scheme://$from&amp;quot;, port =&amp;gt; $prt) || die &amp;quot;$@&amp;quot;;

    $msg     = $ldap-&amp;gt;bind($binddn, password =&amp;gt; $bindpw, version =&amp;gt; 3);
    $msg-&amp;gt;code &amp;amp;&amp;amp; die $msg-&amp;gt;error;

    print &amp;quot;removing replication agreement from $from (port $prt) -&amp;gt; $to\n&amp;quot;;
    $res = $ldap-&amp;gt;search(
                         base    =&amp;gt; &amp;quot;cn=config&amp;quot;,
                         filter  =&amp;gt; &amp;quot;(&amp;amp;(objectClass=nsDS5ReplicationAgreement)(nsDS5ReplicaHost=$to))&amp;quot;,
                        );
    $res-&amp;gt;code &amp;amp;&amp;amp; die $res-&amp;gt;error;

    my $dn  = $res-&amp;gt;entry(0)-&amp;gt;dn;

    $res    = $ldap-&amp;gt;delete($dn);
    $res-&amp;gt;code &amp;amp;&amp;amp; warn &amp;quot;failed to remove replication agreement: &amp;quot; . $res-&amp;gt;error;

    $ldap-&amp;gt;unbind;
}


sub config_supplier
{
    my ($server, $prt, $replicaid, $repmanpw) = @_;

    my $msg;
    my $res;

    my $ldap = Net::LDAP-&amp;gt;new(&amp;quot;$scheme://$server&amp;quot;, port =&amp;gt; $prt) || die &amp;quot;$@&amp;quot;;

    $msg     = $ldap-&amp;gt;bind($binddn, password =&amp;gt; $bindpw, version =&amp;gt; 3);
    $msg-&amp;gt;code &amp;amp;&amp;amp; die $msg-&amp;gt;error;


    ##############################
    # find the instance-dir
    ##############################
    $res = $ldap-&amp;gt;search (
                          base    =&amp;gt; &amp;quot;cn=config&amp;quot;,
                          scope   =&amp;gt; &amp;quot;base&amp;quot;,
                          filter  =&amp;gt; &amp;quot;(objectClass=*)&amp;quot;,
                         );

    my $instance_dir = $res-&amp;gt;entry(0)-&amp;gt;get_value(&amp;quot;nsslapd-instancedir&amp;quot;);
    my $hadd = $server;
    # $hadd = &amp;quot;newserver&amp;quot; if $server eq &amp;quot;some_exception&amp;quot;;
    $instance_dir ||= &amp;quot;/etc/dirsrv/slapd-$hadd&amp;quot;;
    ##############################

    ##############################
    # add changelog
    ##############################
    print &amp;quot;adding to $server port $prt -&amp;gt; cn=changelog5,cn=config\n&amp;quot;;
    $res = $ldap-&amp;gt;add(
          &amp;quot;cn=changelog5,cn=config&amp;quot;,
          attr =&amp;gt; [
            objectclass                  =&amp;gt; [qw (top extensibleObject)],
            cn                           =&amp;gt; &amp;quot;changelog5&amp;quot;,
            &amp;quot;nsslapd-changelogdir&amp;quot;       =&amp;gt; &amp;quot;$instance_dir/changelogdb&amp;quot;,
          ]
    );

    if ($res-&amp;gt;code == LDAP_ALREADY_EXISTS)
    {
        print &amp;quot;\t -&amp;gt; already exists\n\n&amp;quot;;
    }
    else
    {
        $res-&amp;gt;code &amp;amp;&amp;amp; die &amp;quot;failed to add changelog entry: &amp;quot; . $res-&amp;gt;error;
    }
    ##############################

    ##############################
    # add replication user
    ##############################
    print &amp;quot;adding to $server port $prt -&amp;gt; cn=repman,cn=config\n&amp;quot;;
    $res = $ldap-&amp;gt;add(
          &amp;quot;cn=repman,cn=config&amp;quot;,
          attr =&amp;gt; [
            objectclass    =&amp;gt; [qw (top person)],
            cn             =&amp;gt; &amp;quot;repman&amp;quot;,
            sn             =&amp;gt; &amp;quot;repman&amp;quot;,
            userPassword   =&amp;gt; $repmanpw,
          ]
    );

    if ($res-&amp;gt;code == LDAP_ALREADY_EXISTS)
    {
        print &amp;quot;\t -&amp;gt; already exists\n\n&amp;quot;;
    }
    else
    {
        $res-&amp;gt;code &amp;amp;&amp;amp; die &amp;quot;failed to add repman entry: &amp;quot; . $res-&amp;gt;error;
    }
    ##############################

    ##############################
    # add replica object
    ##############################
    print &amp;quot;adding to $server port $prt -&amp;gt; cn=replica,cn=\&amp;quot;$base\&amp;quot;,cn=mapping tree,cn=config\n&amp;quot;;
    $res = $ldap-&amp;gt;add(
          &amp;quot;cn=replica,cn=\&amp;quot;$base\&amp;quot;,cn=mapping tree,cn=config&amp;quot;,
          attr =&amp;gt; [
            objectclass                  =&amp;gt; [qw (top nsDS5Replica)],
            cn                           =&amp;gt; &amp;quot;replica&amp;quot;,
            nsDS5ReplicaId               =&amp;gt; $replicaid,
            nsDS5ReplicaRoot             =&amp;gt; $base,
            nsDS5Flags                   =&amp;gt; 1,
            nsDS5ReplicaBindDN           =&amp;gt; &amp;quot;cn=repman,cn=config&amp;quot;,
            nsds5ReplicaPurgeDelay       =&amp;gt; 604800,
            nsds5ReplicaLegacyConsumer   =&amp;gt; &amp;quot;off&amp;quot;,
            nsDS5ReplicaType             =&amp;gt; 3,
          ]
    );

    if ($res-&amp;gt;code == LDAP_ALREADY_EXISTS)
    {
        print &amp;quot;\t -&amp;gt; already exists\n\n&amp;quot;;
    }
    else
    {
        $res-&amp;gt;code &amp;amp;&amp;amp; die &amp;quot;failed to add replica entry: &amp;quot; . $res-&amp;gt;error;
    }
    ##############################

    $ldap-&amp;gt;unbind;
}


sub add_rep_agreement
{
    my ($from, $prt1, $to, $prt2, $repmanpw) = @_;

    my $msg;
    my $res;
    
    my $ldap = Net::LDAP-&amp;gt;new(&amp;quot;$scheme://$from&amp;quot;, port =&amp;gt; $prt1) || die &amp;quot;$@&amp;quot;;

    $msg     = $ldap-&amp;gt;bind($binddn, password =&amp;gt; $bindpw, version =&amp;gt; 3);
    $msg-&amp;gt;code &amp;amp;&amp;amp; die $msg-&amp;gt;error;

    if ($with_ssl)
    {
        print &amp;quot;adding to $from port $prt1 -&amp;gt; SSL replication $from port $prt1 -&amp;gt; $to port $prt2\n&amp;quot;;
        $res = $ldap-&amp;gt;add(
              &amp;quot;cn=\&amp;quot;Replication from $from port $prt1 to $to port $prt2\&amp;quot;,cn=replica,cn=\&amp;quot;$base\&amp;quot;,cn=mapping tree,cn=config&amp;quot;,
              attr =&amp;gt; [
                objectclass                  =&amp;gt; [qw (top nsDS5ReplicationAgreement)],
                cn                           =&amp;gt; &amp;quot;\&amp;quot;Replication from $from port $prt1 to $to port $prt2\&amp;quot;&amp;quot;,
                nsDS5ReplicaHost             =&amp;gt; $to,
                nsDS5ReplicaRoot             =&amp;gt; &amp;quot;$base&amp;quot;,
                nsDS5ReplicaPort             =&amp;gt; $prt2,
                nsDS5ReplicaTransportInfo    =&amp;gt; &amp;quot;SSL&amp;quot;,
                nsDS5ReplicaBindDN           =&amp;gt; &amp;quot;cn=repman,cn=config&amp;quot;,
                nsDS5ReplicaBindMethod       =&amp;gt; &amp;quot;simple&amp;quot;,
                nsDS5ReplicaCredentials      =&amp;gt; $repmanpw,
                nsDS5ReplicaTimeOut          =&amp;gt; 120,
              ]
        );

        if ($res-&amp;gt;code == LDAP_ALREADY_EXISTS)
        {
            print &amp;quot;\t -&amp;gt; already exists\n\n&amp;quot;;
        }
        else
        {
            $res-&amp;gt;code &amp;amp;&amp;amp; die &amp;quot;failed to add replication agreement entry: &amp;quot; . $res-&amp;gt;error;
        }
    }
    else
    {
        print &amp;quot;adding to $from port $prt1 -&amp;gt; plaintext replication $from port $prt1 -&amp;gt; $to port $prt2\n&amp;quot;;
        $res = $ldap-&amp;gt;add(
              &amp;quot;cn=\&amp;quot;Replication from $from port $prt1 to $to port $prt2\&amp;quot;,cn=replica,cn=\&amp;quot;$base\&amp;quot;,cn=mapping tree,cn=config&amp;quot;,
              attr =&amp;gt; [
                objectclass                  =&amp;gt; [qw (top nsDS5ReplicationAgreement)],
                cn                           =&amp;gt; &amp;quot;\&amp;quot;Replication from $from port $prt1 to $to port $prt2\&amp;quot;&amp;quot;,
                nsDS5ReplicaHost             =&amp;gt; $to,
                nsDS5ReplicaRoot             =&amp;gt; &amp;quot;$base&amp;quot;,
                nsDS5ReplicaPort             =&amp;gt; $prt2,
                nsDS5ReplicaBindDN           =&amp;gt; &amp;quot;cn=repman,cn=config&amp;quot;,
                nsDS5ReplicaBindMethod       =&amp;gt; &amp;quot;simple&amp;quot;,
                nsDS5ReplicaCredentials      =&amp;gt; $repmanpw,
                nsDS5ReplicaTimeOut          =&amp;gt; 120,
              ]
        );

        if ($res-&amp;gt;code == LDAP_ALREADY_EXISTS)
        {
            print &amp;quot;\t -&amp;gt; already exists\n\n&amp;quot;;
        }
        else
        {
            $res-&amp;gt;code &amp;amp;&amp;amp; die &amp;quot;failed to add replication agreement entry: &amp;quot; . $res-&amp;gt;error;
        }
    }

    $ldap-&amp;gt;unbind;
}


sub initialize
{
    my ($from, $prt1, $to, $prt2) = @_;

    my $msg;
    my $res;

    my $ldap = Net::LDAP-&amp;gt;new(&amp;quot;$scheme://$from&amp;quot;, port =&amp;gt; $prt1) || die &amp;quot;$@&amp;quot;;

    $msg     = $ldap-&amp;gt;bind($binddn, password =&amp;gt; $bindpw, version =&amp;gt; 3);
    $msg-&amp;gt;code &amp;amp;&amp;amp; die $msg-&amp;gt;error;

    print &amp;quot;initializing replication $from (port $prt1) -&amp;gt; $to (port $prt2)\n&amp;quot;;

    my $dn = &amp;quot;cn=\&amp;quot;Replication from $from port $prt1 to $to port $prt2\&amp;quot;,cn=replica,cn=\&amp;quot;$base\&amp;quot;,cn=mapping tree,cn=config&amp;quot;;

    $res = $ldap-&amp;gt;modify($dn, add =&amp;gt; { nsDS5BeginReplicaRefresh =&amp;gt; 'start' });
    $res-&amp;gt;code &amp;amp;&amp;amp; die &amp;quot;failed to add initialization attribute: &amp;quot; . $res-&amp;gt;error;

    $ldap-&amp;gt;unbind;
}


sub get_base
{
    my ($server, $prt) = @_;

    my $base;
    my $res;

    my $ldap = Net::LDAP-&amp;gt;new(&amp;quot;$scheme://$server&amp;quot;, port =&amp;gt; $prt) || die &amp;quot;$@&amp;quot;;
    $ldap-&amp;gt;bind;

    $res = $ldap-&amp;gt;search(
                         base    =&amp;gt; &amp;quot;&amp;quot;,
                         scope   =&amp;gt; &amp;quot;base&amp;quot;,
                         filter  =&amp;gt; &amp;quot;(objectClass=*)&amp;quot;,
                        );
    $res-&amp;gt;code &amp;amp;&amp;amp; die $res-&amp;gt;error;

    my @contexts = $res-&amp;gt;entry(0)-&amp;gt;get_value(&amp;quot;namingContexts&amp;quot;);

    for (@contexts)
    {
        if (! /o=NetscapeRoot/)
        {
            $base = $_;
        }
    }

    $ldap-&amp;gt;unbind;

    return $base;
}


__END__

=head1 NAME

mmr.pl - Configure multi-master replication between two 389 Directory Servers

=head1 SYNOPSIS

Usage: mmr.pl [options]

 Mandatory in all cases:
    --host1       FQDN of host 1
    --host2       FQDN of host 2
    --bindpw      Password for Directory Manager

 Optional in all cases:
    --base        LDAP naming context
    --binddn      Alternative distinguished name for Directory Manager
    --port1       LDAP port (default=389) for host 1
    --port2       LDAP port (default=389) for host 2

 Mandatory for creating a 2-way agreement:
    --host1_id    Replication ID number of host 1
    --host2_id    Replication ID number of host 2
    --repmanpw    Password for Replication Manager
    --create

 Optional when creating a 2-way agreement:
    --with-ssl    Use SSL for Replication (requires CA and server certs on both machines)

 Mandatory for removing a 2-way agreement:
    --remove

 Mandatory for displaying agreements
    --display

 Examples:

 # create a 2-way replication agreement
 % mmr.pl \
    --host1 a.bigcorp.com \
    --host2 b.bigcorp.com \
    --host1_id 1 \
    --host2_id 2 \
    --bindpw secret \
    --repmanpw repsecret \
    --create

 # create a 2-way replication agreement with SSL
 % mmr.pl \
    --host1 a.bigcorp.com \
    --host2 b.bigcorp.com \
    --host1_id 1 \
    --host2_id 2 \
    --bindpw secret \
    --repmanpw repsecret \
    --create \
    --with-ssl

 # remove a 2-way replication agreement
 % mmr.pl \
    --host1 a.bigcorp.com \
    --host2 b.bigcorp.com \
    --bindpw secret \
    --remove

 # display replication agreements
 % mmr.pl \
    --host1 a.bigcorp.com \
    --host2 b.bigcorp.com \
    --port1 3890
    --bindpw secret \
    --display


=head1 DESCRIPTION

B&amp;lt;mmr.pl&amp;gt; will configure multi-master replication between two 389 or
Red Hat Directory Servers.

The listen port must be the same on both machines. By default port 389
is assumed (636 if --with-ssl) , but it can be overriden with the --port option.

The &amp;quot;cn=Directory Manager&amp;quot; user's password must be the same on both
machines. As well, the &amp;quot;cn=Directory Manager&amp;quot; user which was created
during installation must exist on both machines, or if this username
was changed to something else then it can be provided with the --binddn
option.

The LDAP naming context must be the same on both machines. If there
is only one naming context configured on the machines, then it is not
necessary to provide the --base option as the naming context will be
discovered automatically.

=cut
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crashingdaily.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crashingdaily.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crashingdaily.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crashingdaily.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/229/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=229&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2010/11/13/fixing-the-mmr-pl-script-for-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/071fdc9a426bd695bda2b2061b5fcea9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Using groups with TestNG</title>
		<link>http://crashingdaily.wordpress.com/2009/11/12/using-groups-with-testng/</link>
		<comments>http://crashingdaily.wordpress.com/2009/11/12/using-groups-with-testng/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 15:39:20 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
				<category><![CDATA[testng]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=212</guid>
		<description><![CDATA[This post demonstrates a simple example of using groups with TestNG. For this exercise I&#8217;m using a very simple file layout. The jar file was copied directly from the TestNG package. SampleTest.java and testng.xml are my test and configuration files, respectively. [23:31 20090914 crashing@desktop ~/simpletestng] $ ls SampleTest.java testng-5.10-jdk15.jar testng.xml SampleTest.java has two test methods, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=212&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post demonstrates a simple example of using groups with TestNG.</p>
<p>For this exercise I&#8217;m using a very simple file layout. The jar file was copied directly from the TestNG package. SampleTest.java and testng.xml are my test and configuration files, respectively.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
[23:31 20090914 crashing@desktop ~/simpletestng]<br />
$ ls<br />
SampleTest.java		testng-5.10-jdk15.jar	testng.xml</p>
</div>
<p>SampleTest.java has two test methods, annotated with @Test, and with an assigned group name.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
import org.testng.annotations.*;<br />
public class SampleTest {<br />
    @Test(groups = { &#8220;groupA&#8221; })<br />
    public void methodA() {<br />
        System.out.println(&#8220;groupA&#8221;);<br />
        assert true;<br />
    }</p>
<p>    @Test(groups = { &#8220;groupB&#8221; })<br />
    public void methodB() {<br />
        System.out.println(&#8220;groupB&#8221;);<br />
        assert true;<br />
    }<br />
}</p>
</div>
<p>testng.xml defines these two groups as belonging to a test set.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
&lt;!DOCTYPE suite SYSTEM &quot;http://testng.org/testng-1.0.dtd&quot;&gt;<br />
&lt;suite thread-count=&quot;5&quot; verbose=&quot;1&quot; name=&quot;TrialTest&quot; annotations=&quot;JDK&quot;&gt;</p>
<p>    &lt;test name=&quot;TestSet&quot; enabled=&quot;true&quot;&gt;<br />
        &lt;groups&gt;<br />
            &lt;run&gt;<br />
                &lt;include name=&quot;groupA&quot;/&gt;<br />
                &lt;include name=&quot;groupB&quot;/&gt;<br />
            &lt;/run&gt;<br />
        &lt;/groups&gt;</p>
<p>        &lt;classes&gt;<br />
            &lt;class name=&quot;SampleTest&quot;/&gt;<br />
        &lt;/classes&gt;<br />
    &lt;/test&gt;</p>
<p>&lt;/suite&gt;
</p></div>
<p>I compile the SampleTest class,</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
$ javac -classpath testng-5.10-jdk15.jar SampleTest.java
</div>
<p>and then run all the test methods as configured in testng.xml</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
$ java -classpath .:testng-5.10-jdk15.jar  org.testng.TestNG testng.xml</p>
<p>[Parser] Running:<br />
  /Users/crashing/simpletestng/testng.xml</p>
<p>groupA<br />
groupB</p>
<p>===============================================<br />
TrialTest<br />
Total tests run: 2, Failures: 0, Skips: 0<br />
===============================================
</p></div>
<p>Both test methods ran.</p>
<p>Alternatively I can specify specific groups to run. For this I use the <code>-groups</code> and <code>-testclass</code> option. I do not use the testng.xml file.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
java -classpath .:testng-5.10-jdk15.jar  org.testng.TestNG  -groups groupB -testclass SampleTest</p>
<p>[Parser] Running:<br />
  Command line suite</p>
<p>groupB</p>
<p>===============================================<br />
Command line suite<br />
Total tests run: 1, Failures: 0, Skips: 0<br />
===============================================
</p></div>
<p>Specifying both the testng.xml and a -groups option will cause both configurations to be processed. </p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
[22:58 20090914 crashing@desktop ~/simpletestng]<br />
$ java -classpath .:testng-5.10-jdk15.jar  org.testng.TestNG testng.xml -groups groupA -testclass SampleTest<br />
[Parser] Running:<br />
  /Users/crashing/simpletestng/testng.xml<br />
  Command line suite</p>
<p>groupA<br />
groupB</p>
<p>===============================================<br />
TrialTest<br />
Total tests run: 2, Failures: 0, Skips: 0<br />
===============================================</p>
<p>groupA</p>
<p>===============================================<br />
Command line suite<br />
Total tests run: 1, Failures: 0, Skips: 0<br />
===============================================
</p></div>
<p>This is probably not what you want. So, use either the testng.xml or the -groups and -testclass option, not both.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crashingdaily.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crashingdaily.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crashingdaily.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crashingdaily.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/212/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=212&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2009/11/12/using-groups-with-testng/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/071fdc9a426bd695bda2b2061b5fcea9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Defining test descriptions in testng reports</title>
		<link>http://crashingdaily.wordpress.com/2009/09/13/defining-test-descriptions-in-testng-reports/</link>
		<comments>http://crashingdaily.wordpress.com/2009/09/13/defining-test-descriptions-in-testng-reports/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 02:48:07 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
				<category><![CDATA[testng]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=208</guid>
		<description><![CDATA[The output html of testng&#8216;s reporter has the columns &#8220;Test method&#8221; and &#8220;Instance&#8221; that document each test run. &#8220;Test method&#8221; can be customized by defining public String getTestName() method in the class providing the test method. &#8220;Instance&#8221; can be customized by defining public String toString() method in the class providing the test method.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=208&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The output html of <a href="http://testng.org/">testng</a>&#8216;s reporter has the columns &#8220;<code>Test method</code>&#8221; and &#8220;<code>Instance</code>&#8221; that document each test run.</p>
<p>&#8220;<code>Test method</code>&#8221; can be customized by defining <code> public String getTestName()</code> method in the class providing the test method.</p>
<p>&#8220;<code>Instance</code>&#8221; can be customized by defining <code> public String toString()</code> method in the class providing the test method.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crashingdaily.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crashingdaily.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crashingdaily.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crashingdaily.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/208/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=208&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2009/09/13/defining-test-descriptions-in-testng-reports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/071fdc9a426bd695bda2b2061b5fcea9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Extending Selenium server with custom commands</title>
		<link>http://crashingdaily.wordpress.com/2009/09/13/extending-selenium-server-with-custom-commands/</link>
		<comments>http://crashingdaily.wordpress.com/2009/09/13/extending-selenium-server-with-custom-commands/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 02:35:46 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=202</guid>
		<description><![CDATA[In this posting I document extending Selenium server with a custom javascript method, getAllRadios(), to return all radio button elements in a page. It&#8217;s based on the getAllButtons() that is stock in Selenium. I will demonstrate two ways to add this custom method. The first strategy is to add the custom method to the native [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=202&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this posting I document extending <a href="http://seleniumhq.org/">Selenium</a> server with a custom javascript method, <code>getAllRadios()</code>, to return all radio button elements in a page. It&#8217;s based on the <code>getAllButtons()</code> that is stock in Selenium.</p>
<p>I will demonstrate two ways to add this custom method. The first strategy is to add the custom method to the native javascript files that ship with Selenium server. This is not the recommended way to extend Selenium but it is an almost guaranteed way to be sure the server picks up my new method and that frees me to focus on getting my client syntax right for calling the new method using the client&#8217;s <code>doCommand()</code> method.</p>
<h4>Method 1 &#8211; selenium-browserbot.js + selenium-api.js</h4>
<p>Unpack the server jar into a temporary directory to get access to the <code>selenium-browserbot.js</code> and <code>selenium-api.js</code> files.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
[20:54 20090906 crashing@server /selenium-server-1.0.1/temp]<br />
$ jar xf ../selenium-server.jar </p>
</div>
<p>The new custom method is added to <code>core/scripts/selenium-browserbot.js</code>. It is a slightly modified version of <code>getAllButtons()</code> which is defined in the same file.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
<p>BrowserBot.prototype.getAllRadios = function() {<br />
    var elements = this.getDocument().getElementsByTagName(&#39;input&#39;);<br />
    var result = [];<br />
    for (var i = 0; i &lt; elements.length; i++) {<br />
        if (elements[i].type == &#39;radio&#39;) {<br />
            result.push(elements[i].id);<br />
        }<br />
    }<br />
    return result;<br />
};  </p>
</div>
<p>and then the new method is exposed to the Selenium API in <code>core/scripts/selenium-api.js</code>, again modeling after <code>getAllButtons()</code> in <code>selenium-api.js</code>.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
<p>Selenium.prototype.getAllRadios = function() {<br />
   return this.browserbot.getAllButtons();<br />
};</p>
</div>
<p>Now rebundle the updated javascript into a new server jar, replacing the original.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
<p>[21:01 20090906 crashing@server /selenium-server-1.0.1/temp]<br />
$ jar cmf META-INF/MANIFEST.MF ../selenium-server.jar .</p>
</div>
<h4>Method 2 &#8211; user-extension.js</h4>
<p>The better way to extend Selenium is to add methods&#160;to the <code>user-extensions.js</code> file. This avoids screwing around with the native server jar. I initiall had some trouble getting this working, hence the Method 1 approach, but after a bit of futzing I finally got this to work. </p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
<p>Selenium.prototype.getAllRadios = function() {<br />
    var elements = this.browserbot.getDocument().getElementsByTagName(&#39;input&#39;);<br />
    var result = [];<br />
    for (var i = 0; i &lt; elements.length; i++) {<br />
        if (elements[i].type == &#39;radio&#39;) {<br />
            result.push(elements[i].id);<br />
        }<br />
    }<br />
    return result;<br />
};</p>
</div>
<p>This is basically the same method used in <code>selenium-browserbot.js</code>. The important changed bits are (1) the method is attached to the Selenium object instead of the BrowserBot (<code>Selenium.prototype</code> rather than <code>BrowserBot.prototype</code>) and (2) calling <code>getDocument()</code> on the <code>browserbot</code> instance.</p>
<p>I start the Selenium server with the <code>-userExtensions</code> option pointing to the <code>user-extensions.js</code> file.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
java -jar \<br />
  /selenium-server-1.0.1/selenium-server.jar \<br />
  -userExtensions  /user-extensions.js</p>
</div>
<h4>Client Coding</h4>
<p>For either of the above methods of extending the Selenium server, I call this new method in my client code with the <code>doCommand()</code>. </p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
/** incomplete code **/</p>
<p>proc = new HttpCommandProcessor(seleniumServerHost, <br />
        seleniumServerPort, brower, seleniumServerStartUrl);<br />
selenium = new DefaultSelenium(proc);</p>
<p>selenium.open(url);</p>
<p>// radio buttons returned as comma-delimited strings<br />
String allRadios = proc.doCommand(&quot;getAllRadios&quot;, null);</p>
<p>// alternatively, get radio buttons as a String array<br />
String[] radios = proc.getStringArray(&quot;getAllRadios&quot;, null);<br />
for (String radio : radios) {<br />
    System.out.println(radio);<br />
}</p>
</div>
<p>To call custom <code>doCommand()</code>&#8216;s, it&#8217;s necessary to instantiate with  <code>DefaultSelenium(proc)</code> to inject the <code>HttpCommandProcessor</code> into the <code>DefaultSelenium</code> object.</p>
<h4>Related:</h4>
<p><a href="http://clearspace.openqa.org/message/20980">Select the ids of radio buttons in a page using selenium</a><br />
<a href="http://seleniumhq.org/docs/08_user_extensions.html">User-Extensions</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crashingdaily.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crashingdaily.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crashingdaily.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crashingdaily.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=202&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2009/09/13/extending-selenium-server-with-custom-commands/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/071fdc9a426bd695bda2b2061b5fcea9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Downsizing Google&#8217;s search input box</title>
		<link>http://crashingdaily.wordpress.com/2009/09/12/downsizing-googles-search-input-box/</link>
		<comments>http://crashingdaily.wordpress.com/2009/09/12/downsizing-googles-search-input-box/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 05:16:39 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=184</guid>
		<description><![CDATA[Google has made its search input box bigger and its font size larger. Excuse me, they S-U-P-E-R-sized! it. It&#8217;s not a mistake, indeed Google actually seems proud of it. Fortunately, Safari and Firefox empowers mere-mortal users to fix this eyesore with a custom stylesheet. Simply add the following to your userContent.css and restart the web [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=184&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://google.com">Google</a> has made its search input box bigger and its font size larger. Excuse me, they S-U-P-E-R-sized! it. It&#8217;s not a mistake, indeed <a href="http://googleblog.blogspot.com/2009/09/now-s-u-p-e-r-sized.html">Google actually seems proud</a> of it.</p>
<p>Fortunately, Safari and Firefox empowers mere-mortal users to fix this eyesore with a custom stylesheet. Simply add the following to your <code>userContent.css</code> and restart the web browser. Additional general information on <code>userContent.css</code>, and all the spiffy things you can do with it, is available from the links below.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
<br />
/* Google input text box */<br />
.lst {<br />
font-size:13px ! important;<br />
}<br />
/* Google search type-ahead drop down */<br />
.gac_m td {<br />
font-size:13px ! important;<br />
line-height:120% ! important;<br />
}<br />
/* Google Search/I&#39;m Feeling Lucky buttons */<br />
.lsb {<br />
font-size:11px ! important;<br />
height:auto ! important;<br />
}<br />
/* Google Search/I&#39;m Feeling Lucky buttons in type-ahead drop down*/<br />
.gac_sb {<br />
font-size:11px ! important;<br />
height:auto ! important;<br />
}</p>
</div>
<p>With the aforementioned CSS, the submit buttons will still appear in the type-ahead drop down menu. Add the following style to remove them all together.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
/* Turn off Google Search/I&#8217;m Feeling Lucky buttons in type-ahead drop down*/<br />
.gac_sb {<br />
display:none;<br />
}</p>
</div>
<p>Power to the people.</p>
<h4>Related Sites</h4>
<p><a href="http://www.mozilla.org/unix/customizing.html">Customizing Mozilla</a><br />
<a href="http://www.floppymoose.com/">Better Ad Blocking for Firefox, Mozilla, Camino, and Safari</a><br />
<a href="http://code.google.com/p/chromium/issues/detail?id=2393">Google Chrome Issue 2393:	Support user stylesheet</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crashingdaily.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crashingdaily.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crashingdaily.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crashingdaily.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=184&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2009/09/12/downsizing-googles-search-input-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/071fdc9a426bd695bda2b2061b5fcea9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Initing a new remote git repository with existing files</title>
		<link>http://crashingdaily.wordpress.com/2009/09/02/initing-a-new-remote-git-repository-with-existing-files/</link>
		<comments>http://crashingdaily.wordpress.com/2009/09/02/initing-a-new-remote-git-repository-with-existing-files/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 18:58:50 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=170</guid>
		<description><![CDATA[This how I took an existing directory of files on my desktop and put it into a new git repository on a remote server. I found a number of how-tos online but none worked for me &#8211; certainly this was because I&#8217;m such a newbie with git that I wasn&#8217;t sufficiently understanding what I was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=170&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This how I took an existing directory of files on my desktop and put it into a new  git repository on a remote server. I found a number of how-tos online but none worked for me &#8211; certainly this was because I&#8217;m such a newbie with git that I wasn&#8217;t sufficiently understanding what I was being told to do. The following works for me; clearly this isn&#8217;t the only way or the best way to accomplish the task. This is mostly a note to self.</p>
<p>Create an empty directory on the remote server to hold the repository</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
[11:44 20090902 crashing@server ~]<br />
$ mkdir -p /var/local/git/repos/CrashTesting</p>
</div>
<p>Intialize the empty repository</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
[11:44 20090902 crashing@server /var/local/git/repos/CrashTesting]<br />
$ git &#45;&#45;bare init<br />
Initialized empty Git repository in /var/local/git/repos/CrashTesting/</p>
</div>
<p>Now I have the necessary repository components.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
[11:44 20090902 crashing@server /var/local/git/repos/CrashTesting]<br />
$ ls<br />
branches  config  description  HEAD  hooks  info  objects  refs</p>
</div>
<p>On my desktop, in the existing directory of files, init the directory</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
[11:30 20090902 crashing@desktop ~/Desktop/testws]<br />
$ git init<br />
Initialized empty Git repository in /Users/crashing/Desktop/testws/.git/</p>
</div>
<p>This created a <code>.git</code> directory with git control files.</p>
<p>Next, I tell my local desktop repository about the remote repo. The remote repo is given the short name <code>origin</code>.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
[11:46 20090902 crashing@desktop ~/Desktop/testws]<br />
$ git remote add origin ssh://server.crashingdaily.com/var/local/git/repos/CrashTesting</p>
</div>
<p>Then, I place my local files under version control.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
[11:42 20090902 crashing@desktop ~/Desktop/testws]<br />
$ git add .</p>
</div>
<p>Now I can commit the local files to the local repository.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
[11:45 20090902 crashing@desktop ~/Desktop/testws]<br />
$ git commit -a -m &#39;initialize repo&#39;<br />
[master (root-commit) 7871087] initialize repo<br />
 23 files changed, 500 insertions(+), 0 deletions(-)<br />
 create mode 100755 build.properties<br />
 create mode 100755 build.xml</p>
</div>
<p>Finally, push the <code>master</code> branch to the remote repository named <code>origin</code>.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
[11:46 20090902 crashing@desktop ~/Desktop/testws]<br />
$ git push origin master<br />
Counting objects: 44, done.<br />
Delta compression using up to 2 threads.<br />
Compressing objects: 100% (31/31), done.<br />
Writing objects: 100% (44/44), 1.65 MiB, done.<br />
Total 44 (delta 1), reused 0 (delta 0)<br />
To ssh://server.crashingdaily.com/var/local/git/repos/CrashTesting<br />
 * [new branch]      master -&gt; master</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crashingdaily.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crashingdaily.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crashingdaily.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crashingdaily.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/170/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=170&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2009/09/02/initing-a-new-remote-git-repository-with-existing-files/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/071fdc9a426bd695bda2b2061b5fcea9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Compiling mysql on Fedora 8</title>
		<link>http://crashingdaily.wordpress.com/2009/08/22/compiling-mysql-on-fedora-8/</link>
		<comments>http://crashingdaily.wordpress.com/2009/08/22/compiling-mysql-on-fedora-8/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 04:09:30 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=152</guid>
		<description><![CDATA[I spent the evening compiling mysql 5.1.37 on Fedora 8. I had no trouble compiling on RHEL4 but on Fedora 8 I ran configure CFLAGS=&#34;-O3&#34; CXX=gcc CXXFLAGS=&#34;-O3 -felide-constructors \ -fno-exceptions -fno-rtti&#34; ./configure \ &#45;&#45;enable-assembler \ &#45;&#45;with-mysqld-ldflags=&#34;-all-static&#34; \ &#45;&#45;with-client-ldflags=&#34;-all-static&#34; followed by make and was getting compile errors /bin/sh ../libtool &#45;&#45;preserve-dup-deps &#45;&#45;tag=CXX &#45;&#45;mode=link gcc -O3 -felide-constructors -fno-exceptions [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=152&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I spent the evening compiling mysql 5.1.37 on Fedora 8. I had no trouble compiling on RHEL4 but on Fedora 8 I ran <code>configure</code></p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
CFLAGS=&quot;-O3&quot; CXX=gcc CXXFLAGS=&quot;-O3 -felide-constructors \<br />
       -fno-exceptions -fno-rtti&quot; ./configure \<br />
       &#45;&#45;enable-assembler \<br />
       &#45;&#45;with-mysqld-ldflags=&quot;-all-static&quot; \<br />
       &#45;&#45;with-client-ldflags=&quot;-all-static&quot;</p>
</div>
<p>followed by <code>make</code> and was getting compile errors</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
/bin/sh ../libtool &#45;&#45;preserve-dup-deps &#45;&#45;tag=CXX   &#45;&#45;mode=link gcc  -O3 -felide-constructors        -fno-exceptions -fno-rtti   -fno-implicit-templates -fno-exceptions -fno-rtti  -rdynamic  -o mysql mysql.o readline.o sql_string.o completion_hash.o ../cmd-line-utils/libedit/libedit.a -lncursesw -all-static -lpthread ../libmysql/libmysqlclient.la  -lcrypt -lnsl -lm   -lz <br />
libtool: link: gcc -O3 -felide-constructors -fno-exceptions -fno-rtti -fno-implicit-templates -fno-exceptions -fno-rtti -rdynamic -o mysql mysql.o readline.o sql_string.o completion_hash.o -static  ../cmd-line-utils/libedit/libedit.a -lncursesw -lpthread ../libmysql/.libs/libmysqlclient.a -lcrypt -lnsl -lm -lz<br />
/usr/bin/ld: cannot find -lncursesw<br />
collect2: ld returned 1 exit status<br />
make[1]: *** [mysql] Error 1<br />
make[1]: Leaving directory `/home/crashingdaily/mysql-5.1.37/client&#39;<br />
make: *** [all] Error 2</p>
</div>
<p>This was resolved by installing the static ncurses libs via the ncurses-static package.</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
$ sudo yum install ncurses-static</p>
</div>
<p>That then left me with the compile failure (showing only part of the error)</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
../cmd-line-utils/libedit/libedit.a(term.o): In function `term_echotc&#39;:<br />
term.c:(.text+0&#215;1557): undefined reference to `tputs&#39;<br />
term.c:(.text+0&#215;1580): undefined reference to `tgetstr&#39;<br />
term.c:(.text+0&#215;1676): undefined reference to `tgoto&#39;<br />
term.c:(.text+0x169a): undefined reference to `tputs&#39;<br />
term.c:(.text+0&#215;1761): undefined reference to `tgoto&#39;<br />
term.c:(.text+0&#215;1781): undefined reference to `tputs&#39;</p>
</div>
<p>This was resolved by adding <code>-ltinfo</code> to the client ldflags in the <code>configure</code> options</p>
<div style="font:1em 'Courier New', Courier, Fixed;text-align:left;">
CFLAGS=&quot;-O3&quot; CXX=gcc CXXFLAGS=&quot;-O3 -felide-constructors \<br />
       -fno-exceptions -fno-rtti&quot; ./configure \<br />
       &#45;&#45;enable-assembler \<br />
       &#45;&#45;with-mysqld-ldflags=&quot;-all-static&quot; \<br />
       &#45;&#45;with-client-ldflags=&quot;-all-static -ltinfo&quot;</p>
</div>
<p>Now <code>make</code> completed successfully. Lovely.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crashingdaily.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crashingdaily.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crashingdaily.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crashingdaily.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=152&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2009/08/22/compiling-mysql-on-fedora-8/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/071fdc9a426bd695bda2b2061b5fcea9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Running BLAST on Windows XP</title>
		<link>http://crashingdaily.wordpress.com/2009/08/04/running-blast-on-windows-xp/</link>
		<comments>http://crashingdaily.wordpress.com/2009/08/04/running-blast-on-windows-xp/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 20:44:39 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[blast]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=150</guid>
		<description><![CDATA[Today I installed NCBI BLAST on Windows XP SP2 but was unable to run the executables &#8211; I was confronted with &#8220;the system cannot execute the specified program&#8221;. The fix was to install Microsoft Visual C++ 2005 SP1 Redistributable Package<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=150&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I installed <a href="http://www.ncbi.nlm.nih.gov/BLAST/download.shtml">NCBI BLAST</a> on Windows XP SP2 but was unable to run the executables &#8211; I was confronted with &#8220;the system cannot execute the specified program&#8221;.</p>
<p>The fix was to install <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647&amp;displaylang=en"> Microsoft Visual C++ 2005 SP1 Redistributable Package</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crashingdaily.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crashingdaily.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crashingdaily.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crashingdaily.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/150/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=150&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2009/08/04/running-blast-on-windows-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/071fdc9a426bd695bda2b2061b5fcea9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Persisting ssh connections while changing networks</title>
		<link>http://crashingdaily.wordpress.com/2009/07/31/persisting-ssh-connections-while-changing-networks/</link>
		<comments>http://crashingdaily.wordpress.com/2009/07/31/persisting-ssh-connections-while-changing-networks/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 21:49:03 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[autossh]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[SOCKS]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshfs]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=148</guid>
		<description><![CDATA[I recently re-discovered autossh. I&#8217;ve been using it to persist mounted sshfs volumes but am only just now realizing it&#8217;s the scratch for some of my other itches. With it I can autossh -M50000 -t -D1080 -Nf crashingdaily.com to keep a seemingly persistent SOCKS proxy running. Or autossh -M50000 -t crashingdaily.com 'screen -aAdR autossh' to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=148&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently re-discovered <a href="http://www.harding.motd.ca/autossh/">autossh</a>. <a href="http://crashingdaily.wordpress.com/2007/02/10/mounting-filesystems-with-ssh-forwarding-across-a-gateway/">I&#8217;ve been using it</a> to persist mounted sshfs volumes but am only just now realizing it&#8217;s the scratch for some of my other itches.</p>
<p>With it I can<br />
<code><br />
autossh -M50000 -t -D1080 -Nf crashingdaily.com<br />
</code><br />
to keep a seemingly persistent SOCKS proxy running.</p>
<p>Or<br />
<code><br />
autossh -M50000 -t crashingdaily.com 'screen -aAdR autossh'<br />
</code><br />
to maintain an interactive session.</p>
<p>The value that I missed earlier is that the connections are maintained (re-established, actually) <em>even if I change networks</em> &#8211; which my laptop and I often do.</p>
<p><a href="http://jonsview.com/2009/03/01/how-to-automatic-ssh-tunnel">Jon&#8217;s View</a> has a nice posting on using autossh for SOCKS proxying.</p>
<p>And <a href="http://www.pjtrix.com/blawg/2007/01/07/autossh-and-screen-for-remote-login-peace-of-mind/">Dread Pirate PJ</a> has a good instruction for combining autossh and screen for persistent interactive sessions.</p>
<p>autossh is available for OS X via <a href="http://autossh.darwinports.com/">Darwin Ports</a> and <a href="http://pdb.finkproject.org/pdb/package.php/autossh">Fink</a> and for Linux as source code or as binary packages from repositories for most modern Linux distributions.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/crashingdaily.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/crashingdaily.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/crashingdaily.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/crashingdaily.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/148/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&amp;blog=744507&amp;post=148&amp;subd=crashingdaily&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2009/07/31/persisting-ssh-connections-while-changing-networks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/071fdc9a426bd695bda2b2061b5fcea9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
	</channel>
</rss>
