<?xml version="1.0" encoding="iso-8859-1"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en"> 
<title>Linux / Unix Tips and Tricks</title> 
<link rel="alternate" type="text/html" href="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks" /> 
	 
	<modified>2009-05-27T09:16:30+02:00</modified> 
<tagline>&lt;p&gt;This blog contains Linux / Unix Tips and Tricks, collected during my work as a Unix System Administrator.&lt;br /&gt;
They are here for my own reference, but they might help you as well !&lt;/p&gt;
</tagline> 
<generator url="http://www.lifetype.net/" version="1.2">LifeType</generator> 
 
<copyright>Copyright (c) len</copyright> 
  
 <entry> 
 <id>tag:howto.ilance.nl,2009-05-27:13</id>
 <title>Using rsync to synchronize a filesystem</title> 
 <link rel="alternate" type="text/html" href="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/solaris/2009/05/27/using-rsync-to-synchronize-a-filesystem" /> 
  
 <modified>2009-05-27T09:16:30+02:00</modified> 
 <issued>2009-05-27T09:16:30+02:00</issued> 
 <created>2009-05-27T09:16:30+02:00</created> 
 <summary type="text/plain"> 
Here&#039;s the command that I use to synchronize a filesystem from one server to another: 
 
 
 rsync -avx --numeric-ids --progress --delete 10.0.0.1:/mnt/sda1/ /mnt/sda1/ 
 
 
The -a option ...</summary> 
 <author> 
  
 <name>len</name> 
 <url>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks</url> 
</author> 
<dc:subject>
Unix 
Linux 
Solaris 
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks"> 
 &lt;pre class=&quot;programlisting&quot;&gt;
Here&#039;s the command that I use to synchronize a filesystem from one server to another: 
&lt;/pre&gt;
&lt;pre class=&quot;programlisting&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;rsync -avx --numeric-ids --progress --delete 10.0.0.1:/mnt/sda1/ /mnt/sda1/&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class=&quot;programlisting&quot;&gt;
The -a option sets &amp;ldquo;archive mode&amp;rdquo;, which essentially turns on a number of rsync options 
that preserve file ownership and permissions and other settings. 
The -v option makes rsync provide more output about what it is doing, 
and the --progress argument displays a progress meter so you can keep up with how long rsync will take. 
&lt;/pre&gt;
&lt;pre class=&quot;programlisting&quot;&gt;
The other two arguments are rather important, and if you don&#039;t
use rsync regularly, you might not come across them much. The -x argument
tells rsync to stick to one filesystem. This is important particularly
when you back up the / partition; otherwise, rsync happily will traverse
into /home or any other partitions you have and copy them all into your
local /mnt/sda1 mountpoint, which probably will not have enough space
to hold everything. The --numeric-ids argument sets file permissions
on the destination files based on their numeric ID and not the matching
user or group name. 
&lt;/pre&gt;
&lt;pre class=&quot;programlisting&quot;&gt;
&amp;nbsp;
&lt;/pre&gt; 
</content> 
</entry> 
 
 <entry> 
 <id>tag:howto.ilance.nl,2009-01-03:12</id>
 <title>TT Assen 2009</title> 
 <link rel="alternate" type="text/html" href="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/general/2009/01/03/tt" /> 
  
 <modified>2009-01-03T19:36:02+01:00</modified> 
 <issued>2009-01-03T19:36:02+01:00</issued> 
 <created>2009-01-03T19:36:02+01:00</created> 
 <summary type="text/plain"> 
Zaterdag 27 juni 2009 is het weer zover !!! Dan doet het MotoGP circus Assen aan en wij zijn er bij ! 
 
 
 &amp;nbsp;bevestigd&amp;nbsp; &amp;nbsp;&amp;nbsp;  niet bevestigd&amp;nbsp; ...</summary> 
 <author> 
  
 <name>len</name> 
 <url>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks</url> 
</author> 
<dc:subject>
General 
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks"> 
 &lt;p&gt;
