<?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>Parm Patram &#187; Linux</title>
	<atom:link href="http://oracle.3dub.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://oracle.3dub.com</link>
	<description>Oracle, Linux and UNIX tips, tricks and stuff</description>
	<lastBuildDate>Fri, 03 Feb 2012 18:14:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>disable usb0 nic RHEL5</title>
		<link>http://oracle.3dub.com/2012/02/03/disable-usb0-nic-rhel5/</link>
		<comments>http://oracle.3dub.com/2012/02/03/disable-usb0-nic-rhel5/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 18:14:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://oracle.3dub.com/?p=846</guid>
		<description><![CDATA[The usb0 NIC sometimes causes problems with certain Oracle grid components on 11g RAC.
Setting the /etc/sysconfig/network-scripts/ifcfg-usb0 &#8216;ONBOOT=no&#8217; does not always work and the devices fires up again.
You can disable the NIC from even initializing by adding the following as the first line in  /etc/udev/rules.d/60-net.rules
ACTION==&#8221;add&#8221;, DRIVER==&#8221;usb&#8221;, SYSFS{configuration}==&#8221;CDC Ethernet&#8221;, OPTIONS+=&#8221;ignore_device, last_rule&#8221;
]]></description>
			<content:encoded><![CDATA[<p>The usb0 NIC sometimes causes problems with certain Oracle grid components on 11g RAC.</p>
<p>Setting the /etc/sysconfig/network-scripts/ifcfg-usb0 &#8216;ONBOOT=no&#8217; does not always work and the devices fires up again.</p>
<p>You can disable the NIC from even initializing by adding the following as the first line in  /etc/udev/rules.d/60-net.rules<br />
ACTION==&#8221;add&#8221;, DRIVER==&#8221;usb&#8221;, SYSFS{configuration}==&#8221;CDC Ethernet&#8221;, OPTIONS+=&#8221;ignore_device, last_rule&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://oracle.3dub.com/2012/02/03/disable-usb0-nic-rhel5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grow ocfs2 partition</title>
		<link>http://oracle.3dub.com/2011/09/20/grow-ocfs2-partition/</link>
		<comments>http://oracle.3dub.com/2011/09/20/grow-ocfs2-partition/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 20:24:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://oracle.3dub.com/?p=832</guid>
		<description><![CDATA[tunefs.ocfs2 -S 
]]></description>
			<content:encoded><![CDATA[<p>tunefs.ocfs2 -S <device></p>
]]></content:encoded>
			<wfw:commentRss>http://oracle.3dub.com/2011/09/20/grow-ocfs2-partition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set ethtool options in ifcfg-ethX file</title>
		<link>http://oracle.3dub.com/2011/06/14/set-ethtool-options-in-ifcfg-ethx-file/</link>
		<comments>http://oracle.3dub.com/2011/06/14/set-ethtool-options-in-ifcfg-ethx-file/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 11:03:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HEADS UP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://oracle.3dub.com/?p=808</guid>
		<description><![CDATA[ETHTOOL_OPTS=&#8221;autoneg off speed 100 duplex full&#8221;
]]></description>
			<content:encoded><![CDATA[<p>ETHTOOL_OPTS=&#8221;autoneg off speed 100 duplex full&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://oracle.3dub.com/2011/06/14/set-ethtool-options-in-ifcfg-ethx-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a filesystem mount point from NetApp LUN using VXFS in Linux</title>
		<link>http://oracle.3dub.com/2011/05/12/create-a-filesystem-mount-point-from-netapp-lun-using-vxfs-in-linux/</link>
		<comments>http://oracle.3dub.com/2011/05/12/create-a-filesystem-mount-point-from-netapp-lun-using-vxfs-in-linux/#comments</comments>
		<pubDate>Thu, 12 May 2011 14:56:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Vertias]]></category>
		<category><![CDATA[VxFS]]></category>

		<guid isPermaLink="false">http://oracle.3dub.com/?p=796</guid>
		<description><![CDATA[
Scan the fibre and re-read the device maps:
/opt/QLogic_Corporation/ql-dynamic-tgt-lun-disc-2.5/ql-dynamic-tgt-lun-disc.sh

vxdctl initdmp
vxdctl enable

vxdisk list #will show something similar to:
fas60801_40  auto            -            -            error

verify the [...]]]></description>
			<content:encoded><![CDATA[<pre>
Scan the fibre and re-read the device maps:
/opt/QLogic_Corporation/ql-dynamic-tgt-lun-disc-2.5/ql-dynamic-tgt-lun-disc.sh

vxdctl initdmp
vxdctl enable

vxdisk list #will show something similar to:
fas60801_40  auto            -            -            error

verify the 'FAS' number from sanlun output to make sure we are working with the correct device!

#Initialize the new disk
vxdisksetup -i fas60801_40
vxdisk list #will now show the disk online:
fas60801_40  auto:cdsdisk    -            -            online thinrclm

To create a volume in an existing disk group:
vxdg -g DGNAME adddisk DGNAME-<mount>Disk=FAS60800_27
ex: vxdg -g proddg adddisk proddg-redoDisk=FAS60800_27

# see how big we can make a concat on the new disk
vxassist -b -g proddg maxsize layout=concat proddg-redoDisk
output will be like this:
Maximum volume size: nnnnnnn (XXXXMb)

# make the volume
vxassist -b -g proddg make proddg-redoVol XXXXm layout=concat proddg-redoDisk

# mkfs.vxfs /dev/vx/rdsk/proddg/proddg-redoDisk

# then mount it up and off you go!

For a new disk group:
#Initialize the new disk group
vxdg init SOMETHING_dg SOMETHING-1=fas60801_40

vxdisk -o alldgs list
will now show the new disk in its new group:
fas60801_40  auto:cdsdisk    SOMETHING-1  SOMETHING_dg online thinrclm

#Create logical volume and filesystem

vxassist -g SOMETHING_dg make SOMETHING-vol1 <SIZE> SOMETHING-1

#make the filesystem
/usr/lib/fs/vxfs/mkfs -t vxfs -o largefiles /dev/vx/rdsk/SOMETHING_dg/SOMETHING-vol1

#Mount up the filesystem
mount -t vxfs /dev/vx/rdsk/SOMETHING_dg/SOMETHING-vol1 /where/ever
</pre>
]]></content:encoded>
			<wfw:commentRss>http://oracle.3dub.com/2011/05/12/create-a-filesystem-mount-point-from-netapp-lun-using-vxfs-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test NFS mounts to see if they will hang</title>
		<link>http://oracle.3dub.com/2011/05/06/test-nfs-mounts-to-see-if-they-will-hang/</link>
		<comments>http://oracle.3dub.com/2011/05/06/test-nfs-mounts-to-see-if-they-will-hang/#comments</comments>
		<pubDate>Fri, 06 May 2011 07:59:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[NFS]]></category>

		<guid isPermaLink="false">http://oracle.3dub.com/?p=794</guid>
		<description><![CDATA[for i in `mount&#124;grep nfs&#124;awk &#8216;{print $3}&#8217;`; do echo -n &#8220;testing $i now&#8230;&#8221;; cd $i; ls&#124;wc -l; cd; done
]]></description>
			<content:encoded><![CDATA[<p>for i in `mount|grep nfs|awk &#8216;{print $3}&#8217;`; do echo -n &#8220;testing $i now&#8230;&#8221;; cd $i; ls|wc -l; cd; done</p>
]]></content:encoded>
			<wfw:commentRss>http://oracle.3dub.com/2011/05/06/test-nfs-mounts-to-see-if-they-will-hang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setuid shell script</title>
		<link>http://oracle.3dub.com/2011/02/24/setuid-shell-script/</link>
		<comments>http://oracle.3dub.com/2011/02/24/setuid-shell-script/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 16:54:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HEADS UP]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://oracle.3dub.com/?p=778</guid>
		<description><![CDATA[The script will need to run thru a wrapper, or the OS will ignore the setuid bit altoghether. Compile the following C program and make it setuid, and it will work:

#include 
#include 

int main(int argc, char *argv[])
{
argv[0] = "some_script_path";

setreuid(geteuid(), -1);
execv(argv[0], argv);
exit(1);
}

]]></description>
			<content:encoded><![CDATA[<p>The script will need to run thru a wrapper, or the OS will ignore the setuid bit altoghether. Compile the following C program and make it setuid, and it will work:</p>
<pre>
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char *argv[])
{
argv[0] = "some_script_path";

setreuid(geteuid(), -1);
execv(argv[0], argv);
exit(1);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://oracle.3dub.com/2011/02/24/setuid-shell-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl network daemon for testing firewalls, etc</title>
		<link>http://oracle.3dub.com/2011/02/16/perl-network-daemon-for-testing-firewalls-etc/</link>
		<comments>http://oracle.3dub.com/2011/02/16/perl-network-daemon-for-testing-firewalls-etc/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 19:28:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HEADS UP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://oracle.3dub.com/?p=771</guid>
		<description><![CDATA[
#!/usr/bin/perl -w
# server.pl
#--------------------
use strict;
use Socket;
# use port 7890 as default
my $port = shift &#124;&#124; 7890;
my $proto = getprotobyname('tcp');
# create a socket, make it reusable
socket(SOCKET, PF_INET, SOCK_STREAM, $proto)
   or die "Can't open socket $!\n";
setsockopt(SOCKET, SOL_SOCKET, SO_REUSEADDR, 1)
   or die "Can't set socket option to SO_REUSEADDR $!\n";
# bind to a port, then listen
bind( [...]]]></description>
			<content:encoded><![CDATA[</pre>
<p>#!/usr/bin/perl -w<br />
# server.pl<br />
#--------------------</p>
<p>use strict;<br />
use Socket;</p>
<p># use port 7890 as default<br />
my $port = shift || 7890;<br />
my $proto = getprotobyname('tcp');</p>
<p># create a socket, make it reusable<br />
socket(SOCKET, PF_INET, SOCK_STREAM, $proto)<br />
   or die "Can't open socket $!\n";<br />
setsockopt(SOCKET, SOL_SOCKET, SO_REUSEADDR, 1)<br />
   or die "Can't set socket option to SO_REUSEADDR $!\n";</p>
<p># bind to a port, then listen<br />
bind( SOCKET, pack( 'Sn4x8', AF_INET, $port, "\0\0\0\0" ))<br />
       or die "Can't bind to port $port! \n";<br />
listen(SOCKET, 5) or die "listen: $!";<br />
print "SERVER started on port $port\n";</p>
<p># accepting a connection<br />
my $client_addr;<br />
while ($client_addr = accept(NET_SOCKET, SOCKET)) {<br />
	# send them a message, close connection<br />
	print NEW_SOCKET "Smile from the server";<br />
	close NEW_SOCKET;<br />
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://oracle.3dub.com/2011/02/16/perl-network-daemon-for-testing-firewalls-etc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change TimeZone in RHEL</title>
		<link>http://oracle.3dub.com/2011/02/14/change-timezone-in-rhel/</link>
		<comments>http://oracle.3dub.com/2011/02/14/change-timezone-in-rhel/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 14:58:31 +0000</pubDate>
		<dc:creator>mgogalla</dc:creator>
				<category><![CDATA[Enterprise Manager]]></category>
		<category><![CDATA[HEADS UP]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://oracle.3dub.com/2011/02/14/change-timezone-in-rhel/</guid>
		<description><![CDATA[mv /etc/localtime /etc/localtime-old
ln -sf /usr/share/zoneinfo/GMT /etc/localtime
hwclock &#8211;systohc (or &#8211;utc)
]]></description>
			<content:encoded><![CDATA[<p>mv /etc/localtime /etc/localtime-old</p>
<p>ln -sf /usr/share/zoneinfo/GMT /etc/localtime</p>
<p>hwclock &#8211;systohc (or &#8211;utc)</p>
]]></content:encoded>
			<wfw:commentRss>http://oracle.3dub.com/2011/02/14/change-timezone-in-rhel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running a nohup command over ssh</title>
		<link>http://oracle.3dub.com/2011/02/05/running-a-nohup-command-over-ssh/</link>
		<comments>http://oracle.3dub.com/2011/02/05/running-a-nohup-command-over-ssh/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 11:32:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HEADS UP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[nohup output on remote]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://oracle.3dub.com/?p=759</guid>
		<description><![CDATA[The problem is that the ssh session will wait for the command to complete and the &#8216;&#38;&#8217; to background the task does not seem to work. The net result is that the script running the nohup ssh command hangs.
This is because by default ssh does not allocate a TTY to run a command. You can [...]]]></description>
			<content:encoded><![CDATA[<p>The problem is that the ssh session will wait for the command to complete and the &#8216;&amp;&#8217; to background the task does not seem to work. The net result is that the script running the nohup ssh command hangs.</p>
<p>This is because by default ssh does not allocate a TTY to run a command. You can force TTY allocation by using the &#8216;-t&#8217; option to ssh, which will permit backgrounding, and the ssh command will return immediately.</p>
<p>In order to demonstrate, create a file /tmp/sleepy like so:</p>
<p>#!/bin/bash<br />
while ( true ); do<br />
echo `date` &#8220;sleep&#8221;<br />
sleep 1<br />
done</p>
<p>This command will invoke the script over ssh using nohup and &amp;:</p>
<p>ssh -t localhost &#8216;nohup /tmp/sleepy &amp;&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://oracle.3dub.com/2011/02/05/running-a-nohup-command-over-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux: force user to change password at next logon</title>
		<link>http://oracle.3dub.com/2011/02/02/linux-force-user-to-change-password-at-next-logon/</link>
		<comments>http://oracle.3dub.com/2011/02/02/linux-force-user-to-change-password-at-next-logon/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 15:36:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HEADS UP]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://oracle.3dub.com/?p=753</guid>
		<description><![CDATA[chage -d0 &#60;login&#62;
]]></description>
			<content:encoded><![CDATA[<p>chage -d0 &lt;login&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://oracle.3dub.com/2011/02/02/linux-force-user-to-change-password-at-next-logon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

