среда, 18 сентября 2013 г.

Example of wsdl to use with anonymouse webservice call in BMC Remedy

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:s0="urn:ISS_WS_Test1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ISS_WS_Test1">
   <wsdl:types>
      <xsd:schema elementFormDefault="qualified" targetNamespace="urn:ISS_WS_Test1">
         <xsd:element name="New_Create_Operation_0" type="s0:InputMapping1" />
         <xsd:complexType name="InputMapping1">
            <xsd:sequence>
               <xsd:element minOccurs="0" name="userName" type="xsd:string" />
            </xsd:sequence>
         </xsd:complexType>
         <xsd:element name="New_Create_Operation_0Response" type="s0:OutputMapping1" />
         <xsd:complexType name="OutputMapping1">
            <xsd:sequence>
               <xsd:element name="Request_ID" type="xsd:string" />
            </xsd:sequence>
         </xsd:complexType>
         <xsd:element name="AuthenticationInfo" type="s0:AuthenticationInfo" />
         <xsd:complexType name="AuthenticationInfo">
            <xsd:sequence>
               <xsd:element name="userName" type="xsd:string" />
               <xsd:element name="password" type="xsd:string" />
               <xsd:element minOccurs="0" name="authentication" type="xsd:string" />
               <xsd:element minOccurs="0" name="locale" type="xsd:string" />
               <xsd:element minOccurs="0" name="timeZone" type="xsd:string" />
            </xsd:sequence>
         </xsd:complexType>
      </xsd:schema>
   </wsdl:types>
   <wsdl:message name="ARAuthenticate">
      <wsdl:part element="s0:AuthenticationInfo" name="parameters" />
   </wsdl:message>
   <wsdl:message name="New_Create_Operation_0SoapOut">
      <wsdl:part element="s0:New_Create_Operation_0Response" name="parameters" />
   </wsdl:message>
   <wsdl:message name="New_Create_Operation_0SoapIn">
      <wsdl:part element="s0:New_Create_Operation_0" name="parameters" />
   </wsdl:message>
   <wsdl:portType name="New_Port_0PortType">
      <wsdl:operation name="New_Create_Operation_0">
         <wsdl:input message="s0:New_Create_Operation_0SoapIn" />
         <wsdl:output message="s0:New_Create_Operation_0SoapOut" />
      </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="New_Port_0SoapBinding" type="s0:New_Port_0PortType">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
      <wsdl:operation name="New_Create_Operation_0">
         <soap:operation soapAction="urn:ISS_WS_Test1/New_Create_Operation_0" style="document" />
         <wsdl:input>
            <soap:header message="s0:ARAuthenticate" part="parameters" use="literal" />
            <soap:body use="literal" />
         </wsdl:input>
         <wsdl:output>
            <soap:body use="literal" />
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="ISS_WS_Test1Service">
      <wsdl:port binding="s0:New_Port_0SoapBinding" name="New_Port_0Soap">
         <soap:address location="http://remotesrm/arsys/services/ARService?server=remotesrm&amp;webService=ISS_WS_Test1" />
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>
 
using without  gray font...
also:
1. In midtier config tool, enable web service user
2. Add this user to Remedy 

here is example of javascript soap request:


function soap() {
  var xmlhttp = new XMLHttpRequest();
  xmlhttp.open('POST', '/arsys/services/ARService?server=remotesrm&webService=ISS_WS_RenewPassword', true);
 
  // build SOAP request
  var sr =
  '<?xml version="1.0" encoding="utf-8"?>' +
  '<soapenv:Envelope ' + 
    'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ' +
    'xmlns:urn="urn:ISS_WS_RenewPassword">' +
    '<soapenv:Header/>'+
    '<soapenv:Body>' +
      '<urn:RenewPassword>' +
      '<urn:userEmail>'+ document.getElementById('userEmail').value + '</urn:userEmail>'+
      '</urn:RenewPassword>'+
      '</soapenv:Body>' +
  '</soapenv:Envelope>';
 
  xmlhttp.onreadystatechange = function () {
    if (xmlhttp.readyState == 4) {
      if (xmlhttp.status == 200) {
        console.log('debug output');
      }
    }
  }
  // Send the POST request
  xmlhttp.setRequestHeader('Content-Type', 'text/xml');
  xmlhttp.setRequestHeader('SOAPAction', 'urn:ISS_WS_RenewPassword/RenewPassword');
  xmlhttp.send(sr);
}

среда, 28 августа 2013 г.

Grub rescue prompt, repair grub