Zaterdag 27 juni 2009 is het weer zover !!! Dan doet het MotoGP circus Assen aan en wij zijn er bij ! 
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;bevestigd&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background-color: #ff9900&quot;&gt;niet bevestigd&amp;nbsp;&lt;/span&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;table border=&quot;1&quot; width=&quot;70%&quot;&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;th&gt;Nr &lt;/th&gt;&lt;th&gt;Zitplaats &lt;/th&gt;&lt;th&gt;Wie &lt;/th&gt;&lt;th&gt;Met de motor &lt;/th&gt;&lt;th&gt;Vanuit &lt;/th&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;1.&lt;br /&gt;
			&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-16-1 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Joram Betgen&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;JA&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Almere&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;2.&lt;br /&gt;
			&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-16-2 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Benjamin &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Achterop bij Len&lt;br /&gt;
			&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Zeewolde&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;3.&lt;br /&gt;
			&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-16-3 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Henny &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;JA&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Zeewolde&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;4.&lt;br /&gt;
			&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-16-4 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Henny&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;JA&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Zeewolde&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;5.&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-16-5 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Henny&amp;nbsp; &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;JA&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Zeewolde&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;6.&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-16-6 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Henny &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;JA&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Zeewolde&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;7.&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-16-7 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Len Kranendonk&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;JA&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Zeewolde&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;8.&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-17-1 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Martijn van Leeuwen&lt;br /&gt;
			&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;JA&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Vleuten&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;9.&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-17-2&amp;nbsp; &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Michel van Tuijl&lt;br /&gt;
			&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;JA&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;IJsselstein&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;10.&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-17-3 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Wout Kohler &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;JA&lt;br /&gt;
			&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Vleuten&lt;br /&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;11.&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-17-4 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Arjan Jongsma&lt;br /&gt;
			&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;JA&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Zuidwolde&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;12.&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-17-5 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Bert Lambregts&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;NEE&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Bunschoten &lt;br /&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;13.&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-17-6 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Bert Lambregts &lt;br /&gt;
			&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;NEE&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Bunschoten &lt;br /&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;14.&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;DS-17-7 &lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp; Bert Lambregts&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;NEE&lt;/td&gt;
			&lt;td style=&quot;background-color: #00ff00&quot;&gt;&amp;nbsp;Bunschoten&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;a id=&quot;res_5&quot; href=&quot;http://howto.ilance.nl/gallery/1/Strubbentribune.JPG&quot;&gt;&lt;img src=&quot;http://howto.ilance.nl/gallery/1/previews-med/Strubbentribune.JPG&quot; border=&quot;0&quot; alt=&quot;TT Assen Strubben Tribune&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Ook dit jaar hebben we weer superplaatsen weten te bemachtigen op de Strubben tribune, die nu (begin januari) al&amp;nbsp; uitverkocht is. 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt; 
</content> 
</entry> 
 
 <entry> 
 <id>tag:howto.ilance.nl,2008-12-23:11</id>
 <title>Solaris 10: Enable Samba for Windows File Sharing</title> 
 <link rel="alternate" type="text/html" href="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/solaris/2008/12/23/solaris_enable_samba" /> 
  
 <modified>2008-12-23T09:44:10+01:00</modified> 
 <issued>2008-12-23T09:44:10+01:00</issued> 
 <created>2008-12-23T09:44:10+01:00</created> 
 <summary type="text/plain"> 
Today I got a question about users that want to access some FIX logfiles on a Solaris 10 server.  
Of course you can give them (restricted) ssh access so they could access the files using ...</summary> 
 <author> 
  
 <name>len</name> 
 <url>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks</url> 
</author> 
<dc:subject>
Solaris 
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks"> 
 &lt;p&gt;
