by http://webgeektutorials.blogspot.com
Showing posts with label Tips. Show all posts
Showing posts with label Tips. Show all posts

Tuesday, July 10, 2012

Reload / Refresh Page in jQuery

Here is the code to refresh the page when u click on a button component. Its just like you press "F5" button to refresh page.
=======================Code begins =========================
<!doctype html>
<html lang="en-us">
<head>
<title>Reload/Refresh a Page in jQuery</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"> </script>

<script type="text/javascript">
$(document).ready(function() {
$('#Refresh').click(function() {
$("p").append("<strong>Now Refreshing page..</strong>");
location.reload();
});
});
</script>

Thursday, June 28, 2012

Oracle DBA script: Display hit ratio on Dictionary Cache

Increase Shared pool size to reach a 90% hit ratio on Dictionary Cache. Entries for dc_table_grants, d_user_grants, and dc_users should be under 5% each in the MISS RATE % column

Code: 
select
parameter,gets,Getmisses ,
getmisses/(gets+getmisses)*100 "miss ratio",
(1-(sum(getmisses)/ (sum(gets)+sum(getmisses))))*100 "Hit ratio"
from v$rowcache
where gets+getmisses <>0
group by parameter, gets, getmisses ;

Thursday, June 21, 2012

Check DirectX version with DirectX Diagnostic Tools in Windows

How to detect DirectX version installed in Windows.

Microsoft DirectX is a group of technologies designed to make Windows-based PCs an ideal platform for running and displaying applications rich in multimedia elements such as full- color graphics, 3D animation, video and rich audio.

DirectX includes security and performance updates, along with many new features across all technologies, which can be accessed by applications using the DirectX APIs.

Monday, May 21, 2012

jQuery: Disable context menu on right click

Using jQuery you can disable context menu when you right click on any HTML page. To do so add a very small   script in <HEAD> section of HTML page after linking it to jQuery.

Here is the script : 

<script type="text/javascript">
 $(function(){
 $("form").form();
 $(this).bind("contextmenu", function(e) {
e.preventDefault();
 });
});
</script> 

Friday, February 17, 2012

Data Pump in Oracle Database 10g

Oracle Data Pump is a newer, faster and more flexible alternative to the "exp" and "imp" utilities used in previous Oracle versions. In addition to basic import and export functionality data pump provides a PL/SQL API and support for external tables.

Getting Started

For the examples to work we must first unlock the SCOTT account and create a directory object it can access:
CONN sys/password@db10g AS SYSDBA
ALTER USER scott IDENTIFIED BY tiger ACCOUNT UNLOCK;
GRANT CREATE ANY DIRECTORY TO scott;
 
CREATE OR REPLACE DIRECTORY test_dir AS '/u01/app/oracle/oradata/';
GRANT READ, WRITE ON DIRECTORY test_dir TO scott;

Table Exports/Imports

The TABLES parameter is used to specify the tables that are to be exported. The following is an example of the table export and import syntax:
expdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR 
dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log
 
impdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR 
dumpfile=EMP_DEPT.dmp logfile=impdpEMP_DEPT.log


For example output files see expdpEMP_DEPT.log and impdpEMP_DEPT.log.

The
TABLE_EXISTS_ACTION=APPEND parameter allows data to be imported into existing tables.

Schema Exports/Imports

The OWNER parameter of exp has been replaced by the SCHEMAS parameter which is used to specify the schemas to be exported. The following is an example of the schema export and import syntax:
expdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR 
dumpfile=SCOTT.dmp logfile=expdpSCOTT.log
 
impdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR 
dumpfile=SCOTT.dmp logfile=impdpSCOTT.log
For example output files see expdpSCOTT.log and impdpSCOTT.log.

Friday, January 6, 2012

SQL Server database : Regular maintenance

If you are a DBA it is very important for you to know maintenance plan in SQL Server. Generally we use SQL Enterprise Manager to perform regular maintenance of SQL database.

The information below does not cover everything you can do to maintain your SQL database in SQL Enterprise Manager. Before you must See your SQL documentation for details on what else you can do to maintain your database.

Backing up the transaction log is not compatible with simple recovery. If you have multiple databases with different recovery models, you can create separate database maintenance plans for each recovery model. In this way you can include a step to backup your transaction logs only on the databases that do not use the simple recovery mode.

Change recovery model to simple

Simple recovery mode is recommended because it prevents the transaction logs from swelling. In simple recovery, once a checkpoint is complete, the transaction logs for the time before the checkpoint are dropped from the active database. A checkpoint automatically occurs when the backup is made. We recommend having a database maintenance plan that performs a backup of the ePO database, together with "Simple Recovery". In this way, once a backup is successfully created, the portion of the transaction log in the active database will be dropped as it is no longer needed since a backup file exists.

Friday, December 23, 2011

TOP 5 Sql Server Scripts


