<?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>cyberz.org &#187; Unix</title>
	<atom:link href="http://www.cyberz.org/blog/category/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cyberz.org/blog</link>
	<description>Andrea Leofreddi's homepage</description>
	<lastBuildDate>Thu, 24 Nov 2011 20:11:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Solaris 11 Express: bind an iSCSI target to an IP</title>
		<link>http://www.cyberz.org/blog/2011/01/30/solaris-11-express-bind-iscsi-to-ip/</link>
		<comments>http://www.cyberz.org/blog/2011/01/30/solaris-11-express-bind-iscsi-to-ip/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 16:41:04 +0000</pubDate>
		<dc:creator>andrea</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://www.cyberz.org/blog/?p=247</guid>
		<description><![CDATA[Lately I wanted to bring]]></description>
			<content:encoded><![CDATA[<p>Lately I wanted to bring the advantages of ZFS (on Solaris 11 Express) to a Linux box using iSCSI. After following the Oracle guide, I&#8217;ve noticed an unexpected behaviour when discovering the iSCSI targets (from a CentOS host):</p>
<pre>[root@zimbra ~]#  iscsiadm -m discovery -t sendtargets -p 192.168.64.10
192.168.64.10:3260,1 iqn.2011-01.org.cyberz:storage:mail
<strong>192.168.64.106:3260,1 iqn.2011-01.org.cyberz:storage:mail
...</strong>
[root@zimbra ~]#</pre>
<p>That is, the iSCSI target was bound to all the avaible interfaces (including ip addresses of zones).</p>
<p><span id="more-247"></span></p>
<p>To avoid this behavior it&#8217;s enough to create a &#8220;target portal group&#8221;, assign a specific interface to it and then bind targets to the tpg. Follows an example:</p>
<pre>root@scytale:~# itadm create-tpg tpg-scytale 192.168.64.10:3260
root@scytale:~# itadm list-target
TARGET NAME                                                  STATE    SESSIONS
iqn.2011-01.org.cyberz:storage:mail                          online   1
root@scytale:~# itadm modify-target -t tpg-scytale iqn.2011-01.org.cyberz:storage:mail
Target iqn.2011-01.org.cyberz:storage:mail successfully modified
root@scytale:~#</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberz.org/blog/2011/01/30/solaris-11-express-bind-iscsi-to-ip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenWRT on TP-Link TL-WR743ND</title>
		<link>http://www.cyberz.org/blog/2011/01/02/openwrt-on-tp-link-tl-wr743nd/</link>
		<comments>http://www.cyberz.org/blog/2011/01/02/openwrt-on-tp-link-tl-wr743nd/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 00:19:59 +0000</pubDate>
		<dc:creator>andrea</dc:creator>
				<category><![CDATA[All/News]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.cyberz.org/blog/?p=234</guid>
		<description><![CDATA[TP-Link TL-WR743ND is the PoE]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cyberz.org/blog/wp-content/uploads/2011/01/TL-WR743ND.jpg"><img class="alignleft size-thumbnail wp-image-243" title="TP-Link TL-WR743ND" src="http://www.cyberz.org/blog/wp-content/uploads/2011/01/TL-WR743ND-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>TP-Link TL-WR743ND is the PoE brother of the common TL-WR741ND wireless router which is supported flawlessly by <a href="http://www.openwrt.org">openwrt</a>. Since I&#8217;ve got one WR743ND, I wanted to convert it into a useful OpenWRT router but I figured out that, unfortunately, the WR743ND is not supported by OpenWRT (at least officially). Given the similarity to the supported WR741ND, I&#8217;ve decided to hack it a bit to get it work with OpenWRT.</p>
<p><span id="more-234"></span>The first step is to get a working serial console. The procedure is similar to the one shown in the <a href="http://wiki.openwrt.org/toh/tp-link/tl-wr741nd">openwrt&#8217;s page dedicated to the WR741ND</a> with the exception that (at least on the WR743ND which I got) the capacitor C496 and the resistor R610 were missing, so it was necessary to:</p>
<ol>
<li>Shortcut the C496 pins</li>
<li>Solder a 2.7K resistor in place of R610 (I think short circuit would work as well &#8212; untested)</li>
</ol>
<p>Follows a photo (low resolution, sorry) indicating where the soldering should be made:</p>
<p><a href="http://www.cyberz.org/blog/wp-content/uploads/2011/01/TP743ND_Console.jpg"><img class="aligncenter size-medium wp-image-241" title="TP743ND Serial Console" src="http://www.cyberz.org/blog/wp-content/uploads/2011/01/TP743ND_Console-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Be aware that this hack requires some attention given the tiny dimension of SMD components.</p>
<p>Next step is to connect to the console via a serial cable and level converter. In my case I&#8217;ve assembled some circuitry with a MAX232 which was externally powered with 5v. Since the TX pin of the router is providing a positive level at 3.3v there is no issue with the MAX232 which is able to recognize the logic level, on contrary with the RX line we should care to not send +5v to the router which is using 3.3v logic levels (it may burn the router?). To accomplish that I&#8217;ve used a zener diode shunt to clamp the signal at 3.3v.</p>
<p>The whole thing was connected via a Profilic 232-to-USB adapter.</p>
<p><a href="http://www.cyberz.org/blog/wp-content/uploads/2011/01/01012011026.jpg"><img class="aligncenter size-medium wp-image-242" title="MAX232" src="http://www.cyberz.org/blog/wp-content/uploads/2011/01/01012011026-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>To test  the serial link connection, just boot the router and blind type <em>tpl</em> when the autoboot prompt is shown. The U-Boot loader will show a &gt; prompt:</p>
<pre>U-Boot 1.1.4 (Jan 18 2010 - 14:26:54)

AP91 (ar7240) U-boot
DRAM:
sri
#### TAP VALUE 1 = a, 2 = b
32 MB
id read 0x100000ff
flash size 4194304, sector count = 64
Flash:  4 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ag7240_enet_initialize...
No valid address in Flash. Using fixed address
: cfg1 0xf cfg2 0x7014
eth0: 00:03:7f:09:0b:ad
eth0 up
No valid address in Flash. Using fixed address
: cfg1 0xf cfg2 0x7214
eth1: 00:03:7f:09:0b:ad
ATHRS26: resetting s26
ATHRS26: s26 reset done
eth1 up
eth0, eth1
Autobooting in 1 seconds
<strong>tlp</strong>
ar7240&gt;</pre>
<p>Now that the console is working it&#8217;s time to proceed with the flashing. Download <em>openwrt-ar71xx-tl-wr741nd-v1-squashfs-factory.bin</em> from the OpenWRT website and have it published by a tftp server in your local network. Then connect the router to such a network and issue the following commands (here the tftp server is 192.168.1.45):</p>
<pre>ar7240&gt; <strong>setenv ipaddr 192.168.1.60</strong>
ar7240&gt; <strong>setenv serverip 192.168.1.45</strong>
ar7240&gt; <strong>printenv</strong>
bootargs=console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),2752k(rootfs),896k(uImage),64k(NVRAM),64k(ART)
bootcmd=bootm 0x9f020000
bootdelay=1
baudrate=115200
ethaddr=0x00:0xaa:0xbb:0xcc:0xdd:0xee
stdin=serial
stdout=serial
stderr=serial
ethact=eth0
serverip=192.168.1.45
ipaddr=192.168.1.60

Environment size: 357/65532 bytes
ar7240&gt; <strong>tftpboot 0x80000000 openwrt-ar71xx-tl-wr741nd-v1-squashfs-factory.bin</strong>
dup 1 speed 1000
Using eth1 device
TFTP from server 192.168.1.45; our IP address is 192.168.1.60
Filename 'openwrt-ar71xx-tl-wr741nd-v1-squashfs-factory.bin'.
Load address: 0x80000000
Loading: #################################################################
 #################################################################
 #################################################################
 #################################################################
 #################################################################
 #################################################################
 #################################################################
 #################################################################
 #################################################################
 #################################################################
 #################################################################
 ######################################################
done
Bytes transferred = 3932160 (3c0000 hex)
ar7240&gt; <strong>erase 0x9f020000 +0x3c0000</strong>

First 0x2 last 0x3d sector size 0x10000
 61
Erased 60 sectors
ar7240&gt; <strong>cp.b 0x80000000 0x9f020000 0x3c0000</strong>
Copy to Flash... write addr: 9f020000
done
ar7240&gt; <strong>bootm 0x9f020000</strong>
## Booting image at 9f020000 ...
 Uncompressing Kernel Image ... OK

Starting kernel ...

Linux version 2.6.32.10 (openwrt@wrt1.marcant.net) (gcc version 4.3.3 (GCC) ) #20 Tue Apr 6 15:01:26 CEST 2010
bootconsole [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7240 rev 2, CPU:350.000 MHz, AHB:175.000 MHz, DDR:350.000 MHz
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
 Normal   0x00000000 -&gt; 0x00002000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
 0: 0x00000000 -&gt; 0x00002000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200 board=TL-WR741ND
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)</pre>
<p>Enjoy your new OpenWRT router!</p>
<p><em>NOTE</em>: in case you would like to use the WT743ND as an access point and not as a router, OpenWRT documentation suggest to simply ignore the WAN interface and connect the AP via a LAN port. Unfortunately If you&#8217;re willing to use PoE the WAN port is the only port capable to receive power! In my case I successfully connected the PoE pins from the WAN to the first LAN port, having the router powered-on via PoE on the first LAN port (thus acting as an access point).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberz.org/blog/2011/01/02/openwrt-on-tp-link-tl-wr743nd/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Solaris 10 x64 and Symbios SYM22801 (and other LSI SCSI controllers)</title>
		<link>http://www.cyberz.org/blog/2010/07/24/solaris-10-x64-and-symbios-sym22801/</link>
		<comments>http://www.cyberz.org/blog/2010/07/24/solaris-10-x64-and-symbios-sym22801/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 19:33:13 +0000</pubDate>
		<dc:creator>andrea</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.cyberz.org/blog/?p=194</guid>
		<description><![CDATA[Today I&#8217;ve discovered that the]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve discovered that the very common Symbios 22801 (aka Symbios Logic 53c875) SCSI controller is (unexpectedly) failing to be recognized by Solaris 10 on x64 hardware. In fact I was in the middle of the upgrade of my home backup infrastructure from an old DLT 20/40 to a newer DLT 40/80 to be connected to a Symbios card inside my Solaris box. Unfortunately after the reboot, the new card was unseen.</p>
<p><a href="http://www.cyberz.org/blog/wp-content/uploads/2010/07/SYM22801.jpg"><img class="aligncenter size-medium wp-image-195" title="SYM22801" src="http://www.cyberz.org/blog/wp-content/uploads/2010/07/SYM22801-300x277.jpg" alt="" width="300" height="277" /></a><span id="more-194"></span>After some research on google I was able to find out that:</p>
<ol>
<li>The <strong>ncrs</strong> driver is not shipped with x64 kernel (yet it is for 32 bit version)</li>
<li>The default alias for PCI device 1000:000f (the Sym22801 card) is <strong>ncrs</strong></li>
<li>Another driver which supports the 53c875 controller, called <strong>glm</strong>, is shipped with Solaris 10 and available for both 32 and 64bit versions</li>
</ol>
<p>So, it is enough to point the 1000:000f alias to the glm driver, instead of ncrs, to have the controller recognized. That can be easily accomplished changing the following entry in /etc/driver_aliases:</p>
<p><code>ncrs "pci1000,f"</code><br />
to<br />
<code>glm "pci1000,f"</code></p>
<p>After that it is enough to reboot Solaris with device reconfiguration turned on (<code>touch /reconfigure</code> before rebooting) and check that the controller is recognized (<code>prtconf</code> or <code>cfgadm -al</code> can be used for that).</p>
<p><b>Update</b>: I had again the same issue with an LSI Logic 53C1010-66 Ultra160 SCSI dual HBA. In this case the missing driver is symhisl, whereas the line to tweak in /etc/driver_aliases is:</p>
<p><code>symhisl "pci1000,21"</code><br />
to<br />
<code>glm "pci1000,21"</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberz.org/blog/2010/07/24/solaris-10-x64-and-symbios-sym22801/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bacula mail changer script (aka poor man&#8217;s autoloader)</title>
		<link>http://www.cyberz.org/blog/2009/06/08/bacula-mail-changer-script-aka-poor-mans-autoloader/</link>
		<comments>http://www.cyberz.org/blog/2009/06/08/bacula-mail-changer-script-aka-poor-mans-autoloader/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 22:16:32 +0000</pubDate>
		<dc:creator>andrea</dc:creator>
				<category><![CDATA[All/News]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Bacula]]></category>

		<guid isPermaLink="false">http://www.cyberz.org/blog/?p=24</guid>
		<description><![CDATA[I enjoy Bacula for automated]]></description>
			<content:encoded><![CDATA[<p>I enjoy Bacula for automated home backups on DLT and DDS tape drives. Being used at home there&#8217;s no &#8211; obviously &#8211; big-dollar-company-manager to ask for an autoloader; and when the time of a tape change comes bacula lacks a simple way to request a manual tape change and just hangs up. So I managed to build a fake autoloader shell script, which, using emails, would emulate a real autoloader. This script, which I baptised <em>mail-changer</em>, features:</p>
<ul>
<li>email support</li>
<li>periodic email resend when tape change is needed</li>
<li>tape detection and check (if you&#8217;re supposed to insert tape 4 and you enter 5, the script will kindly refuse the tape, unload it and send a warning email message asking for the right one)</li>
</ul>
<p><span id="more-24"></span>To implement the third point (tape detection and check), it was necessary to extract the tape id from the bacula tape. That can be done looking at the bacula&#8217;s tape header structure:</p>
<p>The first structure stored is called &#8220;Block Header&#8221; and is 24 bytes long:</p>
<pre>   uint32_t CheckSum;                /* Block check sum */
   uint32_t BlockSize;               /* Block byte size including the header */
   uint32_t BlockNumber;             /* Block number */
   char ID[4] = "BB02";              /* Identification and block level */
   uint32_t VolSessionId;            /* Session Id for Job */
   uint32_t VolSessionTime;          /* Session Time for Job */</pre>
<p>Then a &#8220;Record Header&#8221; follows (12 bytes):</p>
<pre>  int32_t FileIndex;   /* File index supplied by File daemon */
  int32_t Stream;      /* Stream number supplied by File daemon */
  uint32_t DataSize;   /* size of following data record in bytes */</pre>
<p>Then a structure which is interesting for us, called &#8220;Volume Label&#8221; follows:</p>
<pre>  char Id[32];              /* Bacula 1.0 Immortal\n */
  uint32_t VerNum;          /* Label version number */
  /* VerNum 11 and greater Bacula 1.27 and later */
  btime_t   label_btime;    /* Time/date tape labeled */
  btime_t   write_btime;    /* Time/date tape first written */
  /* The following are 0 in VerNum 11 and greater */
  float64_t write_date;     /* Date this label written */
  float64_t write_time;     /* Time this label written */
  char VolName[128];        /* Volume name */
  char PrevVolName[128];    /* Previous Volume Name */
  char PoolName[128];       /* Pool name */
  char PoolType[128];       /* Pool type */
  char MediaType[128];      /* Type of this media */
  char HostName[128];       /* Host name of writing computer */
  char LabelProg[32];       /* Label program name */
  char ProgVersion[32];     /* Program version */
  char ProgDate[32];        /* Program build date/time */</pre>
<p>What is really important for us is the VolName field, which is at relative offset +56 from the beginning of the <em>Volume Label</em>. Adding 12 bytes of <em>Record Header</em> and 24 of <em>Block Header</em> makes 92 bytes.</p>
<p>Please note that mail-changer has been developed on Solaris 10 using CSW&#8217;s Bacula, you may need to work a bit to adapt it to your unix.</p>
<p>You can <a title="mail-changer script" href="/projects/mail-changer/mail-changer" target="_blank">download mail-changer here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberz.org/blog/2009/06/08/bacula-mail-changer-script-aka-poor-mans-autoloader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios nrpe and sudo: &#8220;NRPE: Unable to read output&#8221;</title>
		<link>http://www.cyberz.org/blog/2009/01/03/nagios-nrpe-and-sudo-nrpe-unable-to-read-output/</link>
		<comments>http://www.cyberz.org/blog/2009/01/03/nagios-nrpe-and-sudo-nrpe-unable-to-read-output/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 18:21:21 +0000</pubDate>
		<dc:creator>andrea</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Sudo]]></category>

		<guid isPermaLink="false">http://www.cyberz.org/blog/?p=49</guid>
		<description><![CDATA[On CentOS 5 (and RedHat]]></description>
			<content:encoded><![CDATA[<p>On CentOS 5 (and RedHat EL as well), you can encounter the following behaviour when configuring an nrpe plugin with sudo:<br />
<code><br />
[andrea@feyd ~]$ /usr/lib/nagios/plugins/check_nrpe  -H 1.2.3.4 -c check_md_raid<br />
NRPE: Unable to read output<br />
</code><br />
<span id="more-49"></span><br />
Given that check_md_raid is defined as follows, in nrpe.conf:<br />
<code><br />
command[check_md_raid]=sudo /usr/local/bin/nagios_check_md_raid<br />
</code><br />
And given (for completeness) its relative /etc/sudoers line as follows:<br />
<code><br />
nagios    ALL=(ALL)   NOPASSWD:/usr/local/bin/nagios_check_md_raid<br />
</code><br />
Then the problem is in the requiretty options in /etc/sudoers, enabled by default on CentOS. Simply comment it as follows:<br />
<code><br />
#Defaults    requiretty<br />
</code><br />
After that the plugin should work as expected:<br />
<code><br />
[andrea@feyd ~]$ /usr/lib/nagios/plugins/check_nrpe  -H 1.2.3.4 -c check_md_raid<br />
RAID OK: All arrays OK [1 array checked]<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberz.org/blog/2009/01/03/nagios-nrpe-and-sudo-nrpe-unable-to-read-output/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Bash delirium (delirio in bash)</title>
		<link>http://www.cyberz.org/blog/2008/04/18/delirii-in-bash/</link>
		<comments>http://www.cyberz.org/blog/2008/04/18/delirii-in-bash/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 12:19:44 +0000</pubDate>
		<dc:creator>andrea</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Delirium]]></category>

		<guid isPermaLink="false">http://www.cyberz.org/blog/?p=19</guid>
		<description><![CDATA[f1() { :; }; f0()]]></description>
			<content:encoded><![CDATA[<p><code>f1() { :; }; f0() { f$((${#1}==0)) "${1:1}"; echo -n "${1:0:1}"; }; f0 'dlrow olleh'; echo</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberz.org/blog/2008/04/18/delirii-in-bash/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MusicBrainz not working with Amarok on Fedora 8</title>
		<link>http://www.cyberz.org/blog/2008/04/13/musicbrainz-not-working-with-amarok-on-fedora-8/</link>
		<comments>http://www.cyberz.org/blog/2008/04/13/musicbrainz-not-working-with-amarok-on-fedora-8/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 10:14:05 +0000</pubDate>
		<dc:creator>andrea</dc:creator>
				<category><![CDATA[All/News]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Amarok]]></category>

		<guid isPermaLink="false">http://www.cyberz.org/blog/2008/04/13/musicbrainz-not-working-with-amarok-on-fedora-8/</guid>
		<description><![CDATA[On my Fedora 8 system]]></description>
			<content:encoded><![CDATA[<p>On my Fedora 8 system with Amarok I was trying to fill an mp3&#8242;s tag header using MusicBrainz, getting the following error:</p>
<p><a href="http://www.cyberz.org/blog/wp-content/uploads/2008/04/amarok.png"><img class="alignnone size-full wp-image-18" title="Amarok MusicBrainz issue" src="http://www.cyberz.org/blog/wp-content/uploads/2008/04/amarok.png" alt="" width="500" height="131" /></a></p>
<p><code>Tunepimp (MusicBrainz tagging library) returned the following error: "Fingerprinting of .mp3 files is not supported."</code></p>
<p>To make it work, just <code>yum install libtunepimp-extras-nonfree</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberz.org/blog/2008/04/13/musicbrainz-not-working-with-amarok-on-fedora-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH X11 forwarding issue</title>
		<link>http://www.cyberz.org/blog/2008/04/12/ssh-x11-forwarding-issue/</link>
		<comments>http://www.cyberz.org/blog/2008/04/12/ssh-x11-forwarding-issue/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 21:38:53 +0000</pubDate>
		<dc:creator>andrea</dc:creator>
				<category><![CDATA[All/News]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://www.cyberz.org/blog/2008/04/12/ssh-x11-forwarding-issue/</guid>
		<description><![CDATA[Recently I&#8217;ve been in an]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been in an awkward situation with ssh and X11 forwarding, where ssh using the classic -Y (or -X) switch wasn&#8217;t working (DISPLAY was not set):</p>
<p><code>[andrea@duncan ~]$ ssh -Y root@thufir<br />
root@thufir's password:<br />
Last login: Sat Apr 12 23:30:09 2008 from ***<br />
[root@thufir ~]# echo $DISPLAY<br />
[root@thufir ~]#</code></p>
<p>If you are experiencing the same and your <em>sshd_config</em> looks fine (which means TCP and X11 forwarding is already enabled) then the answer is missing <em>xauth</em>!</p>
<p>On RedHat <code>yum install xauth</code> will do the trick</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberz.org/blog/2008/04/12/ssh-x11-forwarding-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris 10 si3124 backport (workaround for bug #6566207)</title>
		<link>http://www.cyberz.org/blog/2008/03/08/solaris-si3124-backport-workaround-for-bug-6566207/</link>
		<comments>http://www.cyberz.org/blog/2008/03/08/solaris-si3124-backport-workaround-for-bug-6566207/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 23:28:31 +0000</pubDate>
		<dc:creator>andrea</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[sata]]></category>

		<guid isPermaLink="false">http://www.cyberz.org/blog/?p=10</guid>
		<description><![CDATA[Do you think you can]]></description>
			<content:encoded><![CDATA[<p>Do you think you can get a fast cheap SATA mass storage at home with Solaris 10 and ZFS just plugging a cheap si3124 controller?</p>
<p style="text-align: center;"><a href="http://www.cyberz.org/blog/wp-content/uploads/2008/07/z4sil3124-4ports-sata-32bit.jpg"><img class="size-medium wp-image-20 aligncenter" title="si3124" src="http://www.cyberz.org/blog/wp-content/uploads/2008/07/z4sil3124-4ports-sata-32bit-299x261.jpg" alt="" width="246" height="213" /></a></p>
<p>Not so easily: on Solaris 10 you will be afflicted by some boring bug known as <a href="http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6566207" target="_blank">bug #6566207</a> which gets your controller stuck for around a minute after some heavy I/O.</p>
<p><span id="more-10"></span></p>
<p>This means you cannot move data (eg. a dvd iso file) within reasonable amount of time because your controller will get stuck on 100% busy state and your transfer will freeze for 60 seconds. In my case this behaviour was showing often, enough to drop an gig ethernet ftp transfer rate to ~2Mb/s, as you can see:</p>
<p><code>4641337344 bytes transferred in 2413 seconds (1.83M/s)</code></p>
<p>Looking on internet you can find some people complaining about this bug (some of them switched to other OSes for this issue) but no workaround has been posted for Solaris 10: too bad.</p>
<p>Sun knows the bug exists but they seem to ignore this issue (who cares about crappy hardware?). OpenSolaris people knows the bug exists and they already patched it (there&#8217;s an error in interrupt handling routine: interrupts get cleared twice), but their si3124 module simply won&#8217;t load on Solaris 10.</p>
<p>So the trick is to compile the OpenSolaris&#8217; si3124 driver for Solaris 10, and that&#8217;s what I did. I got from <a title="OpenSolaris" href="http://www.opensolaris.com">OpenSolaris</a> an si3124 source (old enough to be close to the one shipped on S10), backported the <a href="http://src.opensolaris.org/source/diff/onnv/onnv-gate/usr/src/uts/common/io/sata/adapters/si3124/si3124.c?r2=%2Fonnv%2Fonnv-gate%2Fusr%2Fsrc%2Futs%2Fcommon%2Fio%2Fsata%2Fadapters%2Fsi3124%2Fsi3124.c%404810&amp;r1=%2Fonnv%2Fonnv-gate%2Fusr%2Fsrc%2Futs%2Fcommon%2Fio%2Fsata%2Fadapters%2Fsi3124%2Fsi3124.c%403116">patch</a> and rebuilt it.</p>
<p>Now my system is working fine, I never experienced these lockups again. Below is attached a tarball containing the si3124 sources and driver compiled for x86 (32bit). If you want to build a SPARC or 64bit version of the driver you need Sun Studio 10 plus some Makefile CFLAGS tweaking.</p>
<p>To install the binary driver follow these steps:</p>
<ol>
<li>Copy /kernel/drv/si3124 in a safe place (the original driver)</li>
<li>Download the tarball below</li>
<li>Untar the the tarball and copy si3124 to /kernel/drv</li>
<li>Reboot</li>
</ol>
<p>If everything works fine, your system should boot with the new driver. You can check the version you&#8217;re running using modinfo, as shown here:</p>
<p><code>root@siona:~# modinfo | grep si3124<br />
141 f8ee2000 4c94 206 1 si3124 (si3124 driver v1.3bp)<br />
root@siona:~#</code></p>
<p>The patched driver has been tested on:</p>
<ol>
<li>Solaris 10 update 3 (native driver is 1.2)</li>
<li>Solaris 10 update 5 (native driver is 1.2)</li>
</ol>
<p>The backported driver shows version v1.3bp. You can <a title="si3124 backport (binary and sources)" href="http://www.cyberz.org/blog/wp-content/uploads/2008/03/si3124bp.tar">download the si3124 backport (binary and sources) tarball here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberz.org/blog/2008/03/08/solaris-si3124-backport-workaround-for-bug-6566207/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>seq equivalent</title>
		<link>http://www.cyberz.org/blog/2008/02/27/seq-equivalent-on-solarismacosx/</link>
		<comments>http://www.cyberz.org/blog/2008/02/27/seq-equivalent-on-solarismacosx/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 19:19:28 +0000</pubDate>
		<dc:creator>andrea</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://www.cyberz.org/blog/?p=9</guid>
		<description><![CDATA[On platforms without seq (MacOSX,]]></description>
			<content:encoded><![CDATA[<p>On platforms without seq (MacOSX, Solaris), you can emulate it using dc as follows (note the upper bound and the lower bound):</p>
<p><code>echo '[1+pd<em>upper bound</em>&gt;aq]sa<em>lower bound</em> 1-lax' | dc</code></p>
<p>For example:</p>
<p><code>alia:~ andrea$ echo '[1+pd5&gt;aq]sa0 1-lax' | dc<br />
0<br />
1<br />
2<br />
3<br />
4<br />
5<br />
alia:~ andrea$</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberz.org/blog/2008/02/27/seq-equivalent-on-solarismacosx/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

