Saturday, January 16, 2010
vmserver 2.0.2 ubuntu 9.10
VMware Server for Windows A05FN-F2R0Z-V9380-4T085
VMware Server for Linux AA4D0-F8D2G-U7JGM-4100H
I had problem in installing vmserver in ubuntu 9.10. This link helped me to fix the problem. While trying the patch, it was showing error for a specific patch file that i have downloaded manually and placed along with the attahcment given in the post.
it worked, have to see bringing up my vm images.
Friday, August 28, 2009
Ubuntu - hdmi, video, webcam
Not sure if that is a problem with operating system or the multimedia softwares, but I found mplayer supporting audio as well.
Following line has fixed hdmi audio for me.
mplayer -afm hwac3,hwdts, -ao alsa:device=hdmi -channels 2 file
Skype, web cam:
Web cam was not detected by skype on ubuntu (9.04). After searching on internet, installed gspcs-source, followed by a system restart.
sudo apt-get install gspca-source
Skype recognized my webcam and when ever I am on voice call with my skype contacts, I am able to share video through webcam.
Kopete, yahoo IM problem:
Kopete was not able to connect to Yahoo server. fix I found on internet is add subdomain "cn" in the server name (account preferences). this "cn.scs.msg.yahoo.com" one worked for me. the default port of 5050 is same.
kopete is not able to detect webcam. It needs jasper conversion utility installed. I tried to to install libjasper-progs, but it seems replaced by another one in the ubuntu repository.
Here is the line that worked for me.
sudo apt-get install libjasper-runtime
Tuesday, August 04, 2009
Low volumne in ubuntu
do the following:
sudo apt-get install gnome-alsamixer
after installing gnome-alsamixer run it, it pops up a UI. Increase the PCM value towards maximum.
try the sound now, you got it full right?
Wednesday, July 29, 2009
Linux /Ubuntu tomcat -> too many open files
How do I set the maximum number of files allowed to be open on a system
scenario: I am running 3 war files of magnolia CMS on local tomcat, third one is not getting deployed properly because of the "too many files" opened.
Resolution:
The current setting for maximum number of open files can be viewed with the command:
ulimit -n
This number indicates the maximum number of files normal users (i.e. non-root) can have open in a single session. Note that for the root user, ulimit -n will sometimes output 1024 even after following the procedure to increase the maximum number of open files. This won't effect root's ability to open large numbers of files, as only normal users are bound by this value.
To increase the maximum number of open files beyond the default of 1024, two changes to the system may be necessary. In these examples, we will increase the maximum number of open files to the arbitrary value of 2048. All changes need to be made by the root user and users will need to log out and log back in before the changes will take effect.
1. Configure the system to accept the desired value for maximum number of open files Check the value in /proc/sys/fs/file-max to see if it is larger than the value needed for the maximum number of open files:
# cat /proc/sys/fs/file-max
If the value isn't large enough, echo an appropriate number into the variable and add the change to /etc/sysctl.conf to make it persistent across reboots. If the number is already larger than the value you wish to use, skip to step 2.
# echo 2048 > /proc/sys/fs/file-max
and edit /etc/sysctl.conf to include the line:
fs.file-max = 2048
2. Set the value for maximum number of open files In the file /etc/security/limits.conf, below the commented line that reads
#
add this line:
* - nofile 2048
This line sets the default number of open file descriptors for every user on the system to 2048. Note that the "nofile" item has two possible limit values under the
The hard limit represents the maximum value a soft limit may have and the soft limit represents the limit being actively enforced on the system at that time. Hard limits can be lowered by normal users, but not raised and soft limits cannot be set higher than hard limits. Only root may raise hard limits.
When increasing file limit descriptors, you may want to simply double the value. For example, if you need to increase the default value of 1024, increase the value to 2048 first. If you need to increase it again, try 4096, etc.
Sunday, July 19, 2009
vmware keys not working on vmware server 2.0.1
as per the forum suggestion, i have appended the following lines to /etc/vmware/config file (sudo credentials required on ubuntu).
xkeymap.keycode.108 = 0x138 # Alt_R
xkeymap.keycode.106 = 0x135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0x148 # Up
xkeymap.keycode.116 = 0x150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0x152 # Insert
xkeymap.keycode.119 = 0x153 # Delete
xkeymap.keycode.110 = 0x147 # Home
xkeymap.keycode.115 = 0x14f # End
xkeymap.keycode.112 = 0x149 # Prior
xkeymap.keycode.117 = 0x151 # Next
xkeymap.keycode.78 = 0x46 # Scroll_Lock
xkeymap.keycode.127 = 0x100 # Pause
xkeymap.keycode.133 = 0x15b # Meta_L
xkeymap.keycode.134 = 0x15c # Meta_R
well, a short cut suggestion was adding the following line alone.
xkeymap.keycode.135 = 0x15d # Menu
But I pasted both of them, not sure which one caused the fix.
Tuesday, July 07, 2009
FTP problem - Asci converted binary data
As I read on this, ascii format means, it strips off 8th bit of every byte (this bit used for a special purpose flag). Restoration may not be possible.
See a sample, how I lost lot of data, print screen image of jetspeed tutorial page (in pdf)