/* 1 -------------------------------Script------------------------------

This script captures CPU Utilization Percent using TSQL. It uses system functions @@CPU_BUSY and @@IDLE
to see what is the CPU Utilization % at a particular instant. You can then use this number in a table or variable
to trigger other events.


@@CPU_BUSY  shows the time SQL Server has been busy
@@IDLE shows the time SQL Server has been idle


--------------------------------------------------------------------*/


DECLARE @CPU_BUSY int
DECLARE @IDLE int

SELECT @CPU_BUSY = @@CPU_BUSY, @IDLE = @@IDLE

WAITFOR DELAY '000:00:01'

SELECT
(@@CPU_BUSY - @CPU_BUSY)/((@@IDLE - @IDLE + @@CPU_BUSY - @CPU_BUSY) * 1.00) *100 AS CPU_Utilization_Pct

Wednesday, December 21, 2011

2 Nodes RHEL6 Cluster Configuration

Step by Step 2 Nodes RHEL6 Cluster Configuration

Virtual Lab Environment
1.    Two Nodes
2.    SAN Storage Server (software iscsi-taget)


Two Nodes
1.    Rhelsrv1
      OS: RHEL6 Server
       IP :172.168.100.101
Iscsi-initiator – iscsi-client

2.    Rhelsrv2
      OS: RHEL6
      IP : 192.168.100.102
Iscsi-client

3.    Client1
       OS: RHEL6 Desktop
        IP : 172.168.100.103

4.    Cluster Name: iscsicluster
        IP : 172.168.100.200

Required Software
Set up yum repo in all three nodes
From Vbox interface , attach rhel6 iso as cdrom and reboot the VMs.
Mount /dev/sr0 /media
/etc/yum.repos.d/rhel6dvd.repo
[Server]
name=Server
baseurl=file:///media/rhel6/Server
enabled=1
gpgcheck=0
[HighAvailability]
name=HighAvailability
baseurl=file:///media/HighAvailability
enabled=1
gpgcheck=0
[LoadBalancer]
name=LoadBalancer
baseurl=file:///media/LoadBalancer
enabled=1
gpgcheck=0
[ScalableFileSystem]
name=ScalableFileSystem
baseurl=file:///media/ScalableFileSystem
enabled=1
gpgcheck=0

Install Python3 on RHEL

One of my frined was facing trouble while installing Python3 on RHEL. I followed the following steps to install it on RHEL:

One thing i would like to say,It is very easy to install  manually:

STEPS :

1. To download python3 Download:

wget http://www.python.org/ftp/python/3.2.2/Python-3.2.2.tar.bz2

2. Now Unzip

bzip2 -cd Python-3.2.2.tar.bz2 | tar xvf -

3. Its time to Prepare compilation

./configure

4. Now start Build

make

5. start Installation

make install

Happy installing :)

Monday, October 24, 2011

Facebook tips: Secure Facebook

As per alexa.com, Facebook is the world number 1 most popular social networking site, and its world wide ranking is 2nd after google.com. It stores our personal data like contact info, images etc. and now it is your open ID, So it becomes necessary to secure our accounts.

Facebook provides HTTPS secure browsing by default. If you use HTTPS browsing, all the data shared between your web browser and Facebook server will be in encrypted.













How to enable https in facebook: ( in simple 4 steps )


Friday, August 5, 2011

Javascript to get URL of page

In my project, today i need to get the URL of the page, i used a small Javascript to implement it. In Javascript location object contains information about the current URL. It is supported by all the major browsers.
The location object is part of the window object and is accessed through the window.location property. Quite simple script to do this is :


<script language="javascript" type="text/javascript">
    document.write (document.location.href);
</script>

Properties of Location Object
 hash  Returns the anchor portion of a URL
 host  Returns the hostname and port of a URL
 hostname  Returns the hostname of a URL
 href  Returns the entire URL
 pathname  Returns the path name of a URL
 port  Returns the port number the server uses for a URL
 protocol  Returns the protocol of a URL
 search  Returns the query portion of a URL

Note : Please note that this won't work if you are using frames in your page.

Thursday, June 16, 2011

Facebook google : Wanna chat in Hindi?

Here is a small script you can bookmark in your browser. After it Open facebook and then just clicking on the bookmark will enable you typing in Hindi... To disable typing in Hindi just click on bookmark again.

javascript:(t13nb=window.t13nb||function(l){var t=t13nb,d=document,o=d.body,c="createElement",a="appendChild",w="clientWidth",i=d[c]("span"),s=i.style,x=o[a](d[c]("script"));if(o){if(!t.l){t.l=x.id="t13ns";o[a](i).id="t13n";i.innerHTML="Loading transliteration";s.cssText="z-index:99;font-size:18px;background:#FFF1A8;top:0";s.position=d.all?"absolute":"fixed";s.left=((o[w]-i[w])/2)+"px";x.src="http://t13n.googlecode.com/svn/trunk/blet/rt13n.js?l="+l}}else setTimeout(t,500)})('hi');

