<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.3" -->
<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/"
	>

<channel>
	<title>Gary's WebBlog</title>
	<link>http://blog.sylviacomputing.co.nz</link>
	<description>This blog is for and about myself, friends .. et al</description>
	<pubDate>Sun, 01 Feb 2009 09:38:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.3</generator>
	<language>en</language>
			<item>
		<title>Principles of Website Design (IRC)</title>
		<link>http://blog.sylviacomputing.co.nz/?p=72</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=72#comments</comments>
		<pubDate>Sun, 01 Feb 2009 08:35:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>General</category>
	<category>IRC Website Design</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=72</guid>
		<description><![CDATA[ 

To have a website that primarily focuses on reaching out
It must elevate Christ and him alone. (Christocentric)
It must have content that is agnostic to changes in the composition of the church leadership.
Contact details to be generic. Where they have to be specific, the contact name &#038; number must be indicated.

Other Features Expected


]]></description>
			<content:encoded><![CDATA[<p> </p>
<ol>
<li>To have a website that primarily focuses on reaching out</li>
<li>It must elevate Christ and him alone. (Christocentric)</li>
<li>It must have content that is agnostic to changes in the composition of the church leadership.</li>
<li>Contact details to be generic. Where they have to be specific, the contact name &#038; number must be indicated.</li>
</ol>
<p><strong>Other Features Expected</strong></p>
<ul>
<li /></ul>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=72</wfw:commentRSS>
		</item>
		<item>
		<title>Putting back encrypted Oracle password for an Oracle account</title>
		<link>http://blog.sylviacomputing.co.nz/?p=71</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=71#comments</comments>
		<pubDate>Thu, 16 Oct 2008 22:30:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>General</category>
	<category>Linux</category>
	<category>Oracle</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=71</guid>
		<description><![CDATA[Suppose you have an account called SIEBEL, whose un-encrypted password you don&#8217;t know, but want to temporarily use this account and restore the encrypted password afterwards.First:  Get the encrypted password as follows:
SQL:> select username, password from dba_users where username = &#8216;SIEBEL&#8216;;
You should get something like:
SIEBEL  D44B9B1E33343GF
Change account to another password eg SIEBEL3
SQL:> alter user SIEBEL [...]]]></description>
			<content:encoded><![CDATA[<p><a id="more-71"></a>Suppose you have an account called <strong>SIEBEL</strong>, whose un-encrypted password you don&#8217;t know, but want to temporarily use this account and restore the encrypted password afterwards.First:  Get the encrypted password as follows:</p>
<p>SQL:> select username, password from dba_users where username = &#8216;<strong>SIEBEL</strong>&#8216;;</p>
<p>You should get something like:</p>
<p><strong><em>SIEBEL  D44B9B1E33343GF</em></strong></p>
<p>Change account to another password eg <strong>SIEBEL3</strong></p>
<p>SQL:> alter user <strong>SIEBEL</strong> identified by <strong>SIEBEL3</strong>;</p>
<p>You can then use &#8220;connect as siebel/siebel3 &#8221; to connect to the database as that account.</p>
<p>To revert to the original password, do the following:<br />
SQL:> alter user <strong>SIEBEL</strong> identified by values &#8216;<strong><em>D44B9B1E33343GF</em></strong>&#8216;;</p>
<p>Your encrypted password is passed back
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=71</wfw:commentRSS>
		</item>
		<item>
		<title>Dropping an Oracle user &#038; Associated Objects</title>
		<link>http://blog.sylviacomputing.co.nz/?p=70</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=70#comments</comments>
		<pubDate>Mon, 11 Aug 2008 22:39:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>General</category>
	<category>Linux</category>
	<category>Oracle</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=70</guid>
		<description><![CDATA[On the Oracle SQL prompt type
delete user testuser cascade;

]]></description>
			<content:encoded><![CDATA[<p>On the Oracle SQL prompt type</p>
<p>delete user testuser cascade;
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=70</wfw:commentRSS>
		</item>
		<item>
		<title>Unlocking Oracle Account</title>
		<link>http://blog.sylviacomputing.co.nz/?p=69</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=69#comments</comments>
		<pubDate>Mon, 30 Jun 2008 02:23:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>General</category>
	<category>Linux</category>
	<category>Oracle</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=69</guid>
		<description><![CDATA[As system user:
SQL> alter user  account unlock;

]]></description>
			<content:encoded><![CDATA[<p>As system user:</p>
<p>SQL> <strong>alter user  account unlock;</strong>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=69</wfw:commentRSS>
		</item>
		<item>
		<title>Finding Oracle table owner and exporting tables with a parameter file</title>
		<link>http://blog.sylviacomputing.co.nz/?p=68</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=68#comments</comments>
		<pubDate>Fri, 27 Jun 2008 06:05:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Computing</category>
	<category>Linux</category>
	<category>Oracle</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=68</guid>
		<description><![CDATA[
To determine the owner of a table,  log onto the oracle database as the system user:
sqlplus system/

SQL> select owner from dba_tables where table_name like &#8216;%
%&#8217;;
this will return the table owner.
Parameter File
The parameter file can be called .par
If database name is stores, you may want to call your parameter file stores.par
Inside the parameter file it must [...]]]></description>
			<content:encoded><![CDATA[<p><a id="more-68"></a></p>
<p>To determine the owner of a table,  log onto the oracle database as the system user:</p>
<p><strong>sqlplus system/</p>
<password></strong></p>
<p>SQL><strong> select owner from dba_tables where table_name like &#8216;%</p>
<tablename_you_want_to_export>%&#8217;;</strong></p>
<p>this will return the table owner.</p>
<p>Parameter File</p>
<p>The parameter file can be called <strong><db_name>.par</strong></p>
<p>If database name is <strong>stores</strong>, you may want to call your parameter file <strong>stores.par</strong></p>
<p>Inside the parameter file it must have the format like shown below:</p>
<p><em><strong>tables=TABOWN.TABLE1, TABOWN.TAB</strong></em><em><strong>LE</strong></em><em><strong>2, TABOWN.TAB</strong></em><em><strong>LE</strong></em><em><strong>3, TABOWN.TAB</strong></em><em><strong>LE</strong></em><em><strong>4,</strong></em><em><strong> &#8230;, </strong></em><em><strong>TABOWN.TAB</strong></em><em><strong>LEn</strong></em><em><strong></strong></em><em><strong><br />
file=stores.dmp<br />
log=stores.log<br />
consistent=y</strong></em></p>
<p>The Export</p>
<p>Run the export as follows, from the command line</p>
<p style="font-weight: bold">exp system/</p>
<password>parfile=stores.par</p>
<p>You should get something like:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p style="font-style: italic">Export: Release 9.2.0.4.0 - Production on Fri Jun 27 17:41:07 2008</p>
<p>Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.</p>
<p>Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production<br />
With the Partitioning, OLAP and Oracle Data Mining options<br />
JServer Release 9.2.0.4.0 - Production<br />
Export done in US7ASCII character set and UTF8 NCHAR character set</p>
<p>About to export specified tables via Conventional Path &#8230;<br />
Current user changed to <strong>TABOWN</strong><br />
. . exporting table                       1746 rows exported<br />
. . exporting table                       <strong>TABLE1</strong>       1785 rows exported<br />
. . exporting table                       <strong>TABLE2</strong>       7203 rows exported<br />
. . exporting table                       <strong>TABLE3</strong>       9959 rows exported<br />
. . exporting table                       <strong>TABLE4</strong>       4371 rows exported<br />
. . exporting table                       <strong>TABLE5</strong>          0 rows exported</p>
<p style="font-style: italic">&#8230;&#8230;.</p>
<p><span style="font-style: italic">. . exporting table                       </span><em style="font-style: italic"><strong>TABLEn</strong></em><span style="font-style: italic">         0 rows exported</span><br style="font-style: italic" /><span style="font-style: italic">Export terminated successfully without warnings.</span><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=68</wfw:commentRSS>
		</item>
		<item>
		<title>Finding table owner and exporting tables with a parameter file</title>
		<link>http://blog.sylviacomputing.co.nz/?p=67</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=67#comments</comments>
		<pubDate>Fri, 27 Jun 2008 06:05:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Computing</category>
	<category>Linux</category>
	<category>Oracle</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=67</guid>
		<description><![CDATA[
To determine the owner of a table,  log onto the oracle database as the system user:
sqlplus system/

SQL> select owner from dba_tables where table_name like &#8216;%
%&#8217;;
this will return the table owner.
Parameter File
The parameter file can be called .par
If database name is stores, you may want to call your parameter file stores.par
Inside the parameter file it must [...]]]></description>
			<content:encoded><![CDATA[<p><a id="more-67"></a></p>
<p>To determine the owner of a table,  log onto the oracle database as the system user:</p>
<p><strong>sqlplus system/</p>
<password></strong></p>
<p>SQL><strong> select owner from dba_tables where table_name like &#8216;%</p>
<tablename_you_want_to_export>%&#8217;;</strong></p>
<p>this will return the table owner.</p>
<p>Parameter File</p>
<p>The parameter file can be called <strong><db_name>.par</strong></p>
<p>If database name is <strong>stores</strong>, you may want to call your parameter file <strong>stores.par</strong></p>
<p>Inside the parameter file it must have the format like shown below:</p>
<p><em><strong>tables=TABOWN.TABLE1, TABOWN.TAB</strong></em><em><strong>LE</strong></em><em><strong>2, TABOWN.TAB</strong></em><em><strong>LE</strong></em><em><strong>3, TABOWN.TAB</strong></em><em><strong>LE</strong></em><em><strong>4,</strong></em><em><strong> &#8230;, </strong></em><em><strong>TABOWN.TAB</strong></em><em><strong>LEn</strong></em><em><strong></strong></em><em><strong><br />
file=stores.dmp<br />
log=stores.log<br />
consistent=y</strong></em></p>
<p>The Export</p>
<p>Run the export as follows, from the command line</p>
<p style="font-weight: bold">exp system/</p>
<password>parfile=stores.par</p>
<p>You should get something like:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p style="font-style: italic">Export: Release 9.2.0.4.0 - Production on Fri Jun 27 17:41:07 2008</p>
<p>Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.</p>
<p>Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production<br />
With the Partitioning, OLAP and Oracle Data Mining options<br />
JServer Release 9.2.0.4.0 - Production<br />
Export done in US7ASCII character set and UTF8 NCHAR character set</p>
<p>About to export specified tables via Conventional Path &#8230;<br />
Current user changed to <strong>TABOWN</strong><br />
. . exporting table                       1746 rows exported<br />
. . exporting table                       <strong>TABLE1</strong>       1785 rows exported<br />
. . exporting table                       <strong>TABLE2</strong>       7203 rows exported<br />
. . exporting table                       <strong>TABLE3</strong>       9959 rows exported<br />
. . exporting table                       <strong>TABLE4</strong>       4371 rows exported<br />
. . exporting table                       <strong>TABLE5</strong>          0 rows exported</p>
<p style="font-style: italic">&#8230;&#8230;.</p>
<p><span style="font-style: italic">. . exporting table                       </span><em style="font-style: italic"><strong>TABLEn</strong></em><span style="font-style: italic">         0 rows exported</span><br style="font-style: italic" /><span style="font-style: italic">Export terminated successfully without warnings.</span><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=67</wfw:commentRSS>
		</item>
		<item>
		<title>Replacing comma-delimitation with new line using sed</title>
		<link>http://blog.sylviacomputing.co.nz/?p=66</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=66#comments</comments>
		<pubDate>Thu, 26 Jun 2008 05:44:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Computing</category>
	<category>Linux</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=66</guid>
		<description><![CDATA[
Ever had a text file in the following format:
test, test1, test2, test3
test4, test5, test6, test7
test8, test9, test10, &#8230;&#8230;
and you wanted to convert this to:
test1
test2
test3
&#8230;
test10
if your file is called test.txt, all you need to do is to type the following from command line
sed &#8217;s/,/\n/g&#8217; test.txt > test_new.txt
or
sed &#8217;s=,=\n=g&#8217; test.txt >  test_new.txt

]]></description>
			<content:encoded><![CDATA[<p><a id="more-66"></a></p>
<p>Ever had a text file in the following format:</p>
<p><em><strong>test, test1, test2, test3</strong></em></p>
<p><em><strong>test4, test5, test6, test7</strong></em></p>
<p><em><strong>test8, test9, test10, &#8230;&#8230;</strong></em></p>
<p>and you wanted to convert this to:</p>
<p><em><strong>test1</strong></em></p>
<p><em><strong>test2</strong></em></p>
<p><em><strong>test3</strong></em></p>
<p><em><strong>&#8230;</strong></em></p>
<p><em><strong>test10</strong></em></p>
<p>if your file is called test.txt, all you need to do is to type the following from command line</p>
<p>sed &#8217;s/,/\n/g&#8217; test.txt > test_new.txt</p>
<p>or</p>
<p>sed &#8217;s=,=\n=g&#8217; test.txt >  test_new.txt
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=66</wfw:commentRSS>
		</item>
		<item>
		<title>Changing/Resetting Linux account passwords en-masse</title>
		<link>http://blog.sylviacomputing.co.nz/?p=65</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=65#comments</comments>
		<pubDate>Thu, 26 Jun 2008 05:35:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Computing</category>
	<category>Linux</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=65</guid>
		<description><![CDATA[
Create a password file, call it, say  password.txt
Put in all the accounts with the appropriate passwords in the following format:
account:new_password 
If the password are in clear text, please protect the file to prevent unauthorised access.
As root type ass follows:
/usr/sbin/chpasswd < /path_to_password_file/password.txt
where   /path_to_password_file  is the path to the password file.
Enjoy!

]]></description>
			<content:encoded><![CDATA[<p><a id="more-65"></a></p>
<p>Create a password file, call it, say  password.txt</p>
<p>Put in all the accounts with the appropriate passwords in the following format:</p>
<p><strong>account:new_password </strong></p>
<p>If the password are in clear text, please protect the file to prevent unauthorised access.</p>
<p>As root type ass follows:</p>
<p>/usr/sbin/chpasswd < /<em><strong>path_to_password_file</strong></em>/password.txt</p>
<p>where   /<em><strong>path_to_password_file  </strong></em>is the path to the password file.</p>
<p>Enjoy!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=65</wfw:commentRSS>
		</item>
		<item>
		<title>Removing empty lines from an output or file with awk.</title>
		<link>http://blog.sylviacomputing.co.nz/?p=64</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=64#comments</comments>
		<pubDate>Thu, 22 May 2008 23:38:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Linux</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=64</guid>
		<description><![CDATA[awk &#8216;($1 ~ /[^ ]+/){print $0}&#8217; filename.txt
Where filename.txt is the name of the file you want to remove the empty lines from.

]]></description>
			<content:encoded><![CDATA[<p>awk &#8216;($1 ~ /[^ ]+/){print $0}&#8217; filename.txt</p>
<p>Where filename.txt is the name of the file you want to remove the empty lines from.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=64</wfw:commentRSS>
		</item>
		<item>
		<title>Processing Lines of text in a script</title>
		<link>http://blog.sylviacomputing.co.nz/?p=63</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=63#comments</comments>
		<pubDate>Thu, 11 Oct 2007 03:26:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Computing</category>
	<category>Linux</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=63</guid>
		<description><![CDATA[#!/bin/bash
SERVER_FILE=/home/garikait/alerts/results/servers.txt  ## Reference file
RESULTS=/home/garikait/alerts/results
## Initializing variables 
P1=0
P3=0
COUNT=1
## Number of lines in the reference file
LINES=`cat $SERVER_FILE &#124; wc -l`
## Process data until all items in the reference file are done.
while [ $COUNT -le $LINES ]
do
SERVER=`head -n $COUNT $SERVER_FILE  &#124;  tail -n 1`   ## Grab an appropriate line in the reference file
for [...]]]></description>
			<content:encoded><![CDATA[<p><a id="more-63"></a>#!/bin/bash</p>
<p>SERVER_FILE=/home/garikait/alerts/results/servers.txt  <strong>## Reference file</strong><br />
RESULTS=/home/garikait/alerts/results<br />
<strong>## Initializing variables </strong></p>
<p>P1=0<br />
P3=0<br />
COUNT=1</p>
<p><strong>## Number of lines in the reference file</strong></p>
<p>LINES=`cat $SERVER_FILE | wc -l`</p>
<p><strong>## Process data until all items in the reference file are done.</strong><br />
while [ $COUNT -le $LINES ]<br />
do<br />
SERVER=`head -n $COUNT $SERVER_FILE  |  tail -n 1`   <strong>## Grab an appropriate line in the reference file</strong><br />
for x in `cat $RESULTS/*.log.* | grep P1 |  grep $SERVER | gawk &#8216;{print $1}&#8217;` <strong>## Get number of P1 values in logfiles</strong><br />
do<br />
P1=`expr $P1 + $x`  <strong>## Increment the the total P1 value by the new value of p1</strong><br />
done<br />
for y in `cat $RESULTS/*.log.* | grep P3 |  grep $SERVER | gawk &#8216;{print $1}&#8217; ` <strong>## Get number of P3 values in logfiles</strong><br />
do<br />
P3=`expr $P3 + $y` <strong>## Increment the the total P3 value by the new value of p3</strong><br />
done</p>
<p><strong>## Give total P3 &#038; P1 occurrences per server, and put this in a text file</strong><br />
if [ $P3 -gt 3 ]; then echo &#8220;Server $SERVER P3_alerts $P3&#8243; >> summary_p3.txt; fi <strong /><br />
if [ $P1 -gt 3 ]; then echo &#8220;Server $SERVER P1_alerts $P1&#8243; >> summary_p1.txt; fi<br />
<strong>## Increment counter so we know where we are in the reference file</strong><br />
COUNT=`expr $COUNT + 1`</p>
<p><strong>## Re-initialize the P1 &#038; P3 values for the new server count, as the loop if repeated</strong><br />
P1=0<br />
P3=0<br />
done
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=63</wfw:commentRSS>
		</item>
		<item>
		<title>Changing file contents from Lower case to Uppercase</title>
		<link>http://blog.sylviacomputing.co.nz/?p=62</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=62#comments</comments>
		<pubDate>Thu, 11 Oct 2007 01:56:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>General</category>
	<category>Computing</category>
	<category>Linux</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=62</guid>
		<description><![CDATA[#!/bin/bash
set=-x
ORIG=/home/garikait/alerts/orig
PROCESSED=/home/garikait/alerts/processed
RESULTS=/home/garikait/alerts/results
PER_SERVER=/home/garikait/alerts/per_server
## Change file contents to lowercase
cd  $ORIG
for x in `ls $ORIG`
do
cat $x &#124;  tr [:upper:] [:lower:] > $x.1
mv $x  $PROCESSED/$x
done
## Get unique list of servers and use it to count for P1 &#038; P3 calls
for x in `ls $ORIG`
do
for server in `cat $x &#124;  gawk &#8216;{FS=&#8221; - &#8220;}{print $3}&#8217; &#124; sort [...]]]></description>
			<content:encoded><![CDATA[<p><a id="more-62"></a>#!/bin/bash<br />
set=-x<br />
ORIG=/home/garikait/alerts/orig<br />
PROCESSED=/home/garikait/alerts/processed<br />
RESULTS=/home/garikait/alerts/results<br />
PER_SERVER=/home/garikait/alerts/per_server<br />
## Change file contents to lowercase</p>
<p>cd  $ORIG<br />
for x in `ls $ORIG`<br />
do</p>
<p>cat $x |  tr [:upper:] [:lower:] > $x.1<br />
mv $x  $PROCESSED/$x<br />
done</p>
<p>## Get unique list of servers and use it to count for P1 &#038; P3 calls</p>
<p>for x in `ls $ORIG`<br />
do<br />
for server in `cat $x |  gawk &#8216;{FS=&#8221; - &#8220;}{print $3}&#8217; | sort -u  |  grep -v ok |  grep -v brownout`<br />
do<br />
P1_alerts=`cat $x | grep $server | grep -v brownout | grep p1 |  wc -l`<br />
P3_alerts=`cat $x | grep $server | grep -v brownout | grep p3 |  wc -l`<br />
SX_Ok_alerts=`cat $x | grep $server | grep -v brownout | grep ok |  wc -l`</p>
<p>## Only get P1 &#038; P3 calls per server if the calls are more than 3</p>
<p>if [ $P1_alerts -gt 3 ]; then  echo &#8220;$P1_alerts $server P1_alerts&#8221; >> $RESULTS/$x.res; fi<br />
if [ $P3_alerts -gt 3 ] ; then echo &#8220;$P3_alerts  $server  P3_alerts&#8221; >> $RESULTS/$x.res; fi<br />
#  if [ $SX_Ok_alerts -gt 3 ] ; then echo &#8220;$server  SX-OK_alerts  $SX_Ok_alerts&#8221; >> $RESULTS/$x.res; fi<br />
done<br />
mv $ORIG/$x $PER_SERVER/$x<br />
done</p>
<p>cd $RESULTS<br />
for servers in `ls *.res`; do cat $servers |  gawk &#8216;{print $2}` |  sort -u >> servers.tmp; done</p>
<p>cat servers.tmp |  sort -u  > servers.txt<br />
$RESULTS/per_server.sh
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=62</wfw:commentRSS>
		</item>
		<item>
		<title>Scripting -  the while loop</title>
		<link>http://blog.sylviacomputing.co.nz/?p=61</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=61#comments</comments>
		<pubDate>Thu, 09 Aug 2007 23:27:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Linux</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=61</guid>
		<description><![CDATA[<p>Funny how the while loop is sensitive to spacing around the square brackets. On extra space before, or within the bracket, then you get an error.</p>]]></description>
			<content:encoded><![CDATA[<p>Funny how the while loop is sensitive to spacing around the square brackets. An extra space before, or within the bracket, then you get an error.</p>
<p><a id="more-61"></a></p>
<p>Example of a working while loop.</p>
<p>===========</p>
<p>!/bin/sh</p>
<p>counter=1</p>
<p>while [ $counter -le 100 ]<br />
do</p>
<p>echo &#8220;This is counter = &#8221; $counter<br />
counter=`expr $counter + 1`</p>
<p>if [ $counter = 56 ]<br />
then echo &#8220;What a lot of fun. Quiting&#8221;; exit<br />
fi</p>
<p>done<br />
==============</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=61</wfw:commentRSS>
		</item>
		<item>
		<title>Linux User and Password Migration</title>
		<link>http://blog.sylviacomputing.co.nz/?p=60</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=60#comments</comments>
		<pubDate>Tue, 31 Jul 2007 02:53:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Linux</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=60</guid>
		<description><![CDATA[


Following files/dirs are required for traditional Linux user management:* /etc/passwd - contains various pieces of information for each user account
* /etc/shadow - contains the encrypted password information for user\u2019s accounts and optional the password aging information.
* /etc/group - defines the groups to which users belong
* /etc/gshadow - group shadow file (contains the encrypted password for [...]]]></description>
			<content:encoded><![CDATA[<p>
<a id="more-60"></a>
</p>
<p>Following files/dirs are required for traditional Linux user management:<br/>* /etc/passwd - contains various pieces of information for each user account</p>
<p>* /etc/shadow - contains the encrypted password information for user\u2019s accounts and optional the password aging information.</p>
<p>* /etc/group - defines the groups to which users belong</p>
<p>* /etc/gshadow - group shadow file (contains the encrypted password for group)</p>
<p>* /var/spool/mail - Generally user emails are stored here.</p>
<p>* /home - All Users data is stored here.</p>
<p>You need to backup all of the above files and directories from old server to new Linux server.<br/>Commands to type on old Linux system</p>
<p>First create a tar ball of old uses (old Linux system). Create a directory:<br/># mkdir /root/move/<br/>Setup UID filter limit:<br/># export UGIDLIMIT=500<br/>Now copy /etc/passwd accounts to /root/move/passwd.mig using awk to filter out system account (i.e. only copy user accounts)<br/># awk -v LIMIT=$UGIDLIMIT -F: &#8216;($3&gt;=LIMIT) &amp;&amp; ($3!=65534)&#8217; /etc/passwd &gt; /root/move/passwd.mig<br/>Copy /etc/group file:<br/># awk -v LIMIT=$UGIDLIMIT -F: &#8216;($3&gt;=LIMIT) &amp;&amp; ($3!=65534)&#8217; /etc/group &gt; /root/move/group.mig<br/>Copy /etc/shadow file:<br/># awk -v LIMIT=$UGIDLIMIT -F: &#8216;($3&gt;=LIMIT) &amp;&amp; ($3!=65534) {print $1}&#8217; /etc/passwd | tee - |egrep -f - /etc/shadow &gt; /root/move/shadow.mig<br/>Copy /etc/gshadow (rarely used):<br/># cp /etc/gshadow /root/move/gshadow.mig<br/>Make a backup of /home and /var/spool/mail dirs:<br/># tar -zcvpf /root/move/home.tar.gz /home<br/># tar -zcvpf /root/move/mail.tar.gz /var/spool/mail</p>
<p>Where,</p>
<p>* Users that are added to the Linux system always start with UID and GID values of as specified by Linux distribution or set by admin. Limits according to different Linux distro:<br/>o RHEL/CentOS/Fedora Core : Default is 500 and upper limit is 65534 (/etc/libuser.conf).<br/>o Debian and Ubuntu Linux : Default is 1000 and upper limit is 29999 (/etc/adduser.conf).<br/>* You should never ever create any new system user accounts on the newly installed Cent OS Linux. So above awk command filter out UID according to Linux distro.<br/>* export UGIDLIMIT=500 - setup UID start limit for normal user account. Set this value as per your Linux distro.<br/>* awk -v LIMIT=$UGIDLIMIT -F: \u2018($3&gt;=LIMIT) &amp;&amp; ($3!=65534)\u2019 /etc/passwd &gt; /root/move/passwd.mig - You need to pass UGIDLIMIT variable to awk using -v option (it assigns value of shell variable UGIDLIMIT to awk program variable LIMIT). Option -F: sets the field separator to : . Finally awk read each line from /etc/passwd, filter out system accounts and generates new file /root/move/passwd.mig. Same logic is applies to rest of awk command.<br/>* tar -zcvpf /root/move/home.tar.gz /home - Make a backup of users /home dir<br/>* tar -zcvpf /root/move/mail.tar.gz /var/spool/mail - Make a backup of users mail dir</p>
<p>Use scp or usb pen or tape to copy /root/move to a new Linux system.<br/># scp -r /root/move/* <a href="mailto:user@new.linuxserver.com:/path/to/location">user@new.linuxserver.com:/path/to/location</a><br/>Commands to type on new Linux system</p>
<p>First, make a backup of current users and passwords:<br/># mkdir /root/newsusers.bak<br/># cp /etc/passwd /etc/shadow /etc/group /etc/gshadow /root/newsusers.bak</p>
<p>Now restore passwd and other files in /etc/<br/># cd /path/to/location<br/># cat passwd.mig &gt;&gt; /etc/passwd<br/># cat group.mig &gt;&gt; /etc/group<br/># cat shadow.mig &gt;&gt; /etc/shadow<br/># /bin/cp gshadow.mig /etc/gshadow</p>
<p>Please note that you must use &gt;&gt; (append) and not &gt; (create) shell redirection.</p>
<p>Now copy and extract home.tar.gz to new server /home<br/># cd /<br/># tar -zxvf /path/to/location/home.tar.gz</p>
<p>Now copy and extract mail.tar.gz (Mails) to new server /var/spool/mail<br/># cd /<br/># tar -zxvf /path/to/location/mail.tar.gz</p>
<p>Now reboot system; when the Linux comes back, your user accounts will work as they did before on old system:<br/># reboot</p>
<p>Please note that if you are new to Linux perform above commands in a sandbox environment. Above technique can be used to UNIX to UNIX OR UNIX to Linux account migration. You need to make couple of changes but overall the concept remains the sam</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=60</wfw:commentRSS>
		</item>
		<item>
		<title>Mounting a Windows File Share from AIX 5.2 (&#038; higher)</title>
		<link>http://blog.sylviacomputing.co.nz/?p=57</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=57#comments</comments>
		<pubDate>Sun, 04 Feb 2007 23:46:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Computing</category>
	<category>Linux</category>
	<category>AIX</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=57</guid>
		<description><![CDATA[<p><font color="blue">First of all install the following fileset:<strong><font color="blue">bos.cifs_fs</font></strong></font></p>
<p>Once you have the fileset installed and CIFS running, use this command to create the mount point.</p>
<p><font color="blue"><strong># smitty communications</strong></font></p>
]]></description>
			<content:encoded><![CDATA[<p><a id="more-57"></a></p>
<p>First of all install the following fileset:<font color="blue"><strong>bos.cifs_fs</strong></font></p>
<p>Once you have the fileset installed and CIFS running, use this command to create the mount point.</p>
<p><font color="blue"><strong># smitty communications</strong></font></p>
<p>And mount the CIFS / SMB fileshare from there.</p>
<p>Only problem with this way is that if the share requires Windows domain credentials, you get stuck, as you need to add &#8220;wrkgrp=domain name&#8221;</p>
<p>You can use the command line syntax shown below to do that</p>
<p><font color="blue"><strong>mount -v cifs -n servername/username/password-owrkgrp=domainname,fmode=755 sharename /mount point</strong></font></p>
<p>To have the mount point survive a server reboot, add it to <font color="blue">/etc/rc.nfs</font> like this.<br />
<font color="blue"><strong>/usr/sbin/mount -v cifs -n servername/username/password -o wrkgrp=domain name,fmode=755 sharename /mount point<br /></strong></font></p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=57</wfw:commentRSS>
		</item>
		<item>
		<title>Remote tape backup on UNIX / Linux</title>
		<link>http://blog.sylviacomputing.co.nz/?p=56</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=56#comments</comments>
		<pubDate>Sun, 04 Feb 2007 18:01:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Computing</category>
	<category>Linux</category>
	<category>AIX</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=56</guid>
		<description><![CDATA[<p>Just this other day - I got a situation in which I needed to remote backup an LPAR (logical partition) on an IBM p520 server with IVM (Integrated Virtualization Management) installed.</p>]]></description>
			<content:encoded><![CDATA[<p><a class="poweredbyzoundry_link" href="http://www.zoundry.com" rel="nofollow"></a></p>
<p><a id="more-56"></a></p>
<p>Just this other day - I got a situation in which I needed to backup an LPAR (logical partition) on an IBM p520 server with IVM (Integrated Virtualization Management) installed.</p>
<p>Unlike in a VIOS (Virtual Input/Output Server) LPAR environment, you can not allocate (for now at least) a tape drive to an LPAR on the IVM.</p>
<p>A remote, secure, backup solution, through the IVM LPAR, that does not use NFS had to be devised, and this is how:</p>
<p><span style="TEXT-DECORATION: underline">Scenario</span>:</p>
<p>p520 with 2 LPARS: IVM &amp; Snowwhite (client LPAR)</p>
<p>- Tape on IVM.</p>
<p>- IVM LPAR running IOS 1.3.0</p>
<p>- Snowwhite LPAR running AIX 5.3</p>
<p>&nbsp;</p>
<p>
1. <strong><span style="TEXT-DECORATION: underline">Install ssh on Snowwhite</span></strong></p>
<p>Get the AIX Toolbox for Linux, and ftp the following packages to snowwhite in /tmp.</p>
<p>openssh.base, openssh.license &amp; openssh.man.en_US</p>
<p>Get the AIX 5.3 Expansion Pack CD and ftp the openssl-0.9.7g-1.aix5.1.ppc.rpm file to /tmp on Snowwhite.</p>
<p>Telnet onto Snowwhite and run:</p>
<p>rpm -ihv openssl-0.9.7g-1.aix5.1.ppc.rpm</p>
<p>smitty installp</p>
<p>Remember to install packages in /tmp.</p>
<p>&nbsp;</p>
<p>
<strong>2. Setup a backup account on the IVM LPAR</strong></p>
<p>Use the web-browser to create a user on the IVM LPAR, let&#8217;s call that user, bkpuser</p>
<p>Telnet /ssh onto the IVM LPAR and change the shell for bkpuser from rksh to ksh.</p>
<p><strong>3: Generate an ssh rsa public key so that you do not have to use a password everytime you want to access IVM via SSH for backup purposes.</strong></p>
<p>On Snowwhite, as root,</p>
<p># key-gen -t rsa</p>
<p>The rsa public key will be generated.</p>
<p>Ftp/Copy this key to /home/bkpuser/.ssh/authorized_keys2 file on the IVM server.</p>
<p><strong>4: Now the backup part</strong></p>
<p>Test the remote backup using:</p>
<p><em><span style="COLOR: #000080"><strong># tar -cpvf - /usr | ssh -l bkpuser ivm &#8220;/usr/bin/dd of=/dev/rmt0 obs=20b&#8221;<br /></strong></span></em></p>
<p><span style="COLOR: #000080"><strong><span style="COLOR: #000000">5: Now the restore part</span></strong></span></p>
<p><em>Suppose one of the files inside the backup is /tmp/openssh.base, restore as follows:</em></p>
<p><span style="COLOR: #000080"><strong><em>#ssh -l bkpuser ivm &#8220;dd if=/dev/rmt0 obs=20b&#8221; | tar -xpvf - /tmp/openssh.base</em></strong></span></p>
<p>&nbsp;</p>
<p>
<span style="COLOR: #000080"><strong><span style="COLOR: #000000">Cheers</span></strong></span></p>
<p><span style="COLOR: #000080"><strong><span style="COLOR: #000000">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</span></strong></span></p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=56</wfw:commentRSS>
		</item>
		<item>
		<title>Blogging Software  -  Zoundry software very good</title>
		<link>http://blog.sylviacomputing.co.nz/?p=55</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=55#comments</comments>
		<pubDate>Thu, 11 Jan 2007 23:18:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Computing</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=55</guid>
		<description><![CDATA[Tried a number of blogging clients.
Found the Zoundry software to be easier to use interms of uploading documents other than pictures.
I like uploading word and pdf documents to my blog. Blogdesk would not do it with ease.
Zoundry met all my expectations.
Folks there, if there is anyone with a better client, please just comment and paste [...]]]></description>
			<content:encoded><![CDATA[<p>Tried a number of blogging clients.</p>
<p>Found the Zoundry software to be easier to use interms of uploading documents other than pictures.</p>
<p>I like uploading word and pdf documents to my blog. Blogdesk would not do it with ease.</p>
<p>Zoundry met all my expectations.</p>
<p>Folks there, if there is anyone with a better client, please just comment and paste the link to it on this blog.</p>
<p>Cheers</p>
<p>Gary</p>
<p><br/>
<p><a href="http://blog.sylviacomputing.co.nz/zBlogWriter.exe" id="urn:zoundry:jid:zBlogWriter.exe" title="BlogWriter"/></p>
<p class="poweredbyzoundry">Powered by <a href="http://www.zoundry.com" class="poweredbyzoundry_link" rel="nofollow">Zoundry</a></p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=55</wfw:commentRSS>
		</item>
		<item>
		<title>Hamilton Service</title>
		<link>http://blog.sylviacomputing.co.nz/?p=50</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=50#comments</comments>
		<pubDate>Sat, 06 Jan 2007 16:37:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Church Activities</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=50</guid>
		<description><![CDATA[We rounded each other and headed for gospel church services in Hamilton at Bro Blessing&#8217;s place.
We had a good time of worship and fellowship. So sweet and good that we left Hamilton after 7pm.
Had the misfortune of getting a vehicle breakdown just after getting back to Auckland, in Takanini. Sister Rachel helped us to get [...]]]></description>
			<content:encoded><![CDATA[<p>We rounded each other and headed for gospel church services in Hamilton at Bro Blessing&#8217;s place.</p>
<p>We had a good time of worship and fellowship. So sweet and good that we left Hamilton after 7pm.</p>
<p>Had the misfortune of getting a vehicle breakdown just after getting back to Auckland, in Takanini. Sister Rachel helped us to get the vehicle towed home (God bless her!).</p>
<p>Apart from this mishap, we had a jolly good time.</p>
<p>Looking forward to more.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>A couple of songs:</p>
<p><a href="http://blog.sylviacomputing.co.nz/wp-content/uploads/2007/01/choruses1.pdf" id="urn:zoundry:jid:choruses.pdf" title="choruses.pdf">Gospel Choruses</a></p>
<p><a href="http://blog.sylviacomputing.co.nz/wp-content/uploads/2007/01/all_songs1.pdf" id="urn:zoundry:jid:all_songs.pdf" title="songs.pdf">Gospel songs</a></p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=50</wfw:commentRSS>
		</item>
		<item>
		<title>Men&#8217;s Fellowship end of year Dinner  -  Howick Club</title>
		<link>http://blog.sylviacomputing.co.nz/?p=49</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=49#comments</comments>
		<pubDate>Sun, 17 Dec 2006 11:42:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Men's Fellowship</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=49</guid>
		<description><![CDATA[Today the IRC Men&#8217;s Fellowhip had an end of year dinner at Howick Club (107 Botany Rd, Howick). About 40 men attended.
We had a good time of fellowship. People got to know each other more. New friendships were forged.
The food was just fantastic.
There was a resounding call for another such to be held in the [...]]]></description>
			<content:encoded><![CDATA[<p>Today the IRC Men&#8217;s Fellowhip had an end of year dinner at Howick Club (107 Botany Rd, Howick). About 40 men attended.</p>
<p>We had a good time of fellowship. People got to know each other more. New friendships were forged.<br />
The food was just fantastic.</p>
<p>There was a resounding call for another such to be held in the not too distant future. And I think I am in agreement with this motion.</p>
<p>Thanks to Bro. George for assisting with the arrangements through his membership in the club.</p>
<p>Brother Charles closed with a word of prayer.</p>
<p>Thanks to all the men that attended. Your support is appreciated.<br />
<em><font size="2"><strong><span class="hw"><font color="#003399">Psalms, chapter 133<br />
1 :  Behold, how good and how pleasant it is for brethren to dwell together in unity!<br />
2 :  It is like the precious ointment upon the head, that ran down upon the beard, even Aaron&#8217;s beard: that went down to the skirts of his garments;<br />
3 :  As the dew of Hermon, and as the dew that descended upon the mountains of Zion: for there the LORD commanded the blessing, even life for evermore. </font></span></strong></font></em></p>
<p>Fellow men in IRC, it&#8217;s your participation which make the difference!</p>
<p>Let&#8217;s continue to make a difference.<br />
Regards</p>
<p>Gary
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=49</wfw:commentRSS>
		</item>
		<item>
		<title>Miscellaneous AIX Stuff</title>
		<link>http://blog.sylviacomputing.co.nz/?p=48</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=48#comments</comments>
		<pubDate>Fri, 01 Sep 2006 21:21:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Computing</category>
	<category>AIX</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=48</guid>
		<description><![CDATA[Failed Hard Disks: AIX-devices_misc.txt
Mirroring Logical Volumes &#38; Striping: aix_lv_mirror_and_striping.txt
]]></description>
			<content:encoded><![CDATA[<p>Failed Hard Disks: <a id="AIX-devices_misc.txt" title="AIX-devices_misc.txt" href="http://blog.sylviacomputing.co.nz/wp-content/uploads/2006/09/AIX-devices_misc.txt">AIX-devices_misc.txt</a></p>
<p>Mirroring Logical Volumes &amp; Striping: <a id="aix_lv_mirror_and_striping.txt" title="aix_lv_mirror_and_striping.txt" href="http://blog.sylviacomputing.co.nz/wp-content/uploads/2006/09/aix_lv_mirror_and_striping.txt">aix_lv_mirror_and_striping.txt</a></p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=48</wfw:commentRSS>
		</item>
		<item>
		<title>Next Mens&#8217; Meeting</title>
		<link>http://blog.sylviacomputing.co.nz/?p=46</link>
		<comments>http://blog.sylviacomputing.co.nz/?p=46#comments</comments>
		<pubDate>Fri, 01 Sep 2006 18:58:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
	<category>Church Activities</category>
	<category>Men's Fellowship</category>
		<guid isPermaLink="false">http://blog.sylviacomputing.co.nz/?p=46</guid>
		<description><![CDATA[

 Next Men&#8217;s Meeting will be at Bro Ojisi&#8217;s place on Friday 15 September 2006 at 7.30pm in Dannemora.
e.t
]]></description>
			<content:encoded><![CDATA[<p>
<a id="more-46"></a></p>
<p> Next Men&#8217;s Meeting will be at Bro Ojisi&#8217;s place on Friday 15 September 2006 at 7.30pm in Dannemora.</p>
<p>e.t</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.sylviacomputing.co.nz/?feed=rss2&amp;p=46</wfw:commentRSS>
		</item>
	</channel>
</rss>