Today I got a question about users that want to access some FIX logfiles on a Solaris 10 server. &lt;br /&gt;
Of course you can give them (restricted) ssh access so they could access the files using &lt;a href=&quot;http://winscp.net&quot; target=&quot;_blank&quot;&gt;WinSCP&lt;/a&gt;, &lt;br /&gt;
but I thought it would be easier to enable SAMBA for them so they could access the logfiles using their Windows Explorer. The good news is that Solaris 10 (9 as well) comes with SAMBA included in the OS, so you just need to enable it.
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Configure Samba by creating the file /etc/sfw/smb.conf &lt;br /&gt;
	Here&#039;s a minimal /etc/sfw/smb.conf which I used:&lt;br /&gt;
	&lt;br /&gt;
	&lt;span style=&quot;font-family: courier new,courier&quot;&gt;[global]&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workgroup = WORKGROUP&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; server string = Fix Server&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; log file = /var/samba/log/log.%M&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; security = user&lt;br /&gt;
	&lt;br /&gt;
	[logs]&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; comment = FIX Log files&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = /path/to/logs&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; browseable = yes&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; read only = yes&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; guest ok = No&lt;/span&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	&amp;nbsp; &lt;/li&gt;
	&lt;li&gt;Add a user called &amp;quot;readlog&amp;quot; on Unix&lt;br /&gt;
	&lt;br /&gt;
	&lt;span style=&quot;font-family: courier new,courier&quot;&gt;# useradd -d /path/to/logs -s /bin/false readlog&lt;/span&gt;&lt;br /&gt;
	&amp;nbsp;&lt;/li&gt;
	&lt;br /&gt;
	&lt;li&gt;Add the new created user &amp;quot;readlog&amp;quot; to the SAMBA password database and configure a password:&lt;br /&gt;
	&lt;br /&gt;
	&lt;span style=&quot;font-family: courier new,courier&quot;&gt;# /usr/sfw/bin/smbpasswd -a readlog&lt;/span&gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;nbsp;&lt;/li&gt;
	&lt;li&gt;Now we can start Samba for the first time ! &lt;br /&gt;
	&lt;br /&gt;
	&lt;span style=&quot;font-family: courier new,courier&quot;&gt;# /etc/init.d/samba start&lt;/span&gt;&lt;br /&gt;
	&lt;br /&gt;
	&lt;/li&gt;
	&lt;li&gt;Test the Samba Server by starting a new Windows Explorer and type \\yourserver in the address bar.&lt;br /&gt;
	If everything is okay you&#039;ll get a password dialog where you can login with the username &amp;quot;readlog&amp;quot; and the password supplied at step 3.&lt;/li&gt;
&lt;/ol&gt; 
</content> 
</entry> 
 
 <entry> 
 <id>tag:howto.ilance.nl,2008-12-18:10</id>
 <title>Changing Veritas device owner for raw device</title> 
 <link rel="alternate" type="text/html" href="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/unix/2008/12/18/changing-veritas-device-owner-for-raw-device" /> 
  
 <modified>2008-12-18T20:03:46+01:00</modified> 
 <issued>2008-12-18T20:03:46+01:00</issued> 
 <created>2008-12-18T20:03:46+01:00</created> 
 <summary type="text/plain"> 
Today I had to set the owner/group for a Veritas raw device. You can set it on Unix using chown, but the settings will be lost after a reboot. To properly set the ownership on a veritas raw ...</summary> 
 <author> 
  
 <name>len</name> 
 <url>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks</url> 
</author> 
<dc:subject>
Unix 
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks"> 
 &lt;p&gt;
Today I had to set the owner/group for a Veritas raw device. You can set it on Unix using chown, but the settings will be lost after a reboot. To properly set the ownership on a veritas raw device you need the following command:
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;em&gt;vxedit&lt;/em&gt; set user=username &lt;em&gt;group&lt;/em&gt;=groupname mode=modenumber volumename&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
So in my case I did a 
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;vxedit set user=informix group=informix mode=0660 rootdbs &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt; 
</content> 
</entry> 
 
 <entry> 
 <id>tag:howto.ilance.nl,2008-12-16:9</id>
 <title>Perl: how to install a Perl module locally</title> 
 <link rel="alternate" type="text/html" href="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/perl/2008/12/16/perl-how-to-install-a-perl-module-locally" /> 
  
 <modified>2008-12-16T11:05:48+01:00</modified> 
 <issued>2008-12-16T11:05:48+01:00</issued> 
 <created>2008-12-16T11:05:48+01:00</created> 
 <summary type="text/plain"> 
Today I wanted to install a Perl module in my home directory. Here&#039;s how to do it:
 
 
 $ perl Makefile.PL PREFIX=/home/len 
$ make 
$ make test 
$ make install
 
 
 
For older ...</summary> 
 <author> 
  
 <name>len</name> 
 <url>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks</url> 
</author> 
<dc:subject>
Unix 
Linux 
perl 
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks"> 
 &lt;p&gt;