Wednesday, July 01, 2009
Eclipse Too many open files fix
Fix is adding the following entry (to increase the open file count)
in configuration/config.ini
osgi.bundlefile.limit=100
Problem:
I got this exception
ZoneInfo: /usr/share/javazi/ZoneInfoMappings (Too many open files)
ZoneInfo: /usr/share/javazi/ZoneInfoMappings (Too many open files)
!SESSION 2009-07-01 20:47:34.805 -----------------------------------------------
eclipse.buildId=M20090211-1700
java.version=1.6.0_0
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_IN
Command-line arguments: -os linux -ws gtk -arch x86
!ENTRY org.eclipse.tptp.platform.examples 4 0 2009-07-01 20:47:39.058
!MESSAGE
!STACK 0
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.
at java.util.zip.ZipFile.
at org.eclipse.osgi.framework.util.SecureAction.getZipFile(SecureAction.java:251)
at org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.basicOpen(ZipBundleFile.java:81)
at org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.getZipFile(ZipBundleFile.java:94)
at org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.checkedOpen(ZipBundleFile.java:67)
at org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.getEntry(ZipBundleFile.java:239)
at org.eclipse.osgi.baseadaptor.BaseData.getEntry(BaseData.java:97)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getEntry(AbstractBundle.java:1310)
at org.eclipse.core.internal.registry.osgi.EclipseBundleListener.getExtensionURL(EclipseBundleListener.java:120)
at org.eclipse.core.internal.registry.osgi.EclipseBundleListener.addBundle(EclipseBundleListener.java:158)
at org.eclipse.core.internal.registry.osgi.EclipseBundleListener.processBundles(EclipseBundleListener.java:90)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.onStart(RegistryStrategyOSGI.java:210)
at org.eclipse.core.internal.registry.ExtensionRegistry.
at org.eclipse.core.runtime.RegistryFactory.createRegistry(RegistryFactory.java:59)
at org.eclipse.core.internal.registry.osgi.Activator.startRegistry(Activator.java:135)
at org.eclipse.core.internal.registry.osgi.Activator.start(Activator.java:56)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:265)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:427)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:193)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:370)
at org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
at org.eclipse.osgi.framework.internal.core.MultiSourcePackage.loadClass(MultiSourcePackage.java:31)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:443)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at org.eclipse.equinox.internal.app.Activator.start(Activator.java:55)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:265)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:427)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:193)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:370)
at org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:443)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
at org.eclipse.core.internal.runtime.PlatformActivator.startAppContainer(PlatformActivator.java:47)
at org.eclipse.core.internal.runtime.PlatformActivator.start(PlatformActivator.java:32)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:355)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1074)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:616)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:508)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:299)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:489)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:211)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:321)
(eclipse:30567): Pango-WARNING **: error opening config file '/etc/pango/pangorc': Too many open files
(eclipse:30567): Pango-WARNING **: error opening config file '/home/harinath/.pangorc': Too many open files
(eclipse:30567): Pango-CRITICAL **: No modules found:
No builtin or dynamically loaded modules were found.
PangoFc will not work correctly.
This probably means there was an error in the creation of:
'/etc/pango/pango.modules'
You should create this file by running:
pango-querymodules > '/etc/pango/pango.modules'
Fontconfig error: Cannot load default config file
(eclipse:30567): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'
Tuesday, June 23, 2009
Building portlets with Jetspeed 2.0
You can create a maven project with the custom archetype of jetspeed by following similar syntax as below.
mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.apache.portals.jetspeed-2 -DarchetypeArtifactId=jetspeed-archetype -DarchetypeVersion=2.2.0 -DartifactId=hello -Dpackage=com.springboard -DgroupId=com.springboard -Dversion=1.0-SNAPSHOT
You might come across an exception something like this
Caused by: java.lang.ClassNotFoundException: org.apache.jetspeed.tools.db.serializer.JetspeedSerializerApplicationImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.apache.jetspeed.maven.utils.Serializer.execute(Serializer.java:73)
... 19 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 seconds
the fix is that db plugin dependency is missing, I got rid of it by adding the dependency.
Do not forget to add repository (might be optional).
Tuesday, March 17, 2009
Unix command to uncompress
To extract the compressed tar archive target.tar.gz into the current working directory with:
gzip -dc target.tar.gz | tar xf -
If the file was compressed with bzip2 (i.e., .tar.bz2), you can substitute the bzip2 command for gzip.
If the archive was compressed with the UNIX compress command (archive ending in .Z) you can use:
zcat target.tar.Z | tar xf -
Tuesday, February 24, 2009
fix for sql injection
DECLARE @stringToFind VARCHAR(100)
DECLARE @stringToReplace VARCHAR(100)
DECLARE @schema sysname
DECLARE @table sysname
DECLARE @count INT
DECLARE @sqlCommand VARCHAR(8000)
DECLARE @where VARCHAR(8000)
DECLARE @columnName sysname
DECLARE @object_id INT
SET @stringToFind = '<
SET @stringToReplace = ''
DECLARE TAB_CURSOR CURSOR FOR
SELECT B.NAME AS SCHEMANAME,
A.NAME AS TABLENAME,
A.OBJECT_ID
FROM sys.objects A
INNER JOIN sys.schemas B
ON A.SCHEMA_ID = B.SCHEMA_ID
WHERE TYPE = 'U'
ORDER BY 1
OPEN TAB_CURSOR
FETCH NEXT FROM TAB_CURSOR
INTO @schema,
@table,
@object_id
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE COL_CURSOR CURSOR FOR
SELECT A.NAME
FROM sys.columns A
INNER JOIN sys.types B
ON A.SYSTEM_TYPE_ID = B.SYSTEM_TYPE_ID
WHERE OBJECT_ID = @object_id
AND IS_COMPUTED = 0
AND B.NAME IN ('char','nchar','nvarchar','varchar','text','ntext')
OPEN COL_CURSOR
FETCH NEXT FROM COL_CURSOR
INTO @columnName
WHILE @@FETCH_STATUS = 0
BEGIN
SET @sqlCommand = 'UPDATE ' + @schema + '.' + @table + ' SET [' + @columnName + '] = REPLACE(convert(nvarchar(max),[' + @columnName + ']),''' + @stringToFind + ''',''' + @stringToReplace + ''')'
SET @where = ' WHERE [' + @columnName + '] LIKE ''%' + @stringToFind + '%'''
EXEC( @sqlCommand + @where)
SET @count = @@ROWCOUNT
IF @count > 0
BEGIN
PRINT @sqlCommand + @where
PRINT 'Updated: ' + CONVERT(VARCHAR(10),@count)
PRINT '----------------------------------------------------'
END
FETCH NEXT FROM COL_CURSOR
INTO @columnName
END
CLOSE COL_CURSOR
DEALLOCATE COL_CURSOR
FETCH NEXT FROM TAB_CURSOR
INTO @schema,
@table,
@object_id
END
CLOSE TAB_CURSOR
DEALLOCATE TAB_CURSOR
Wednesday, February 04, 2009
Apache MyFaces Trinidad
My team is exploring the use of JSF into one of our applications.
We had smooth sail until we decided to use trinidad components. We wanted to have out of box support for the features we wanted to build into application and tomahawk and trinidad seem to be the way to go.
Some of the dependencies we had in our project POM file(related with myfaces and trinidad) are
Contents of web.xml
org.apache.myfaces.trinidad.webapp.TrinidadFilter
org.apache.myfaces.trinidad.webapp.ResourceServlet
faces-config.xml content is
org.springframework.web.jsf.DelegatingVariableResolver
org.apache.myfaces.trinidad.core
Eclipse design time didnt handle trinidad tags properly (no UI rendering for tr components),but it worked fine.
What I needed was to select rows in table using radio button option. It looks simple functionality but always it created problem. I remember doing some custom java script implementation to handle it, then we had difficult time even in .Net development. Now in java also we spent few days in fixing some very basic issue.
It is not technology which need to be blamed all the time. if we started with the formal instructions, it would have been very easy for us.
VMWare Server 2.0 on Ubuntu - Guest windows 2003 server
As my laptop (inspiron 1525) runs with Ubuntu, I have downloaded vmware server 2.0 (available for free from vmware site). And then installed windows 2003 on it.
Few issues and how I resolved it.
1. default windows desktop size was very small.
fix: increase the resolution, and it made my windows desktop to use full laptop screen.
2. Login problem:
I was not able to send Ctrl+Alt+Del signal after installing it, but then some one on internet suggested to try
Ctrl+Alt+ PrintScrn combination, it worked.
3. Keyboard problem: Del button and arrow keys were not working. probably some other keys were too not working. down arrow was behaving as if it is the windows button, and backspace was working as del button. Yes I had no way of backspacing my text.
Fix: I followed this link and found the fix working.
I tried solution 3 mentioned in the blog post.
i.e login as root and execute 'echo "xkeymap.nokeycodeMap = true" >> ~/.vmware/config'
It worked for me. Yes it is not the typical sudo. sudo didnt work for me (also mentioned in the article). Opened new shell and logged in as root. then executed this command.
Surprising, it worked. now I am very much comfortable in the vmware win2k3 image.
Yes, as it is free ware, vmware might have left some known issues along with it. But then I am able to solve the issues in front of me.
Now, I can stick to Ubuntu and occassionally use windows by vmware server web console for specific needs.
I am happy.
Wednesday, January 21, 2009
JOSSO 1.8
Here is the log of what I have done.
Follow instructions from
http://www.josso.org/confluence/display/JOSSO1/Quick+Start
there is some confusion here, as the article talks of using commands to install josso, but the downloaded file is not having the stuff related with the documentation.
Download Josso 1.8 release from sourceforge.net download lcoation.
http://sourceforge.net/project/showfiles.php?group_id=116854&package_id=129496&release_id=653379
you can download the .tgz file which is around 42MB. this contains josso-gsh shell, which can be used to deploy the war file (documents on josso confluence site use this shell to deploy, it took a while for me to identify which file has this gsh file)
gateway install --target "D:/servers/Tomcat 6.0" --platform tc60
Either you can do this or download the tomact version and use it directly/build from source and use it.
in case if you need any further information best option is to google and if the josso site pages are not coming properly (in my case its getting timedout) then read the google cache.
As the 1.8 release happened almost a week back, we might face problems in setting up things propely, more help might come into internet in the comming weeks.
Thursday, January 15, 2009
Friday, January 02, 2009
Open source alternatives for visio
There seem to be 2 of them as proper alternatives(dia and drawing of open office), but dia leads the way because of the similarity with visio and certain special objects which make it better in casual designing. http://projects.gnome.org/dia/.
Check the URL for more details. It is a wondeful contribution by Free Software Foundation.
Wednesday, December 31, 2008
Maven
In case if you want to start with maven, and looking for a starting point, Download latest maven (comes as a zip file, unzip it) and set your PATH environment variable to bin folder.
Now type "mvn archetype:generate" it lists out possible project types available. the follow up steps are self explanatory.
If you are looking for a specific project type (like a simple web application with springs configured etc), you might need to google for it. With little bit of effort you will get to find proper archtypes.
One problem I faced with maven POM (Project Object Model) files is with specific dependencies (jar files) which are not at all available on internet. I resolve them by creating similar structure locally and getting the near best possible jar file (yes I create folder strtucture, file name as required).
Tuesday, December 30, 2008
RESTful web services
RESTful web services offer simplest solution, making same HTTP protocol used for web services as well.
There are 2 important aspects in RESTful services.
1. Web method
2. Scope
When we use standard web services, web service method name is very important. RESTful removes this overhead. Just use the standard HTTP GET, POST,PUT,DELETE etc methods for any transaction.
Scope of the request is similar to the query string logic of HTTP. Query string must be able to define the scope of a client request, on what he needs to be done.
I will post more about it as and when I get time.
Saturday, December 27, 2008
Sify broadband from Ubuntu/Kubuntu
Download the client from the location http://202.144.65.70:8090
When I clicked the link for linux, it opened up a PDF file with the details. look for the li. for ux client link http://202.144.65.70:8090/bbandclient_v30/sify_bbclient-3.0.tar.gz
then execute the following commands (after downloading the file).
gunzip sify_bbclient-3.0.tar.gz
tar -xvf sify_bbclient-3.0.tar
From the exploded location, execute install.sh
execute sudo ./install.sh
gksudo ln -s /usr/lib/libcrypto.so /usr/lib/libcrypto.so.4
gksudo ln -s /usr/lib/libssl.so /usr/lib/libssl.so.4
now, you can execute "sifyconnect" command from terminal and it pops up sify bb client.
Make sure you call sify customer care to register your system/laptop physical address so as you can connect without any problem.
Saturday, June 02, 2007
killing oracle session
from v$session s,v$process p
where s.paddr = p.addr
and s.username is not null;
This will return the database username, the operating system username, the session id, the serial number, and the system process id (SPID). Then, a DBA user can issue the following (using the SID and SERIAL# information from the previous query):
ALTER SYSTEM KILL SESSION 'sid,serial#';
ALTER SYSTEM KILL SESSION '9,203';
Wednesday, February 14, 2007
disabling browser back button
I am too interested how we can do this.
Oftent he problem is that after logout, if user clicks back in the browser and is able to see content, this is not expected. there will be many advantages if we can disable back button especially when we require it.
Cache control:
one of the best and easiest way to handle issues popup because of clicking back button is to set no cache for the pages.
setting no cache:
You can use client-side code to force the user's browser to not cache a Web page.
<html>
<head>
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
</head>
There are a couple things to keep in mind when using the above method to force a browser to not
cache a Web page:
Pragma: no-cache
prevents caching only when used over a secure connection.
APragma: no-cache
META tag is treated identically toExpires: -1
if used in a
non-secure page. The page will be cached but marked as immediately expired.Cache-Control
METAHTTP-EQUIV
tags are ignored and have no effect in Internet
Explorer versions 4 or 5.
You can use both in your code. I tried this but this was not the solution because it did not work in all the
browsers so I guess if one had an intranet environment where there was some control in place then they could
use this method.
Javascript
My next area of research focused on the various rewiring the back button suggestions. An article by TJ
Sylvester, Rewiring the Back Button, makes interesting reading but I
noticed that when one clicks back it does not indeed take you to the page you entered the data but if I
clicked back twice it does and we would not want that too. Basically a determined user could always figure
out a way to circumvent the preventative measures.
Another way to "disable the back button" is to use client-side JavaScript code to open a new window that
doesn't have the toolbar. (This makes it harder (not impossible) for the user to go back to the previous
page.)
Another, more failsafe approach (although quite annoying) is, when a form is submitted, to open a new window
and close the window that the form existed in. I didn't give this method serious thought because
I would not like my site opening up a new window everytime a user submitted a form.
Next I examined the possibility of adding client-side JavaScript code on the page that we do not want to let
the user return to. Such JavaScript code could be used to have the effect of hitting the forward button, which would
counter any action by a user clicking the back button. The JavaScript code to accomplish this can be seen below:
|
Again this is workable but it is far from the best way.
I was then given the suggestion to use location.replace
to navigate form one page to another.
What this does is it replaces the current history entry with the new page so only one page will be maintained
in the history and the back button will never get enabled. This is, I guess, what a lot of people are looking
for, but again this would not be the best answer in all cases.
For one thing you will have to use client side script for this. For an anchor tag this will be easy by just
using:
|
The above technique has its disadvantages: simply using Response.Redirect
will not work, since,
each time a user jumps from one page to another, you need to clear out the location.history
field
through client-side code. Also, keep in mind that this will just remove the last history entry, not all
of them. Go ahead and click the above hyperlink, you will be taken to a simple HTML page. Try clicking the back button
and you will notice you will be taken to the page you were visiting before you came to this page! (Assuming,
of course, you have client-side JavaScript code enabled in your browser.)
After my exhaustive search I found that there is still no way of truly disabling the back button for all cases.
All the methods I discussed in this article will, with varying degrees of success, prevent the
user from viewing the previous page, but they, of course, all have their limitations. The best solution involves
a mixture of both client-side and server-side script; regardless, there is no way to completely disable the back
button
JSP
%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
%>
ASP.NET
Response.CacheControl = "no-cache";
Proxy Server Caching-
Response.CacheControl = "private";
It disables the proxy server caching and page is cached on local machine.
Response.CacheControl = "public";
Proxy server cache is enabled.
Users request pages from a local server instead of direct from the source.