I recently repartitioned my hdd and I have damaged grub on my system. On boot I get the grub rescue prompt and I have to go through the following steps in order to boot normally:

> ls   //to view partitions

> set root=(hd0,msdos6)
> set prefix=(hd0,msdos6)/boot/grub
> insmod normal
> normal 
 
Then i just install boot-repair:
> sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
> sudo apt-get install -y boot-repair && (boot-repair &) 
 
got it from here and here

Installing Catalyst 13.4 on Ubuntu 13.04

Manually installing Catalyst 13.4


Before you go about installing the fglrx driver from AMD Catalyst 11.10 do read the release notes.
In this how-to an AMD64 Ubuntu 11.10/12.04 installation using a AMD Radeon HD 6300M will be chosen for illustrative purposes.
Note: Remember to uninstall the AMD proprietary fglrx graphics if it is already installed and reboot your system.
  1. Download the drivers found at the AMD website. To avoid complications later on, save it inside an empty folder.
  2. Enable the Source Code repository in Synaptic Package Manger, then open a terminal and type:
    sudo apt-get update
    On a standard desktop install of Ubuntu 10.10 you may also need to install the QT4 libraries, to do this type:
    sudo apt-get install libqtgui4
    On a standard desktop install of Ubuntu 12.04 you may also need to install dh-make libraries, to do this type:
    sudo apt-get install dh-make dh-modaliases execstack libc6-i386 lib32gcc1
    Note: This is not necessary if you are running Kubuntu or have already installed the libraries.
  3. Still using the terminal, navigate to the folder where you downloaded the drivers.
    1. Ubuntu 13.04 Raring:
      sh amd-driver-installer-catalyst-13-4-x86.x86_64.run --buildpkg Ubuntu/raring
    2. Ubuntu 12.04.2 LTS Precise:
      sh amd-driver-installer-catalyst-13-4-x86.x86_64.run --buildpkg Ubuntu/precise

      If it is required, a package manager window will open and install some dependencies and after a while create the following three .deb packages:
      fglrx_12.104-0ubuntu1_amd64.deb  
      fglrx-amdcccle_12.104-0ubuntu1_amd64.deb  
      fglrx-dev_12.104-0ubuntu1_amd64.deb
      Note: It will also create a file called fglrx-installer_12.104-0ubuntu1_amd64.changes. If you wish you can read this file to know the changes that have been effected through AMD Catalyst 13.4 and related information.
  4. To install the created .deb files, type:
    sudo dpkg -i fglrx*.deb
    Note: In case any of the packages are broken, open Synaptic Package Manager and go to Edit -> Fix Broken Packages. In case you are new to Ubuntu, broken here means that some dependent packages are not yet installed. Once you sort out the issue as indicated above through the Synaptic Package Manager, the problem of broken packages should be resolved.
  5. Continuing with the installation, type:
    sudo aticonfig --initial
    After this command, reboot your system. If all is right, the fglrx driver that corresponds to AMD Catalyst 12.3 will be installed and working on your system. To confirm the drivers are working open a terminal and type:
    fglrxinfo
    You should get an output similar to the following:
    fglrxinfo 
    display: :0  screen: 0
    OpenGL vendor string: Advanced Micro Devices, Inc.
    OpenGL renderer string: AMD Radeon HD 6300M Series
    OpenGL version string: 4.2.11733 Compatibility Profile Context
    Note: If you see any mention of MESA in the output, the fglrx drivers have not been installed correctly. See the troubleshooting section for more details You can make configuration changes through the AMD Catalyst Control Center, it can either be found in your Application menu or you can launch it through a terminal like this:
    gksudo amdcccle 
    To read more about the AMD Catalyst Control Center click here. Keep in mind that all configuration options for the AMD Catalyst Control Center mentioned there may not be available for your Ubuntu system. 

    got it from here

Install the JDK 7 on Ubuntu 13.04

  • Download he 32bit or 64bit Linux "compressed binary file" - it has a ".tar.gz" file extension i.e. "[java-version]-i586.tar.gz" for 32bit and "[java-version]-x64.tar.gz" for 64bit
  • Uncompress it
    tar -xvf jdk-7u2-linux-i586.tar.gz (32bit)
    tar -xvf jdk-7u2-linux-x64.tar.gz (64bit)
JDK 7 package is extracted into ./jdk.1.7.0_02 directory. N.B. check carefully this folder name since Oracle seem to change this occasionally with each update.
  • Now move the JDK 7 directory to /usr/lib
sudo mkdir -p /usr/lib/jvm
sudo mv ./jdk.1.7.0_02 /usr/lib/jvm/jdk1.7.0
  • Now run
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1
  • Correct the file ownership and the permissions of the executables:
sudo chmod a+x /usr/bin/java 
sudo chmod a+x /usr/bin/javac 
sudo chmod a+x /usr/bin/javaws
sudo chown -R root:root /usr/lib/jvm/jdk1.7.0
N.B. remember - Java JDK has many more executables that you can similarly install as above. java, javac, javaws are probably the most frequently required.
This answer lists the other executables available.
  • Run
sudo update-alternatives --config java
You will see output similar one below - choose the number of jdk1.7.0 - for example 3 in this list:
$sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
————————————————————
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode
3 /usr/lib/jvm/jdk1.7.0/jre/bin/java 3 manual mode

Press enter to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/lib/jvm/jdk1.7.0/jre/bin/java to provide /usr/bin/java (java) in manual mode.
Check the version of you new JDK 7 installation:
java -version
java version “1.7.0”
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode) 
Repeat the above for:
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
Enable mozilla firefox plugin:
32 bit:
ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/

64 bit:
ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
N.B. you can link the plugin (libnpjp2.so) to /usr/lib/firefox/plugins/ for a system wide installation
Depending on your configuration, you might need to update the apparmor profile for firefox (or other browsers) in /etc/apparmor.d/abstractions/ubuntu-browsers.d/java
# Replace the two lines:
#  /usr/lib/jvm/java-*-sun-1.*/jre/bin/java{,_vm} cx -> browser_java,
#  /usr/lib/jvm/java-*-sun-1.*/jre/lib/*/libnp*.so cx -> browser_java,
# with those (or adapt to your new jdk folder name)
/usr/lib/jvm/jdk*/jre/bin/java{,_vm} cx -> browser_java,
/usr/lib/jvm/jdk*/jre/lib/*/libnp*.so cx -> browser_java,
Then restart apparmor:
sudo /etc/init.d/apparmor restart
Confirm that the JRE has been successful by using the official oracle website.

got it from here

четверг, 22 августа 2013 г.

вторник, 13 августа 2013 г.

tsql view with case when else in select

USE [ARSystem]

go

/****** Object:  View [dbo].[ISS_HPD_WorkLogMod1]    Script Date: 08/13/2013 11:06:27 ******/
SET ansi_nulls ON

go

SET quoted_identifier ON

go

ALTER VIEW [dbo].[ISS_HPD_WorkLogMod1]
AS
  SELECT T1.work_log_id,
         T1.submitter,
         T1.submit_date,
         T1.assigned_to,
         T1.last_modified_by,
         T1.last_modified_date,
         T1.status,
         T1.short_description,
         T1.assignee_groups,
         ( CASE
             WHEN ( ( T2.first_name IS NOT NULL )
                    AND ( T2.last_name IS NOT NULL ) ) THEN (
             T2.first_name + ' ' + T2.last_name )
             ELSE ( T1.submitter )
           END ) AS ConcatFLName
  FROM   hpd_worklog AS T1
         FULL OUTER JOIN ctm_people AS T2
                      ON T1.work_log_submitter = T2.remedy_login_id

go 

среда, 22 мая 2013 г.

detect adobe flash

var hasFlash = false;
try {
  var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
  if(fo) hasFlash = true;
}catch(e){
  if(navigator.mimeTypes["application/x-shockwave-flash"] != undefined) hasFlash = true;
}


got it from here

суббота, 18 мая 2013 г.

add "Open With" in contex menu win7

regedit.exe -> HKEY_CLASSES_ROOT\*\shell->"create a new key"->create a new key below called “command”->edit default val with "notepad.exe %1"

For non admins:
  1. Using Regedit, navigate to HKEY_CURRENT_USER\Software\Classes
  2. If a key "*" is present under software\Classes skip the next step 
  3. Right click on Classes and choose "New->Key". Name the new key "*"
  4. If a key "shell"  is present under Software\Classes\*  skip the next step 
  5. Right click on "*" and choose "New->Key". Name the new key "shell"
  6. Right-click on shell and choose "New->Key". Name the new key "Edit with Notepad++" (without quotes)
  7. Right-click on  "Edit with Notepad++" and choose "New->Key". Name the key as "command"
  8. Now select "command" and navigate to the right pane
  9. Double click "Default" in the right pane 
  10. Enter a value "C:\MyBin\Notepad++\Notepad++.exe "%1"" (without the outer quotes)
 got it from here

пятница, 12 апреля 2013 г.

Get Remedy Form Name from js

ARKWGetStringByIdx(this.mTableObj.windowID,6)