Today I wanted to install a Perl module in my home directory. Here&#039;s how to do it:
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ perl Makefile.PL PREFIX=/home/len&lt;br /&gt;
$ make&lt;br /&gt;
$ make test&lt;br /&gt;
$ make install
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
For older modules you might need to specify other variables during module installation. &lt;br /&gt;
I did it by saving the following variables in a file (install_vars.sh):
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;PREFIX=/home/len \&lt;br /&gt;
INSTALLPRIVLIB=/home/len/lib/perl5 \&lt;br /&gt;
INSTALLSCRIPT=/home/len/bin \&lt;br /&gt;
INSTALLSITELIB=/home/len/lib/perl5/site_perl \&lt;br /&gt;
INSTALLBIN=/home/len/bin \&lt;br /&gt;
INSTALLMAN1DIR=/home/len/lib/perl5/man \&lt;br /&gt;
INSTALLMAN3DIR=/home/len/lib/perl5/man/man3
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Now you can use the following syntax:
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ perl Makefile.PL `cat install_vars.sh`&lt;br /&gt;
$ make&lt;br /&gt;
$ make test&lt;br /&gt;
$ make install&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt; 
</content> 
</entry> 
 
 <entry> 
 <id>tag:howto.ilance.nl,2008-12-15:8</id>
 <title>VMware Server: Managing virtual machines from the command line</title> 
 <link rel="alternate" type="text/html" href="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/linux/2008/12/15/vmware-command-line-manage-vm" /> 
  
 <modified>2008-12-15T16:54:01+01:00</modified> 
 <issued>2008-12-15T16:54:01+01:00</issued> 
 <created>2008-12-15T16:54:01+01:00</created> 
 <summary type="text/plain"> 
Sometimes it&#039;s handy to be able to manage your Virtual Machines on the Command Line. 
So if you are stuck in traffic and only have an SSH login available on your mobile phone, 
 here are the ...</summary> 
 <author> 
  
 <name>len</name> 
 <url>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks</url> 
</author> 
<dc:subject>
Linux 
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks"> 
 &lt;p&gt;
Sometimes it&#039;s handy to be able to manage your Virtual Machines on the Command Line.&lt;br /&gt;
So if you are stuck in traffic and only have an SSH login available on your mobile phone,&lt;br /&gt;
 here are the commands to manage your Virtual Machine:
&lt;/p&gt;
&lt;p&gt;
Listing configured Virtual Machines:
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ vmware-cmd -l&lt;br /&gt;
/var/lib/vmware/Virtual Machines/Server-01/Windows 2000 Server.vmx&lt;br /&gt;
/var/lib/vmware/Virtual Machines/Server-01/RedHat5.vmx&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Get the state of a Virtual Machine:
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ vmware-cmd &amp;quot;/var/lib/vmware/Virtual Machines/Server-01/RedHat5.vmx&amp;quot; getstate&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Start (or resume) a Virtual Machine:
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ vmware-cmd &amp;quot;/var/lib/vmware/Virtual Machines/Server-01/RedHat5.vmx&amp;quot; start&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Stop a Virtual Machine:
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ vmware-cmd &amp;quot;/var/lib/vmware/Virtual Machines/Server-01/RedHat5.vmx&amp;quot; stop&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Reset a Virtual Machine:
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ vmware-cmd &amp;quot;/var/lib/vmware/Virtual Machines/Server-01/RedHat5.vmx&amp;quot; reset&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt; 
</content> 
</entry> 
 
 <entry> 
 <id>tag:howto.ilance.nl,2008-12-15:6</id>
 <title>Setting your X environment</title> 
 <link rel="alternate" type="text/html" href="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/unix/2008/12/15/setting-your-x-environment" /> 
  
 <modified>2008-12-15T14:15:01+01:00</modified> 
 <issued>2008-12-15T14:15:01+01:00</issued> 
 <created>2008-12-15T14:15:01+01:00</created> 
 <summary type="text/plain"> 
Most Unix sysadmins are hardcore Command Line gurus. However, sometimes you may need to run a graphical application on Unix. 
The graphical environment on Unix is called the  X Window System ...</summary> 
 <author> 
  
 <name>len</name> 
 <url>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks</url> 
</author> 
<dc:subject>
General 
Unix 
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks"> 
 &lt;p&gt;
