web analytics

Using the clipboard in WSH

How to get the text from the clipboard

set objIE = CreateObject("InternetExplorer.Application") objIE.Navigate("about:blank") textFromClipboard = objIE.document.parentwindow.clipboardData.GetData("text") objIE.Quit WScript.Echo textFromClipboard

How to put the text into clipboard

textIntoClipboard = "Some text" & VbCrLf & "Some more text"   Set objIE = WScript.CreateObject("InternetExplorer.Application") objIE.Navigate "about:blank" Do Until objIE.ReadyState = 4     WScript.Sleep 100 Loop   objIE.document.ParentWindow.ClipboardData.SetData […]

Oracle: check the existance of logon/logoff triggers

SELECT  DECODE((COUNT(trigger_name)),0,’LOGON trigger missing’,  ‘Number of logon triggers: ‘ || COUNT(trigger_name) ) "INFO" FROM sys.dba_triggers WHERE  TRIGGERING_EVENT LIKE ‘LOGON%’  AND status=’ENABLED’  AND owner=’SYS’ UNION SELECT  DECODE((COUNT(trigger_name)),0,’LOGOFF trigger missing’,”,  ‘Number of logoff triggers:’ || COUNT(trigger_name)) "INFO" FROM sys.dba_triggers WHERE  TRIGGERING_EVENT LIKE ‘LOGOFF%’  AND status=’ENABLED’  AND owner=’SYS’

The field TRIGGERING_EVENT could have the spaces at the end! […]

Unix shell: workaround for loop problem

It’s not possible to get the value of the loop variables in some versions of ksh.

Example:

#!/bin/ksh num=0 cat $0 | while read line ; do  let num=num+1 done echo "Number=$num"

This script will return “Number=0” as the result on some Linux machines.

Here is the workaround for the problem: You should change the […]

JavaScript: edit web page in browser

Here is small bookmarklet, which allows to edit the web page for any site (ok, You could save the results on Your local machine only).

javascript:document.body.contentEditable=’true’; document.designMode=’on’; void 0

Oracle: redo log switches by date

The following script help to find, how often the redo logs were switched. It calculates the number by date and by hour.

[…]

JavaScript: Soundex implementation

There is a special algorithm for comparision strings, which sound similar (Soundex).

Here is JavaScript Soundex implementation:

function soundex ( s_src ) {      var s_rez = "0000" ;  var new_code, prev, idx    a_codes = { "bfpv": 1, "cgjkqsxz":2, "dt": 3, "l": 4, "mn": 5, "r": 6 };    s_src = s_src.toLowerCase().replace(/ /g,"") […]

Oracle: usage of the tablespaces

SET pagesize 10000 SET COLSEP ‘|’ SET VERIFY off SET serveroutput ON SIZE 1000000 BREAK ON report COLUMN tablespace_name format a30 heading ‘TABLESPACE’ COLUMN sizegb   format 9999999999D9 heading ‘SIZE-Gb’ COLUMN usedproc format 999D99 heading ‘USED-%’ COLUMN status format a10 heading ‘STATUS’ COMPUTE SUM LABEL ‘Total size:’ OF sizegb ON report SELECT b.tablespace_name ,   […]