<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>asyd's blog</title>
	<atom:link href="http://blog.asyd.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.asyd.net</link>
	<description>unix forever, for everyone. Not convinced, try Mac OS X!</description>
	<lastBuildDate>Tue, 09 Mar 2010 17:43:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>varnish: Send a client always on the same backend</title>
		<link>http://blog.asyd.net/2010/03/varnish-send-a-client-always-on-the-same-backend/</link>
		<comments>http://blog.asyd.net/2010/03/varnish-send-a-client-always-on-the-same-backend/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 17:43:23 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[varnish]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=408</guid>
		<description><![CDATA[I&#8217;m now very close to migrate from akamai to varnish at work. However, since we doesn&#8217;t have session replications on the application server, I was required to send a client always on the same backend, even if the user is not authentified. In a first try, we thought about use a cookie, valued by the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m now very close to migrate from akamai to varnish at work. However, since we doesn&#8217;t have session replications on the application server, I was required to send a client always on the same backend, even if the user is not authentified. In a first try, we thought about use a cookie, valued by the name of the server, and write some VCL to define the backend based on the cookie value.</p>
<p>However, thanks to the varnish developper (through the channel) <a href="http://people.freebsd.org/~phk/">phk</a> pointed me they actually working on a director method to implements this behavior. While this feature is not yet available on a release, it&#8217;s present in the trunk (I&#8217;m using r4602).</p>
<p>Here the source code:<br />
<code><br />
   if (vs->criteria == c_client) {<br />
      /*<br />
       * Hash the client IP# ascii representation, rather than<br />
       * rely on the raw IP# being a good hash distributor, since<br />
       * experience shows this not to be the case.<br />
       * We do not hash the port number, to make everybody behind<br />
       * a given NAT gateway fetch from the same backend.<br />
       */<br />
      SHA256_Init(&#038;ctx);<br />
      AN(sp->addr);<br />
      SHA256_Update(&#038;ctx, sp->addr, strlen(sp->addr));<br />
      SHA256_Final(sign, &#038;ctx);<br />
      hp = sign;<br />
   }<br />
<code></p>
<p>Here how to define your director:</p>
<p><code></p>
<p>director rtl client {<br />
        { .backend = www1rtl; .weight = 1; }<br />
        { .backend = www2rtl; .weight = 1; }<br />
}<br />
<code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2010/03/varnish-send-a-client-always-on-the-same-backend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenSSO strict cookie value</title>
		<link>http://blog.asyd.net/2010/02/opensso-strict-cookie-value/</link>
		<comments>http://blog.asyd.net/2010/02/opensso-strict-cookie-value/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 22:36:43 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[opensso]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=406</guid>
		<description><![CDATA[At my work, we&#8217;re currently working on a new J2EE platform to host our webapp applications, based on Tomcat 6 (6.0.24 to be precise). After deployed few fully public webapps without any issue, we start to deploy some other webapps with an authenticated part. The authentication is based on OpenSSO, using REST APIs. The cookie [...]]]></description>
			<content:encoded><![CDATA[<p>At my work, we&#8217;re currently working on a new J2EE platform to host our webapp applications, based on Tomcat 6 (6.0.24 to be precise). After deployed few fully public webapps without any issue, we start to deploy some other webapps with an authenticated part. The authentication is based on OpenSSO, using REST APIs. The cookie is created to OpenSSO, then set (client side) by one of our own webapplication. This cookie is validate using <em>isValidToken</em> REST API on every application the user goes. However, we&#8217;re not able to get authentication working on the preproduction environment, while it working perfectly on the dev environment. After some investigations with the developpers, we notice the OpenSSO&#8217;s cookie value was truncated.</p>
<p>After reading this <a href="http://osdir.com/ml/users-tomcat.apache.org/2009-09/msg00304.html">post</a> on the tomcat&#8217;s user mailing list, we start to configure tomcat. Few hours after, I was thinking about change the tomcat configuration is only a workaround, without fixing the original problem. Thanks to the OpenSSO&#8217;s IRC channel, someone (Allan Foster) pointed me to <em>com.iplanet.am.cookie.c66Encode</em> configuration variable. You can enable it in the console, Configuration, servers and sites, click on default paramaters, and then advanced tab. Set the value to true, and voila! Everything is now working good!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2010/02/opensso-strict-cookie-value/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using it&#8217;s all text on Mac OS X</title>
		<link>http://blog.asyd.net/2009/09/using-its-all-text-on-mac-os-x/</link>
		<comments>http://blog.asyd.net/2009/09/using-its-all-text-on-mac-os-x/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 12:13:11 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=386</guid>
		<description><![CDATA[Introduction
As a system administrator, I dislike to edit text in Firefox (or any other webbrowser), for example to write a new post on this blog, or edit some contents in drupal. This morning, I was looking for a Firefox extension allowing to use an external editor (in my case vim, for sure) to edit contents [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>As a system administrator, I dislike to edit text in Firefox (or any other webbrowser), for example to write a new post on this blog, or edit some contents in drupal. This morning, I was looking for a Firefox extension allowing to use an external editor (in my case vim, for sure) to edit contents of textarea. This extension is pretty simple, you only need to configure which command to run to edit the file.</p>
<p>However there is a big trouble with Mac OS X, indeed, I was not able to find a command line to open a new terminal tab and lauching vim with the file to edit. Indeed, something like:</p>
<p><code><br />
% open -a iTerm /usr/bin/vim<br />
</code></p>
<p>is working fine, however, it&#8217;s not possible to do something like:</p>
<p><code><br />
% open -a iTerm /usr/bin/vim -- /tmp/file_to_edit<br />
</code></p>
<p>That&#8217;s very inconvenient, isn&#8217;t it! So, the only way I found to achieve that is to write an AppleScript to open a new iTerm, using vim profile (which runs vim as startup), and then open the file by sending text to vim from the AppleScript. But, once gain, I run out of luck. Indeed, the filename computed by <em>it&#8217;s all text</em> contains spaces, and vim expect escaped spaces. So, I look for a way to replace string in AppleScript, but&#8230; guess what? it&#8217;s seem very difficult (because I need to create another file..). So the only simple solution I found is to create a shell script that create a symbolic link in /tmp to the file to edit.. Here we go!</p>
<h3>Configuration</h2>
<p><b>iTerm</b><br />
Open your bookmarks manager, and create a new bookmark like<br />
that:</p>
<p><img class="aligncenter size-full wp-image-388" title="Image 8" src="http://blog.asyd.net/wp-content/uploads/2009/09/Image-8.png" alt="Image 8" width="331" height="333" /></p>
<p>Open a terminal, create the directory ~/bin, create the file<br />
<em>editfile</em> with the following contents (replace bbonfils<br />
with your login name):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/zsh</span>
&nbsp;
<span style="color: #007800;">extension</span>=<span style="color: #800000;">${1:e}</span>
<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">link</span></span>=<span style="color: #ff0000;">&quot;/tmp/firefox.&quot;</span><span style="color: #007800;">$$</span><span style="color: #ff0000;">&quot;.<span style="color: #007800;">${extension}</span>&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #007800;">$link</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>bbonfils<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>editfile.scpt <span style="color: #007800;">$link</span></pre></div></div>

<p>Create a new file named <em>editfile.scpt</em> with the following contents:</p>
<pre>
#!/usr/bin/osascript

on run argv
        tell application "iTerm"
                activate
                make new terminal
                tell the last terminal
                        launch session "vim"
                        tell the last session
                                write text "^[[:e " &#038; item 1 of argv
                        end tell
                end tell
        end tell
end run
</pre>
<p>Ensure both are executable <em>chmod +x</em>, and then configure <em>it&#8217;s all text</em><br />
to use the first script to open file (<em>/User/bbonfils/bin/editfile</em>), and<br />
now it should work!</p>
<p><b>The last word</b></p>
<p>Note I can&#8217;t remove the link in the script, since all of them are executed in background,<br />
if you add a rm in the think, the link will be removed few seconds after you start vim,<br />
so your textarea contents won&#8217;t be updated.</p>
<p>And yes, I know, it&#8217;s ugly, if you have a better way to achieve that, please post it in comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/09/using-its-all-text-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Networking, QoS and OpenSolaris</title>
		<link>http://blog.asyd.net/2009/09/networking-qos-with-opensolaris/</link>
		<comments>http://blog.asyd.net/2009/09/networking-qos-with-opensolaris/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 15:37:24 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[OpenSolaris]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=381</guid>
		<description><![CDATA[OpenSolaris 200906 comes with some very interesting features about networking management. One is flowadm, allowing to manage network streams in a very simple and elegant way. For example, the next commands allow me to restrict the bandwith for my HTTP server.


flowadm add-flow -l bge0 -a transport=tcp,local_port=80 httpflow
flowadm set-flowprop -p maxbw=8 httpflow


wget -O /dev/null http://eva0/empty
2009-09-12 17:32:07 [...]]]></description>
			<content:encoded><![CDATA[<p>OpenSolaris 200906 comes with some very interesting features about networking management. One is flowadm, allowing to manage network streams in a very simple and elegant way. For example, the next commands allow me to restrict the bandwith for my HTTP server.</p>
<p>
<code><br />
flowadm add-flow -l bge0 -a transport=tcp,local_port=80 httpflow<br />
flowadm set-flowprop -p maxbw=8 httpflow<br />
</code></p>
<p><code><br />
wget -O /dev/null http://eva0/empty<br />
2009-09-12 17:32:07 (<strong>971 KB/s</strong>) - « /dev/null »<br />
</code>
</p>
<p>As you can see it&#8217;s very simple! The following properties can be applied to a stream:</p>
<ul>
<li>maxbw: Sets  the  full  duplex  bandwidth  for  the  flow.</li>
<li>priority: Sets the relative priority for the flow.</li>
<li>cpus: Allocate packets of the flow to a processor set, for systems that have multiple<br />
processor sets. (this property is not yet available, maybe in 200911?)</li>
</ul>
<p>References:</p>
<li><a href="http://opensolaris.org/os/project/crossbow/Docs/vnicconfig.pdf">Configuring Virtual Networks</a></li>
<li><a href="http://opensolaris.org/os/project/crossbow/Docs/vnicresource.pdf">Configuring Resource Management on Data Links</a></li>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/09/networking-qos-with-opensolaris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pound, a little example that redirect / to /opensso for a given virtual host</title>
		<link>http://blog.asyd.net/2009/08/pound-a-little-example-that-redirect-to-opensso-for-a-given-virtual-host/</link>
		<comments>http://blog.asyd.net/2009/08/pound-a-little-example-that-redirect-to-opensso-for-a-given-virtual-host/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 15:33:45 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=377</guid>
		<description><![CDATA[It&#8217;s the first time I&#8217;m using pound (a http reverse proxy), and I was a little disappointed about its configuration. My use case is very simple, for a given virtual host (idp.asyd.net in my case) I want to redirect from / to /opensso. Since pound seems not very well documented, here my configuration to achieve [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s the first time I&#8217;m using pound (a http reverse proxy), and I was a little disappointed about its configuration. My use case is very simple, for a given virtual host (idp.asyd.net in my case) I want to redirect from / to /opensso. Since pound seems not very well documented, here my configuration to achieve that:</p>
<pre>
ListenHTTP
   Address  0.0.0.0
   Port  80
   Service
      HeadRequire "Host: idp.asyd.net"
      URL "^/$"
      Redirect "http://idp.asyd.net/opensso"
   End
   Service
      HeadRequire "Host: idp.asyd.net"
      Backend
         Address 127.0.0.1
         Port 8080
      End
   End
End
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/08/pound-a-little-example-that-redirect-to-opensso-for-a-given-virtual-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenSSO, OpenID and Yubikey, the perfect personal SSO: cheap, and secure</title>
		<link>http://blog.asyd.net/2009/08/opensso-openid-and-yubikey-the-perfect-personal-sso-cheap-and-secure/</link>
		<comments>http://blog.asyd.net/2009/08/opensso-openid-and-yubikey-the-perfect-personal-sso-cheap-and-secure/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 08:23:51 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[IAM]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[opensso]]></category>
		<category><![CDATA[yubikey]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=360</guid>
		<description><![CDATA[As a new owner of an yubikey, I was looking the best way to integrate it with the web application I already use. While there is already an available OpenID provider which support Yubikey authentication, I prefer to manage my own system, using OpenSSO for sure 

First, let me introduce the yubikey. This USB key [...]]]></description>
			<content:encoded><![CDATA[<p>As a new owner of an yubikey, I was looking the best way to integrate it with the web application I already use. While there is already an available OpenID provider which support Yubikey authentication, I prefer to manage my own system, using OpenSSO for sure <img src='http://blog.asyd.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<img src="http://blog.asyd.net/wp-content/uploads/2009/08/Image-2.png" alt="Yubikey" title="Yubikey" width="110" height="78" class="alignright size-full wp-image-375" /><br />
First, let me introduce the yubikey. This USB key act as an OTP (One Time Password) device, each time you press the button, the key compute a new password. This pasword must be verify, in the case of Yubikey, this is done by query a Webservices on a yubico (the company) server. Yubikey offers a lot of advantages than others classical OTP devices, including:</p>
<ul>
<li>The yubikey is see as an USB keyboard (class HID), <b>no driver required!</b></li>
<li>No battery, more longlife than anothers devices</li>
<li>Very cheap, around 20 euros (ordered by 10, from France), transport and taxes included</li>
</ul>
<p>So, why choose OpenSSO? For few years know, OpenSSO provides an extension to act as an OpenID provider, and an authentication class is available for the Yubikey. </p>
<p><img src="http://blog.asyd.net/wp-content/uploads/2009/08/OpenSSO-OpenID-Yubikey.png" alt="OpenSSO OpenID Yubikey" title="OpenSSO OpenID Yubikey" width="515" height="394" class="aligncenter size-full wp-image-370" /></p>
<p>References:</p>
<ul>
<li><a href="http://blogs.sun.com/steffo/entry/opensso_with_openid_on_the">Build the OpenSSO extension for OpenID</a></li>
<li><a href="https://opensso.dev.java.net/source/browse/opensso/extensions/authnyubikey/README.txt?rev=1.3&#038;view=markup">Build the Yubikey authentication class</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/08/opensso-openid-and-yubikey-the-perfect-personal-sso-cheap-and-secure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LDAP: A quick way to get the number of subentries</title>
		<link>http://blog.asyd.net/2009/07/ldap-a-quick-way-to-get-the-number-of-subentries/</link>
		<comments>http://blog.asyd.net/2009/07/ldap-a-quick-way-to-get-the-number-of-subentries/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 08:27:04 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=352</guid>
		<description><![CDATA[I actually manage a LDAP directory with a lot of entries (almost 1,5 millions entries in the same OU). In order to check the replication state, I was looking for a way to count the number of entries in this OU. Thanks to Ludovic Poitou (once again), this information is available via an hidden attribute [...]]]></description>
			<content:encoded><![CDATA[<p>I actually manage a LDAP directory with a lot of entries (almost 1,5 millions entries in the same OU). In order to check the replication state, I was looking for a way to count the number of entries in this OU. Thanks to Ludovic Poitou (once again), this information is available via an hidden attribute in the OU.</p>
<p><code><br />
% ldapsearch -Wxh ldap1 -D "cn=Directory Manager" -b 'ou=people,ou=ssousers,dc=asyd,dc=net' -s base '(objectClass=*)' 'numsubordinates'<br />
[..]<br />
dn: ou=people,ou=ssousers,dc=asyd,dc=net<br />
<b>numsubordinates: 1386931</b><br />
</code></p>
<p>Depends on the directory server, it&#8217;s also possible to get the number of entries for a given backend (the following code was tested for Sun Directory Server 5.2):</p>
<p><code><br />
% ldapsearch -Wxh ldap1 -D 'cn=Directory Manager' -b 'cn=monitor' -s base '(objectclass=*)' 'backendmonitordn'<br />
[..]<br />
dn: cn=monitor<br />
backendmonitordn: cn=monitor,cn=userRoot,cn=ldbm database,cn=plugins,cn=config<br />
backendmonitordn: cn=monitor,cn=ssoUsers,cn=ldbm database,cn=plugins,cn=config<br />
backendmonitordn: cn=monitor,cn=NetscapeRoot,cn=ldbm database,cn=plugins,cn=config<br />
</code></p>
<p><code><br />
% ldapsearch -Wxh lynx -D 'cn=Directory Manager' -b 'cn=monitor,cn=ssoUsers,cn=ldbm database,cn=plugins,cn=config' -s base '(objectclass=*)' 'ldapentrycount'<br />
[..]<br />
dn: cn=monitor, cn=ssoUsers, cn=ldbm database, cn=plugins, cn=config<br />
<b>ldapentrycount: 1408974</b><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/07/ldap-a-quick-way-to-get-the-number-of-subentries/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to convert a PKCS#12 to JKS</title>
		<link>http://blog.asyd.net/2009/07/how-to-convert-a-pkcs12-to-jks/</link>
		<comments>http://blog.asyd.net/2009/07/how-to-convert-a-pkcs12-to-jks/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 13:20:28 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=347</guid>
		<description><![CDATA[Most of system administrators use OpenSSL (which is not a good idea, but it&#8217;s an another story) to manage their PKI. While OpenSSL is good to create/convert X509 certificates from PEM/DER to PKCS#12 (and vice versa, for sure) it doesn&#8217;t understand the JKS (Java KeyStore) format. JKS are used in Java world, for example Glassfish [...]]]></description>
			<content:encoded><![CDATA[<p>Most of system administrators use OpenSSL (which is not a good idea, but it&#8217;s an another story) to manage their PKI. While OpenSSL is good to create/convert X509 certificates from PEM/DER to PKCS#12 (and vice versa, for sure) it doesn&#8217;t understand the JKS (Java KeyStore) format. JKS are used in Java world, for example Glassfish application server, OpenDS and so more. In this post, I&#8217;ll explain how to convert a PKCS#12 to a JKS using portecle. <a href="http://portecle.sf.net">portecle</a> is a small, but very useful application (written in Java) to manipulate keystores.</p>
<ol>
<li>Download portecle, extract it, and lauch it using <code>java -jar portecle.jar</code> (note that Java 6 seems required for version 1.4.x)</li>
<li>Open your PKCS#12 file, provide the password</li>
<li>Click on <em>Tools/Change KeyStore Type/JKS</em> menu</li>
<li>If you don&#8217;t want to use the default password (which is password), click on the menu keystore password</li>
<li>Save it, that&#8217;s all folks!</li>
</ol>
<p>
You can know list the contents of your JKS using keytool:</p>
<p><code><br />
% keytool -list -v -keystore <em>yourkeystore.jks</em><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/07/how-to-convert-a-pkcs12-to-jks/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Quick (and dirty?) howto: Solaris IPMP with VLAN tagging</title>
		<link>http://blog.asyd.net/2009/06/quick-and-dirty-howto-solaris-ipmp-with-vlan-tagging/</link>
		<comments>http://blog.asyd.net/2009/06/quick-and-dirty-howto-solaris-ipmp-with-vlan-tagging/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 15:06:20 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=344</guid>
		<description><![CDATA[Here the following commands I use to create a IPMP (IP Multipathing) groups (master/slave):

#!/bin/sh
# Plumb physical interfaces
ifconfig nge1 plumb
ifconfig nge2 plumb
# Plumb 802.1q interfaces
ifconfig nge544001 plumb
ifconfig nge544002 plumb
# Configure interfaces
ifconfig nge544001 group hosts deprecated -failover up
ifconfig nge544002 group hosts deprecated -failover standby up
# Add logicial interface
ifconfig nge544001 addif 10.16.244.60 netmask 255.255.252.0 up

You can also tweak [...]]]></description>
			<content:encoded><![CDATA[<p>Here the following commands I use to create a IPMP (IP Multipathing) groups (master/slave):</p>
<p><code><br />
#!/bin/sh</p>
<p># Plumb physical interfaces<br />
ifconfig nge1 plumb<br />
ifconfig nge2 plumb</p>
<p># Plumb 802.1q interfaces<br />
ifconfig nge544001 plumb<br />
ifconfig nge544002 plumb</p>
<p># Configure interfaces<br />
ifconfig nge544001 group hosts deprecated -failover up<br />
ifconfig nge544002 group hosts deprecated -failover standby up</p>
<p># Add logicial interface<br />
ifconfig nge544001 addif 10.16.244.60 netmask 255.255.252.0 up<br />
</code></p>
<p>You can also tweak the multipath daemon by editing <em>/etc/default/mpathd</em> to decrease the value to detect a NIC failure.</p>
<ul>
<li><a href="http://docs.sun.com/app/docs/doc/816-4554/ipmptm-1?l=en&#038;a=view">Solaris 10 IPMP Documentation reference</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/06/quick-and-dirty-howto-solaris-ipmp-with-vlan-tagging/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Writing a daemon in groovy</title>
		<link>http://blog.asyd.net/2009/06/writing-a-daemon-in-groovy/</link>
		<comments>http://blog.asyd.net/2009/06/writing-a-daemon-in-groovy/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 08:29:38 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=341</guid>
		<description><![CDATA[I actually need to write a little daemon based on the JVM (I&#8217;ll explain why in a future post). As the groovy fan I am, I was looking for a ready to use receipt, this one is interesting but show only how to write, not to read   After getting some help from Guillaume [...]]]></description>
			<content:encoded><![CDATA[<p>I actually need to write a little daemon based on the JVM (I&#8217;ll explain why in a future post). As the groovy fan I am, I was looking for a ready to use receipt, <a href="http://pleac.sourceforge.net/pleac_groovy/sockets.html">this one</a> is interesting but show only how to write, not to read <img src='http://blog.asyd.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  After getting some help from <a href="http://glaforge.free.fr/weblog/">Guillaume</a> here a working sample:</p>

<div class="wp_syntax"><div class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">java.net.ServerSocket</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">net.asyd.nagios.Hello</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> listenPort <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">4242</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> server <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #aaaadd; font-weight: bold;">ServerSocket</span><span style="color: #66cc66;">&#40;</span>listenPort<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    server.<span style="color: #006600;">accept</span> <span style="color: #66cc66;">&#123;</span> socket <span style="color: #66cc66;">-&gt;</span>
        <span style="color: #993399;">println</span> <span style="color: #ff0000;">&quot;new connexion&quot;</span>
&nbsp;
        socket.<span style="color: #FFCC33;">withStreams</span> <span style="color: #66cc66;">&#123;</span> input, output <span style="color: #66cc66;">-&gt;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">def</span> reader <span style="color: #66cc66;">=</span> input.<span style="color: #006600;">newReader</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">def</span> buffer <span style="color: #66cc66;">=</span> reader.<span style="color: #006600;">readLine</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> 
&nbsp;
            output <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #ff0000;">&quot;Hello world &quot;</span> <span style="color: #66cc66;">+</span> buffer <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>As you can see it&#8217;s very simple, thanks to groovy, once again. A thread will be create for each client.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/06/writing-a-daemon-in-groovy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