Most Unix sysadmins are hardcore Command Line gurus. However, sometimes you may need to run a graphical application on Unix.&lt;br /&gt;
The graphical environment on Unix is called the &lt;a href=&quot;http://en.wikipedia.org/wiki/X_Window_System&quot; target=&quot;_blank&quot;&gt;X Window System&lt;/a&gt; (or X or X11). Unlike most other graphical systems, X is designed to be used over the network.
&lt;/p&gt;
&lt;p&gt;
It&#039;s important to understand that in the X Window concept the application that runs on Unix is the Client, while your PC is the Server.&lt;br /&gt;
So the first thing you&#039;ll need is a X Server. On my Windows PC I have &lt;a href=&quot;http://www.attachmate.com/Products/PC+X+Server/rx/rx.htm&quot;&gt;Reflection X&lt;/a&gt; installed (propertary software), but there are free alternatives, like &lt;a href=&quot;http://sourceforge.net/projects/xming&quot;&gt;Xming&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Once you have an X Server running on your PC, it&#039;s time to log in to the Unix box. On the Unix prompt you need to tell where the X Server resides. This is done by setting the DISPLAY variable:
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ DISPLAY=10.0.0.1:0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Change 10.0.0.1 in your actual IP address&lt;br /&gt;
$ export DISPLAY&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Now you can test the X Server by starting a X application, like xclock:
&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;http://howto.ilance.nl/gallery/1/xclock.png&quot; alt=&quot;xclock screenshot&quot; align=&quot;right&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$&amp;nbsp; /usr/openwin/bin/xclock&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
A simple graphical clock should appear 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp; 
&lt;/p&gt; 
</content> 
</entry> 
 
 <entry> 
 <id>tag:howto.ilance.nl,2008-12-15:7</id>
 <title>Replacing text in multiple files</title> 
 <link rel="alternate" type="text/html" href="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/perl/2008/12/15/replace-text-multiple-files" /> 
  
 <modified>2008-12-15T07:42:12+01:00</modified> 
 <issued>2008-12-15T07:42:12+01:00</issued> 
 <created>2008-12-15T07:42:12+01:00</created> 
 <summary type="text/plain"> 
Here&#039;s a perl oneliner that does text search &amp;amp; replace over multiple files. Make sure you create a backup before using it !
 
 
This example will replace all occurences of ...</summary> 
 <author> 
  
 <name>len</name> 
 <url>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks</url> 
</author> 
<dc:subject>
Unix 
Linux 
perl 
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks"> 
 &lt;p&gt;
Here&#039;s a perl oneliner that does text search &amp;amp; replace over multiple files. Make sure you create a backup before using it !
&lt;/p&gt;
&lt;p&gt;
This example will replace all occurences of &amp;quot;oldserver&amp;quot; to &amp;quot;newserver&amp;quot; in the *.conf files: 
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ perl -pi -e &#039;s/oldserver/newserver/g&#039; *.conf &lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
If you combine it with find you can even do search and replace recursively over directories. &lt;br /&gt;
This example will replace all occurences &amp;quot;10.0.0.1&amp;quot; to &amp;quot;192.168.1.1&amp;quot; in all files under /data:
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ find /data -type f | xargs perl -pi -e &#039;s/10.0.0.1/192.168.1.1/g&#039; 
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt; 
</content> 
</entry> 
 
 <entry> 
 <id>tag:howto.ilance.nl,2008-12-12:5</id>
 <title>Linux: How to extract a single file from a RPM package</title> 
 <link rel="alternate" type="text/html" href="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/package-management/2008/12/12/linux-how-to-extract-a-single-file-from-a-rpm-package" /> 
  
 <modified>2008-12-12T12:20:38+01:00</modified> 
 <issued>2008-12-12T12:20:38+01:00</issued> 
 <created>2008-12-12T12:20:38+01:00</created> 
 <summary type="text/plain"> 
I once got myself in the situation where I had no option but to retrieve a missing file from a rpm package. I didn&#039;t want to install the whole rpm, but only extract the missing file. Here&#039;s an ...</summary> 
 <author> 
  
 <name>len</name> 
 <url>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks</url> 
</author> 
<dc:subject>
Linux 
Package Management 
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks"> 
 &lt;p&gt;
