Tuesday, July 29, 2008

Favicon's in a SharePoint 2007


There are many ways to add Favicons in the sharepoint , one of the way you can do that is by changing the Default Master Page. Follow this link to the guide on doing this.
http://www.sharepointblogs.com/mossman/archive/2008/01/18/favicon-s-in-a-sharepoint-master-page.aspx

Another way, is to add the Favicons, to the root directory of your website. e.g. in the C:\Inetpub\wwwroot\wss\VirtualDirectories\80 , where this is the virtual directories of the 80.

For some sharepoint website that you have difficulty in doing the above, another way is to changed the default.asp of your sharepoint which is not recommended.
To changed the page , goto C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\PMD . where the PMD is my directory website that i want to add the favicons. e.g. www.test.com/PMD

Backup the default.aspx and add the following in the asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" after the script tag and put the favicon image into your C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\PMD\IMAGES


link rel="icon" href="/_Layouts/PMD/Images/favicon.ico" type="image/png">
link rel="shortcut icon" href="/_Layouts/PMD/Images/favicon.ico" type="image/png">


Sunday, July 20, 2008

Problem :Communication from the Oracle Management Service host to the Agent host failed.

When the oracle enterprise manager able to see the agent is up and you can see that the performance metric but with some error "Communication from the Oracle Management Service host to the Agent host failed."

You need to reconfigure the agent to rediscover the OEM.

In windows , agentctl -d (rediscover)

Amended :-
it should be agentca -d

Thursday, July 10, 2008

Discovering IAS failed if the agent is install under another OS user than ias

Recently i have encounter this problem, where if the oracle agent is install as a different user other than IAS user then it is unable to discover the application server.

To resolve it :-

iAS Discovery/Monitoring Fails If Agent Is Installed Under Another OS User Than iAS,
metalink note 437078.1.

Problem: Agent Does Not Discover Other ORACLE_HOME´s, metalink note :371539.1

1) As Ias user:-
cd $IAS_HOME
chmod g+rx $IAS_HOME
chmod g+rx $IAS_HOME/bin
chmod g+rx $IAS_HOME/bin/emtgtctl
chmod ug+s $IAS_HOME/bin/emtgtctl2
chmod g+rx $IAS_HOME/perl
chmod g+rx $IAS_HOME/perl/bin
chmod g+rx $IAS_HOME/perl/bin/perl
chmod g+rx $IAS_HOME/sysman
chmod g+rx $IAS_HOME/sysman/emd
cmod g+rw $IAS_HOME/sysman/emd/targets.xml
touch $IAS_HOME/sysman/emd/centralagents.lst
chmod g+rw $IAS_HOME/sysman/emd/centralagents.lst
chmod g+rx $IAS_HOME/sysman/config
chmod g+rw $IAS_HOME/sysman/config/*.properties
chmod g+rx $IAS_HOME/opmn
chmod g+rx $IAS_HOME/opmn/conf
chmod g+rw $IAS_HOME/opmn/conf/opmn.xml
chmod g+rx $IAS_HOME/config
chmod g+rw $IAS_HOME/config/*.xml
chmod g+rw $IAS_HOME/config/*.properties
chmod g+rx $IAS_HOME/Apache
chmod g+rx $IAS_HOME/Apache/Apache
chmod g+rx $IAS_HOME/Apache/Apache/conf
chmod g+rw $IAS_HOME/Apache/Apache/conf/*conf
chmod g+rw $IAS_HOME/Apache/Apache/conf/*.xml
chmod g+rw $IAS_HOME/Apache/Apache/conf/mime.types
For each OC4J (in this example OC4J_SECURITY):
chmod g+rx $IAS_HOME/j2ee
chmod g+rx $IAS_HOME/j2ee/OC4J_SECURITY
chmod g+rx $IAS_HOME/j2ee/OC4J_SECURITY/config
chmod g+rw $IAS_HOME/j2ee/OC4J_SECURITY/config/*
chmod g+rx $IAS_HOME/dcm
chmod g+rx $IAS_HOME/dcm/config
chmod g+rw $IAS_HOME/dcm/config/*.conf
chmod g+rw $IAS_HOME/dcm/config/*.xml

2) as emagent os user
cd $AGENT_HOME
chmod g+rx $AGENT_HOME
chmod g+rx $AGENT_HOME/bin
chmod g+rx $AGENT_HOME/bin/emtgtctl
chmod ug+s $AGENT_HOME/bin/emtgtctl2
chmod g+rx $AGENT_HOME/sysman
chmod g+rx $AGENT_HOME/sysman/emd
chmod g+rw $AGENT_HOME/sysman/emd/targets.xml
chmod g+rx $AGENT_HOME/sysman/opmn
chmod g+rx $AGENT_HOME/sysman/opmn/conf

3) stop and start the agent
emctl stop agent
emctl start agent

4) initialize new discovery through the enterprise manager.

To check the log files , check in the /sysman/log/ emagent.trc & emagent_perl.trc.

Other than that, ensure that the /etc/oratab contains the path to both of the oracle home.

Wednesday, July 02, 2008

Caught by SQL injection

At work i have encounter a sql injection that inject a javascript into the database that will cause website to download the js javascript.

For more information, can take a look at this SQL Injection: More of the same (http://isc.sans.org/diary.html?storyid=4565)

I have tighten the security by disabling the selecting of the sysobjects from public, which will mitigate the risk.

To reverse the changes i use this sql to reversed out the changes:-




DECLARE @T varchar(255)
declare @C1 varCHAR(255)

DECLARE Table_Cursor
CURSOR FOR SELECT a.name,b.name FROM sysobjects a,syscolumns b
WHERE a.id=b.id AND a.xtype='u' AND
(b.xtype=99 OR b.xtype=35 OR b.xtype=231 OR b.xtype=167)

OPEN Table_Cursor

FETCH NEXT FROM Table_Cursor INTO @T,@C1

WHILE(@@FETCH_STATUS=0)

BEGIN

EXEC('update ' + @T + ' set ' + @C1 + '= substring(' + @c1+ ',1, CHARINDEX (''< script'',' +@C1 +')-1) where charindex(''< script'',' + @C1 + ') >0')
print 'update ' + @T + ' set ' + @C1 + '= substring(' + @c1+ ',1, CHARINDEX (''< < script'',' +@C1 +')-1) where charindex(''< script'',' + @C1 + ') >0'

FETCH NEXT FROM Table_Cursor INTO @T,@C1
END

CLOSE Table_Cursor
DEALLOCATE Table_Cursor