<?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>Technical Diary &#187; unix</title>
	<atom:link href="http://andriigrytsenko.net/tag/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://andriigrytsenko.net</link>
	<description>With Andrii Grytsenko</description>
	<lastBuildDate>Wed, 28 Jul 2010 09:02:46 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Check if the perl module is installed</title>
		<link>http://andriigrytsenko.net/2010/02/check-if-the-perl-module-is-installed/</link>
		<comments>http://andriigrytsenko.net/2010/02/check-if-the-perl-module-is-installed/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 15:40:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://andriigrytsenko.net/?p=665</guid>
		<description><![CDATA[Under cover you can find some trick and script to check perl module installation.

To figure out whether perl module is installed at the system. Run:
perl -M&#60;module_name&#62; -e 1
if command return an error or NOT 0(zero) then module is not installed at the moment.
Here is also perl script which help you check a lot of modules:
#!/usr/local/bin/perl

my [...]]]></description>
			<content:encoded><![CDATA[<p>Under cover you can find some trick and script to check perl module installation.<br />
<span id="more-665"></span></p>
<p>To figure out whether perl module is installed at the system. Run:</p>
<pre>perl -M&lt;module_name&gt; -e 1</pre>
<p>if command return an error or NOT 0(zero) then module is not installed at the moment.</p>
<p>Here is also perl script which help you check a lot of modules:</p>
<pre>#!/usr/local/bin/perl

my @modules = qw (put your modules here separated by space without any quotes);

foreach my $module (@modules){
print $module,"\t";
my $result=system("perl -M$module -e 1");
print "Installed" if (!$result);
print "\n";
}</pre>
<p>EOF</p>
]]></content:encoded>
			<wfw:commentRss>http://andriigrytsenko.net/2010/02/check-if-the-perl-module-is-installed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Network bandwidth script</title>
		<link>http://andriigrytsenko.net/2010/02/network-bandwidth-script/</link>
		<comments>http://andriigrytsenko.net/2010/02/network-bandwidth-script/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 17:35:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://andriigrytsenko.net/?p=634</guid>
		<description><![CDATA[I spent several hours to find suitable script which help me figure out my network speed between two servers. But it was fruitlessly. So, I decided to make my own script with blackjack and hoockers. (c)

My Perl script require several things :

Perl interpreter of course
IO::Socket perl module
Getopt::Long perl module

I will tell you nothing about first [...]]]></description>
			<content:encoded><![CDATA[<p>I spent several hours to find suitable script which help me figure out my network speed between two servers. But it was fruitlessly. So, I decided to make my own script with blackjack and hoockers. (c)</p>
<p><span id="more-634"></span></p>
<p>My Perl script require several things :</p>
<ol>
<li>Perl interpreter of course</li>
<li>IO::Socket perl module</li>
<li>Getopt::Long perl module</li>
</ol>
<p>I will tell you nothing about first one. To install perl modules run <em>cpan</em> as root:</p>
<pre>cpan -i Getopt::Long</pre>
<p>and</p>
<pre>cpan -i IO::Socket</pre>
<p>When installation will be finished. Download <a href="http://andriigrytsenko.net/files/bandtest_pl.txt">bandtest.pl</a> and save it at 1-st server.</p>
<p>Now go to the second one and run <em>netcat</em>(please make sure you have this package installed):</p>
<pre>server02# nc -4tl 7777 &gt; /dev/null</pre>
<p>You can use any free port instead port 7777.</p>
<p>Back to first server and run <em>bandtest.pl</em>, but before make sure there is no any firewalls rules which hamper in connection between to hosts on port 7777.</p>
<p>Use <em>telnet</em> to check connection:</p>
<pre>server01# telnet server02 7777
Connected to kivras01.
Escape character is '^]'.</pre>
<p>This output means connection is successfully opened, so you can continue.</p>
<p>Make file with size for example 100Mb(I advice you to don&#8217;t use very big files, 100Mb is fit size which doesn&#8217;t fill your memory out and enough for proper results.  I intentionally put file into memory before sending the data&#8217;s. This allow me delete any I/O operation during the network connection and as result prevent any result distortion.):</p>
<pre>server01# dd if=/dev/zero of=/tmp/test bs=1024 count=1000000
100000+0 records in
100000+0 records out
102400000 bytes (102 MB) copied, 1.20234 s, 85.2 MB/s</pre>
<p>Run <em>bandtest.pl</em> to get a results:</p>
<pre>server01$ ./bandtest.pl -h server02 -p 7777 -f /tmp/test
Bytes were transfered 102.40 MB
Seconds taken: 8
Average speed 12.80 MB
</pre>
<p>EOF.</p>
]]></content:encoded>
			<wfw:commentRss>http://andriigrytsenko.net/2010/02/network-bandwidth-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH connection without password</title>
		<link>http://andriigrytsenko.net/2009/08/ssh-connection-without-password/</link>
		<comments>http://andriigrytsenko.net/2009/08/ssh-connection-without-password/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 14:53:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://andriigrytsenko.net/?p=400</guid>
		<description><![CDATA[SSH password-less log in method.

Let&#8217;s imagine that we have 2 hosts.

 Host A with user1 is your local host from which you will connect to remote.
Host B with user2 is remote host where you want to log in as user2.

Run
ssh-keygen
 as user1 on Host A to generate keys unless old one is exist. When I [...]]]></description>
			<content:encoded><![CDATA[<p>SSH password-less log in method.<br />
<span id="more-400"></span></p>
<p>Let&#8217;s imagine that we have 2 hosts.</p>
<ul>
<li> Host A with user1 is your local host from which you will connect to remote.</li>
<li>Host B with user2 is remote host where you want to log in as user2.</li>
</ul>
<p>Run
<pre>ssh-keygen</pre>
<p> as user1 on Host A to generate keys unless old one is exist. When I will be prompted to enter  passphrase just keep it blank. This command generate RSA key with long in 2048 bit:</p>
<pre>ssh-keygen -b 2048
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user1/.ssh/id_rsa):
/home/user1/.ssh/id_rsa already exists.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user1/.ssh/id_rsa.
Your public key has been saved in /home/user1/.ssh/id_rsa.pub.
The key fingerprint is:
9e:f0:44:4a:e2:81:72:02:0b:3c:b5:3d:be:a7:c2:95 user1@host_a
The key's randomart image is:
+--[ RSA 2048]----+
...
+-----------------+
</pre>
<p>After it&#8217;s done check content of your <em>id_rsa.pub</em> file:</p>
<pre>host_a:~# cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzU6SlO7EZksPGmLTz3EcMpFQXME9otJ4vWqQ1Nnzd0g0FX5MS
/H1m2xJWCLfgsWTWyOP7hHQufPrzY5kqJkeF0tgOSPHnzDQt4YBE1Xi0ihR/cDK+KHOlIFG4kHlEs/ThTDpD0mwgBC755Tu5g2GOW3ogsrViZbyfa72HJQaEbISZwfiPnJUwmtGJ/+PQiEoN8cgK1zrk8oVnlguK0V52ZygFuvNKd6jmKIiDKOcQ2ZIobu6jYVd/Nit1gg+9llbuAdXDFn24AdNHatBzvlwb76yYa/ZAwZQKzytWca0NnMMwMeQ== user1@host_a</pre>
<p>Copy it and log in remote Host B as user2. And append it to <em>authorized_keys</em> file:</p>
<pre>$ cat &gt;&gt; /home/grytsenko/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzU6SlO7EZksPGmLTz3EcMpFQXME9otJ4vWqQ1Nnzd0g0FX5MS
/H1m2xJWCLfgsWTWyOP7hHQufPrzY5kqJkeF0tgOSPHnzDQt4YBE1Xi0ihR/cDK+KHOlIFG4kHlEs/ThTDpD0mwgBC755Tu5g2GOW3ogsrViZbyfa72HJQaEbISZwfiPnJUwmtGJ/+PQiEoN8cgK1zrk8oVnlguK0V52ZygFuvNKd6jmKIiDKOcQ2ZIobu6jYVd/Nit1gg+9llbuAdXDFn24AdNHatBzvlwb76yYa/ZAwZQKzytWca0NnMMwMeQ== user1@host_a</pre>
<p>Set proper permissions for file:</p>
<pre>user2@host_b:~$ chmod 600 ~/.ssh/authorized_keys</pre>
<p>Now you are ready to log in without password from Host A:</p>
<pre>host_a~# ssh -p 443 user2@host_b
Linux host_b 2.6.18-5-686 #1 SMP Fri Jun 1 00:47:00 UTC 2007 i686</pre>
<p>That&#8217;s all folks:).</p>
]]></content:encoded>
			<wfw:commentRss>http://andriigrytsenko.net/2009/08/ssh-connection-without-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