I once got myself in the situation where I had no option but to retrieve a missing file from a rpm package. I didn&#039;t want to install the whole rpm, but only extract the missing file. Here&#039;s an example how to extract the original httpd.conf from the httpd package:
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Copy the rpm to your /tmp directory:&lt;br /&gt;
	&lt;br /&gt;
	&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ cp httpd-2.2.8-3.i386.rpm /tmp&lt;br /&gt;
	$ cd /tmp&lt;br /&gt;
	&amp;nbsp; &lt;br /&gt;
	&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;Get the absolute filename from the rpm:&lt;br /&gt;
	&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;br /&gt;
	$ rpm -qlp httpd-2.2.8-3.i386.rpm | grep httpd.conf&lt;br /&gt;
	/etc/httpd/conf/httpd.conf&lt;br /&gt;
	&amp;nbsp;
	&lt;br /&gt;
	&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;Extract the httpd.conf file from the rpm package:&lt;br /&gt;
	&lt;br /&gt;
	&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ rpm2cpio httpd-2.2.8-3.i386.rpm | cpio -id ./etc/httpd/conf/httpd.conf&lt;br /&gt;
	4838 blocks&lt;br /&gt;
	&amp;nbsp;
	&lt;br /&gt;
	&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;The requested file is now extracted in the /tmp directory:&lt;br /&gt;
	&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;br /&gt;
	$ ls -l /tmp/etc/httpd/conf/httpd.conf&lt;br /&gt;
	-rw-r--r-- 1 root root 33692 2008-12-12 12:41 /tmp/etc/httpd/conf/httpd.conf&lt;br /&gt;
	&amp;nbsp;&lt;br /&gt;
	&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt; 
</content> 
</entry> 
 
 <entry> 
 <id>tag:howto.ilance.nl,2008-12-12:4</id>
 <title>Solaris: Determinate to which package a file belongs</title> 
 <link rel="alternate" type="text/html" href="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/package-management/2008/12/12/solaris-determinate-to-which-package-a-file-belongs" /> 
  
 <modified>2008-12-12T11:45:44+01:00</modified> 
 <issued>2008-12-12T11:45:44+01:00</issued> 
 <created>2008-12-12T11:45:44+01:00</created> 
 <summary type="text/plain"> 
I had an issue with software which was complaining about the version of /usr/lib/libCstd.so.1 
So I wanted to know to which package this particular file belongs, in order to see if there are ...</summary> 
 <author> 
  
 <name>len</name> 
 <url>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks</url> 
</author> 
<dc:subject>
Unix 
Solaris 
Package Management 
</dc:subject> 
 <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://howto.ilance.nl/blog/linux-unix-tips-and-tricks"> 
 &lt;p&gt;
I had an issue with software which was complaining about the version of /usr/lib/libCstd.so.1&lt;br /&gt;
So I wanted to know to which package this particular file belongs, in order to see if there are any updates available for this package. Here&#039;s how to do it:
&lt;/p&gt;
&lt;p&gt;
 &lt;span style=&quot;font-family: courier new,courier&quot;&gt;/usr/sbin/pkgchk -l -p &amp;lt;absolute filename or directory&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
So in my case I ran: 
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$ /usr/sbin/pkgchk -l -p /usr/lib/libCstd.so.1&lt;br /&gt;
Pathname: /usr/lib/libCstd.so.1&lt;br /&gt;
Type: regular file&lt;br /&gt;
Expected mode: 0755&lt;br /&gt;
Expected owner: root&lt;br /&gt;
Expected group: bin&lt;br /&gt;
Expected file size (bytes): 1915796&lt;br /&gt;
Expected sum(1) of contents: 63488&lt;br /&gt;
Expected last modification: Oct 24 22:23:55 2008&lt;br /&gt;
Referenced by the following packages:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUNWlibC&lt;br /&gt;
Current status: installed&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
As shown above the file /usr/lib/libCstd.so.1 belongs to package SUNWlibC.
&lt;/p&gt;
&lt;p&gt;
The command pkgchk uses a flat file that contains the file and package information. You could as well directly use that:
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;$grep libCstd.so.1 /var/sadm/install/contents&lt;br /&gt;
/usr/lib/libCstd.so.1 f none 0755 root bin 1915796 63488 1224879835 SUNWlibC&lt;br /&gt;
/usr/lib/sparcv9/libCstd.so.1 f none 0755 root bin 2350704 39866 1224879861 SUNWlibCx&lt;br /&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt; 
</content> 
</entry> 
 
</feed>