Ok , here i'm gonna tell you how to add a bookmark in Chrome and Firefox 4 in 3-4 easy steps.

Wednesday, May 18, 2011

Active Record - Save without callbacks

p = Post.first

p.title = "test"

p.send(:update_without_callbacks)



for sharing this information..

Thursday, April 7, 2011

CSS: Word Wrap

It is possible to force long continuous text to wrap in a new line by specifying break-word with the word-wrap  property. Word-wrap is supported in IE 5.5+, Firefox 3.5+, and WebKit browsers.

Word-Wrap has basically two values normal or break-word value with the word-wrap property.
  • Normal means the text will extend the boundaries of the box. 
  • Break-word means the text will wrap to next line.
In your style-sheet :
.wrapwords { 
   word-wrap: break-word; 
}

Note : Please remember that if parent div has a property called white-spacenowrapthen this doesnt work.

Tuesday, February 15, 2011

Static Twitter Follow Me Badge For Any Web In 5 Easy Steps

Twitter is large social networking site and has a million's of users. Many Bloggers/Webmasters are using twitter to promote their blogs. So here i'm sharing how to include Twitter follow me badge in easy 5 steps for blogger user, but it doesn't mean this post is not useful for other webmasters , even for them its very easy ( Please follow only 4,5 step). 

Steps are
  1. Login into your account first.
  2. After successful login you are at Dashboard, now select Design 
  3. Now select tab Edit HTML.
  4. Find (Ctrl + F) "</head>" tag.
  5. Paste the code Just before it, Now in place of "UID" ( second line of code )write your twitter User Name ( ie webgeektutorial ) let others be same and save your work,  its Done !
CODE: 
<!-- HTML Codes by http://webgeektutorials.blogspot.com -->
<a href='http://www.twitter.com/UID' rel='nofollow' style='display:scroll;position:fixed;top:250px;right:5px;z-index:10' target='_blank' title='Follow Us On Twitter'>
<img alt='by http://webgeektutorials.blogspot.com' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl38NVMDrq1uBbLJVpzIOIwYBaVRI2bWVFKBfu0BMTF4dY5gLj5ampvKm3UCCEdTOwghN1uRRQU29QfSGEmR-VHCOGKipR_W8QArGuNQMGNIo8xUlRaajjZDXXIoFxJ143KNsEqU6Iddg/s104/twitter_fm.jpg'/>
</a>

If you like my post. Please do not remove Html comment line.  

Sharing is Caring :) So keep sharing.

Friday, February 11, 2011

How well you know Interactive Ruby Shell?

The Interactive Ruby Shell, more commonly known as IRB, is one of Ruby's most popular features, especially with new developers. You can bash out a one-liner, try a method you've just learned about, or even build a small algorithm or two without going the whole way to writing a complete program.
I've started learning ruby, so while I've been digging through some of the best content I can find on IRB learning all about its internals and ways to get more out of it and big thanks to all of those guys who contributed great knowledge on web, thought I should share some of best contents gathered :

Try out some trick in your IRB console:

irb> Kernel.methods.each do |method| puts method; system "/usr/local/bin/ri --no-pager Kernel##{method}"; ch = STDIN.getc; break if (ch.chr == 'q') end

Once you enter this just keep hit enter until you want to quit, at that point hit ‘q’ and enter.


How to clear IRB console ?

On Mac OS X or Linux you can use Ctrl + L to clear the IRB screen. But in windows i don't know how but yes i know the dos command 'cls' which clears screen. so simply i'm calling this command using system.

HTML5 Visual Cheat Sheet

HTML5 is the new language of the web. This reference lists the various tags available to the web designer, as well as a selection of useful character entities, attributes and events.
The HTML5 cheat sheet is a printable document, designed to provide a quick reference for HTML5. A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size HTML5 cheat sheet.

PART 1  ( Click on image to Enlarge )

Thursday, February 10, 2011

Photoshop Glass Text Effect

How to create a glass text effect? Its a simple effect using the Blending Options.
This tutorials is divided into two parts. Big thanks goes to the up loader.

Part-1


How to Create Magical Effects

HD video to assist how one can create magical effects using Photoshop.

3D text in Photoshop CS5

How to create 3D effects within PhotoShop CS5. Though not as indepth as say a strictly 3D modeling program, this works fine for print and web purposes. The Process is fairly simple to learn, here are some good video resources.



With Photoshop CS5 Extended, you can create 3D logos and artwork from any text layer, selection, or layer mask with new Adobe Repoussé technology. Twist, rotate, extrude, bevel, and inflate these designs, and then easily apply rich materials like chrome, glass, and cork to explore different looks. And take your designs even further by leveraging the Adobe 3D Forge engine for advanced editing of your 3D models.