<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="http://howto.ilance.nl/styles/rss.css" type="text/css"?>
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>
 <channel>
  <title>Linux / Unix Tips and Tricks</title>
  <link>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks</link>
  <description>&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;
</description>
  <pubDate>Thu, 12 Nov 2009 18:47:00 +0100</pubDate>
  <generator>http://www.lifetype.net</generator>
    <item>
   <title>Using rsync to synchronize a filesystem</title>
   <description>
    &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;
   </description>
   <link>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/solaris/2009/05/27/using-rsync-to-synchronize-a-filesystem</link>
   <comments>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/solaris/2009/05/27/using-rsync-to-synchronize-a-filesystem</comments>
   <guid>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/solaris/2009/05/27/using-rsync-to-synchronize-a-filesystem</guid>
      <dc:creator>len</dc:creator>
      
    <category>Unix</category>
      
    <category>Linux</category>
      
    <category>Solaris</category>
         <pubDate>Wed, 27 May 2009 09:16:30 +0200</pubDate>
   <source url="http://howto.ilance.nl/rss.php?blogId=1&amp;profile=rss20">Linux / Unix Tips and Tricks</source>
     </item>
    <item>
   <title>TT Assen 2009</title>
   <description>
    &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;
   </description>
   <link>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/general/2009/01/03/tt</link>
   <comments>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/general/2009/01/03/tt</comments>
   <guid>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/general/2009/01/03/tt</guid>
      <dc:creator>len</dc:creator>
      
    <category>General</category>
         <pubDate>Sat, 03 Jan 2009 19:36:02 +0100</pubDate>
   <source url="http://howto.ilance.nl/rss.php?blogId=1&amp;profile=rss20">Linux / Unix Tips and Tricks</source>
                    </item>
    <item>
   <title>Solaris 10: Enable Samba for Windows File Sharing</title>
   <description>
    &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;
   </description>
   <link>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/solaris/2008/12/23/solaris_enable_samba</link>
   <comments>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/solaris/2008/12/23/solaris_enable_samba</comments>
   <guid>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/solaris/2008/12/23/solaris_enable_samba</guid>
      <dc:creator>len</dc:creator>
      
    <category>Solaris</category>
         <pubDate>Tue, 23 Dec 2008 09:44:10 +0100</pubDate>
   <source url="http://howto.ilance.nl/rss.php?blogId=1&amp;profile=rss20">Linux / Unix Tips and Tricks</source>
     </item>
    <item>
   <title>Changing Veritas device owner for raw device</title>
   <description>
    &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;
   </description>
   <link>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/unix/2008/12/18/changing-veritas-device-owner-for-raw-device</link>
   <comments>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/unix/2008/12/18/changing-veritas-device-owner-for-raw-device</comments>
   <guid>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/unix/2008/12/18/changing-veritas-device-owner-for-raw-device</guid>
      <dc:creator>len</dc:creator>
      
    <category>Unix</category>
         <pubDate>Thu, 18 Dec 2008 20:03:46 +0100</pubDate>
   <source url="http://howto.ilance.nl/rss.php?blogId=1&amp;profile=rss20">Linux / Unix Tips and Tricks</source>
     </item>
    <item>
   <title>Perl: how to install a Perl module locally</title>
   <description>
    &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;
   </description>
   <link>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/perl/2008/12/16/perl-how-to-install-a-perl-module-locally</link>
   <comments>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/perl/2008/12/16/perl-how-to-install-a-perl-module-locally</comments>
   <guid>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/perl/2008/12/16/perl-how-to-install-a-perl-module-locally</guid>
      <dc:creator>len</dc:creator>
      
    <category>Unix</category>
      
    <category>Linux</category>
      
    <category>perl</category>
         <pubDate>Tue, 16 Dec 2008 11:05:48 +0100</pubDate>
   <source url="http://howto.ilance.nl/rss.php?blogId=1&amp;profile=rss20">Linux / Unix Tips and Tricks</source>
     </item>
    <item>
   <title>VMware Server: Managing virtual machines from the command line</title>
   <description>
    &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;
   </description>
   <link>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/linux/2008/12/15/vmware-command-line-manage-vm</link>
   <comments>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/linux/2008/12/15/vmware-command-line-manage-vm</comments>
   <guid>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/linux/2008/12/15/vmware-command-line-manage-vm</guid>
      <dc:creator>len</dc:creator>
      
    <category>Linux</category>
         <pubDate>Mon, 15 Dec 2008 16:54:01 +0100</pubDate>
   <source url="http://howto.ilance.nl/rss.php?blogId=1&amp;profile=rss20">Linux / Unix Tips and Tricks</source>
     </item>
    <item>
   <title>Setting your X environment</title>
   <description>
    &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;
   </description>
   <link>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/unix/2008/12/15/setting-your-x-environment</link>
   <comments>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/unix/2008/12/15/setting-your-x-environment</comments>
   <guid>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/unix/2008/12/15/setting-your-x-environment</guid>
      <dc:creator>len</dc:creator>
      
    <category>General</category>
      
    <category>Unix</category>
         <pubDate>Mon, 15 Dec 2008 14:15:01 +0100</pubDate>
   <source url="http://howto.ilance.nl/rss.php?blogId=1&amp;profile=rss20">Linux / Unix Tips and Tricks</source>
     </item>
    <item>
   <title>Replacing text in multiple files</title>
   <description>
    &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;
   </description>
   <link>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/perl/2008/12/15/replace-text-multiple-files</link>
   <comments>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/perl/2008/12/15/replace-text-multiple-files</comments>
   <guid>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/perl/2008/12/15/replace-text-multiple-files</guid>
      <dc:creator>len</dc:creator>
      
    <category>Unix</category>
      
    <category>Linux</category>
      
    <category>perl</category>
         <pubDate>Mon, 15 Dec 2008 07:42:12 +0100</pubDate>
   <source url="http://howto.ilance.nl/rss.php?blogId=1&amp;profile=rss20">Linux / Unix Tips and Tricks</source>
     </item>
    <item>
   <title>Linux: How to extract a single file from a RPM package</title>
   <description>
    &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;
   </description>
   <link>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</link>
   <comments>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</comments>
   <guid>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</guid>
      <dc:creator>len</dc:creator>
      
    <category>Linux</category>
      
    <category>Package Management</category>
         <pubDate>Fri, 12 Dec 2008 12:20:38 +0100</pubDate>
   <source url="http://howto.ilance.nl/rss.php?blogId=1&amp;profile=rss20">Linux / Unix Tips and Tricks</source>
     </item>
    <item>
   <title>Solaris: Determinate to which package a file belongs</title>
   <description>
    &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;
   </description>
   <link>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/package-management/2008/12/12/solaris-determinate-to-which-package-a-file-belongs</link>
   <comments>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/package-management/2008/12/12/solaris-determinate-to-which-package-a-file-belongs</comments>
   <guid>http://howto.ilance.nl/blog/linux-unix-tips-and-tricks/package-management/2008/12/12/solaris-determinate-to-which-package-a-file-belongs</guid>
      <dc:creator>len</dc:creator>
      
    <category>Unix</category>
      
    <category>Solaris</category>
      
    <category>Package Management</category>
         <pubDate>Fri, 12 Dec 2008 11:45:44 +0100</pubDate>
   <source url="http://howto.ilance.nl/rss.php?blogId=1&amp;profile=rss20">Linux / Unix Tips and Tricks</source>
     </item>
   </channel>
</rss>