Apr 27, 2015

python split multiple delimiter

i think, its basic but important to you get idea. Most basic function is use re library or just use split() function on string.

Python String Split


a = "ini budi, iwan dan ibu budi. Selain itu ini juga ada 'madu' budi." 
a.split(' ')
['ini', 'budi,', 'iwan', 'dan', 'ibu', 'budi.', 'Selain', 'itu', 'ini', 'juga', 'ada', "'madu'", 'budi.']


well, its just split on space or any other delimiter in split bracket parameter.

Python keep include delimiter

sometimes, you just need to process the text, then you want to return back or merge again after processing. Well, here's this :

import re
re.split('(\W)',a)
['ini', ' ', 'budi', ',', '', ' ', 'iwan', ' ', 'dan', ' ', 'ibu', ' ', 'budi', '.', '', ' ', 'Selain', ' ', 'itu', ' ', 'ini', ' ', 'juga', ' ', 'ada', ' ', '', "'", 'madu', "'", '', ' ', 'budi', '.', '']


Python split two characters or more delimiter


its different case, the splitter can be more than one delimiter. You can use Kennet's function :

def tsplit(string, delimiters):
    """Behaves str.split but supports multiple delimiters."""
   
    delimiters = tuple(delimiters)
    stack = [string,]
   
    for delimiter in delimiters:
        for i, substring in enumerate(stack):
            substack = substring.split(delimiter)
            stack.pop(i)
            for j, _substring in enumerate(substack):
                stack.insert(i+j, _substring)
           
    return stack



tsplit(a, (',', '/', '-',' ','.','\''))
['ini', 'budi', '', 'iwan', 'dan', 'ibu', 'budi', '', 'Selain', 'itu', 'ini', 'juga', 'ada', '', 'madu', '', 'budi', '']

 
other search terms such as :

python split multiple delimiters
python split string into list delimiter
python split on multiple characters
python split on different characters
python substring delimiter
python split separator
python split include delimiter
python split string into list delimiter
python split on different characters
python split two characters
python convert string to raw
regex find text between two strings

are solved with re, as simple as this  :

re.split('\W+',a)
['ini', 'budi', 'iwan', 'dan', 'ibu', 'budi', 'Selain', 'itu', 'ini', 'juga', 'ada', 'madu', 'budi', '']

Read more ...

Apr 23, 2015

solved Access Agent last_error 519897087


IBM Access Agent, Authentication service id = 'EMPTY'. Account data template id='EMPTY'  error last_error='-519897087

steps to solved are  :
1. you access agent lower than profile accepted.

ibm ispim itim


2. ensure that your user get privilege to use this profile. Check role, credential, etc (on itim console)

3. ensure that your your AA was syncronized with IMS


ibm ispim tivoli itim

Read more ...

solved name redefined ibm access studio IMS

while you create or modify profile on IBM ISPIM, uploading the profile, sometimes you will get error : "name redefined"

Its can be because of :

1. you access node was already uploaded with same name. Or
2. you upload different node with same access-node-id

Solution :

1. ensure that you always have backup before modify anything on IMS
2. check where the node was return "name redefined", let say : node "widget checkout widget" it has state id and next state id.

see here :

<sso_support>
          <state_engine_sso_support xmlns:msxsl="urn:schemas-microsoft-com:xslt">
            <states>
              <state id="150513310137101222435491076710141015135273159" is_begin_state="1">
                <state_name>auto_gen_state_start</state_name>
                <triggers>
                  <trigger>
                    <wnd_activate_trigger>
                      <signature>/child::wnd[@title="Toad for Oracle Database Login Version 12.5.1.1 " and @class_name="TfrmLogin" and @is_visible="1"]</signature>
                      <actions>
                        <action>
                          <keyboard_input_action>
                            <action_id>1133151015129671315401415112151208910515153851412</action_id>
                            <signature>/child::wnd[@title="Toad for Oracle Database Login Version 12.5.1.1 " and @class_name="TfrmLogin"]/child::wnd[@class_name="TPanel"]/child::wnd[@class_name="TPageControl"]</signature>
                            <keyboard_inputs>
                              <keyboard_input left_ctrl="1">
                                <tab />
                              </keyboard_input>
                              <keyboard_input>192.168.42.128</keyboard_input>
                              <keyboard_input>
                                <tab />
                              </keyboard_input>
                              <keyboard_input>1521</keyboard_input>
                              <keyboard_input>
                                <tab />
                              </keyboard_input>
                              <keyboard_input>ORCL</keyboard_input>
                            </keyboard_inputs>
                          </keyboard_input_action>
                        </action>
                        <action>
                          <wnd_click_action>
                            <action_id>115111221301301463487911712010113930715</action_id>
                            <signature>/child::wnd[@title="Toad for Oracle Database Login Version 12.5.1.1 " and @class_name="TfrmLogin"]/child::wnd[@class_name="TPanel"]/child::wnd[@class_name="TPageControl"]/child::wnd[@class_name="TTabSheet"]/child::wnd[@class_name="TRadioButton" and @rel_xpos=2 and @rel_ypos=2]</signature>
                          </wnd_click_action>
                        </action>
                      </actions>



while you upload the same widget, sometimes the state id was change due to next state changed.

itim ispim tivoli name redefined

Read more ...

solved ibm ispim can't create object: SessionRecorder.SessionManager


it was so hectic to solved this error on ibm ispim. i can not check-out due to session manager can not create recording session.

Its return error as below :



18:16:51.6386986        [State Machine Id - 1] Loaded AccessProfile: profile_putty_main
18:16:51.6677002        [State Machine Id - 1] State engine reset to default state: Start State
18:16:51.7107027        [State Machine Id - 1] Fired Trigger: Window is activated
18:16:51.7157030        [State Machine Id - 1] State Transitioned: Start State ==> Interim state
18:16:53.7378187        [State Machine Id - 1] Fired Trigger: Text is found (Mainframe)
18:16:53.7428189        [State Machine Id - 1] State Transitioned: Interim state ==> New State 2
18:16:53.7548196        [State Machine Id - 1] Action: Inject credentials. Property INJECTION_HAPPENED is set to '0'.
18:16:53.7628201        [State Machine Id - 1] Action: Inject credentials. Property RANDOM_PWD_INJECTION_HAPPENED is set to '0'.
18:16:53.7668203        [State Machine Id - 1] Action: Inject credentials. Account data bag CICO_injection_bag has its contents set to -  Authentication service id ='10.2.114.185'. Account data template id= 'EMPTY'.
18:16:53.7728207        [State Machine Id - 1] Executed Action: Inject credentials
18:16:53.7838213        [State Machine Id - 0] Action: Run a VBScript or JScript. Property ApplicationName is set to 'PUTTY'.
18:16:53.7928218        [State Machine Id - 0] Action: Run a VBScript or JScript. Account data bag CICO_injection_bag has its contents set to -  Authentication service id ='10.2.114.185'. Account data template id= 'EMPTY'.  ApplicationName= 'PUTTY'.
18:16:53.8058225        [State Machine Id - 0] Action: Run a VBScript or JScript. Property text_is_found_for_injecting_password is set to '.*[Pp]assword.*|.*PASSWORD.*'.
18:16:53.8138230        [State Machine Id - 0] Action: Run a VBScript or JScript. Property text_is_found_for_not_injecting_password is set to '.*[Dd]enied.*|.*DENIED.*'.
18:16:53.8258237        [State Machine Id - 0] Action: Run a VBScript or JScript. Property text_is_first_displayed_for_access_denied_or_failure is set to '.*[Dd]enied.*|.*DENIED.*|.*[Ii]nvalid.*|.*not\sdefined\.*'.
18:16:53.8378244        [State Machine Id - 0] Action: Run a VBScript or JScript. Property text_is_found_for_successful_logon is set to '.*[Ll]ast login.*:.*|.*LAST LOGIN.*:.*|.*$.*|.*>.*|.*#.*|.*Microsoft\sWindows.*|.*Sign-on\sis\scomplete.*|.*Enterprise\sSummary.*'.
18:16:53.8498251        [State Machine Id - 0] Action: Run a VBScript or JScript. Property Parent_Wnd_Signature is set to '/child::wnd[@title~".*- PuTTY" and @class_name="PuTTY"]'.
18:16:53.8628258        [State Machine Id - 0] Action: Run a VBScript or JScript. Property wnd_for_text_identication_on_mainframe_screen is set to '/child::wnd[@title~".*- PuTTY" and @class_name="PuTTY"]'.
18:16:53.8748265        [State Machine Id - 0] Action: Run a VBScript or JScript. Property recording_consent_dialog_custom_message is set to ''.
18:16:53.8888273        [State Machine Id - 0] Action: Run a VBScript or JScript. Property recording_consent_dialog_parent_xpath is set to '/child::wnd[@title~".*- PuTTY" and @class_name="PuTTY"]'.
18:16:53.9008280        [State Machine Id - 0] Action: Run a VBScript or JScript. Property param_custom_metadata is set to ''.
18:16:53.9158288        [State Machine Id - 0] Action: Run a VBScript or JScript. Property param_value is set to ''.
18:16:53.9308297        [State Machine Id - 1] Executed Action: Run a VBScript or JScript
18:16:53.9508308        [State Machine Id - 1] Fired Trigger: Fire immediately
18:16:53.9698319        [State Machine Id - 1] Trigger:  Condition: -1. Account data bag CICO_injection_bag has its contents set to -  Authentication service id ='10.2.114.185'. Account data template id= 'EMPTY'.  ApplicationName= 'PUTTY'.
18:16:53.9968335        [State Machine Id - 1] Trigger:  Condition: -1. Property Parent_Wnd_Signature is set to '/child::wnd[@title~".*- PuTTY" and @class_name="PuTTY"]'.
18:16:54.0198348        [State Machine Id - 1] State Transitioned: New State 2 ==> Option for shared or private credential to logon
18:16:54.0468363        [State Machine Id - 1] Action: Capture credentials. Account data bag recorder_bag has its contents set to -  Authentication service id ='EMPTY'. Account data template id= 'EMPTY'.
18:16:54.0688376        [State Machine Id - 1] Executed Action: Capture credentials
18:16:55.0958963        [State Machine Id - 1] Fired Trigger: Fire after specified time
18:16:55.1128973        [State Machine Id - 1] State Transitioned: Option for shared or private credential to logon ==> Interim state
18:16:56.8049941        [State Machine Id - 0] Action: Run a VBScript or JScript. Property reuse_property is set to '6'.
18:16:56.8499967        [State Machine Id - 0] Action: Run a VBScript or JScript. Account data bag CICO_injection_bag has its contents set to -  Authentication service id ='10.2.114.185'. Account data template id= 'EMPTY'.  reuse_property= '6'.
18:16:56.8919991        [State Machine Id - 1] Executed Action: Run a VBScript or JScript
18:16:56.9210007        [State Machine Id - 1] Fired Trigger: Fire immediately
18:16:56.9440020        [State Machine Id - 1] The following condition number was not met: 1. Therefore this trigger was not fired: Fire immediately
18:16:56.9620031        [State Machine Id - 1] Trigger:  Condition: -1. Account data bag recorder_bag has its contents set to -  Authentication service id ='EMPTY'. Account data template id= 'EMPTY'.
18:16:56.9870045        [State Machine Id - 1] Trigger:  Condition: -1. Property recording_consent_dialog_custom_message is set to ''.
18:16:57.0100058        [State Machine Id - 1] Trigger:  Condition: -1. Property recording_consent_dialog_parent_xpath is set to '/child::wnd[@title~".*- PuTTY" and @class_name="PuTTY"]'.
18:16:57.0340072        [State Machine Id - 1] Trigger:  Condition: -1. Property recording_session_guid is set to ''.
18:16:57.0560084        [State Machine Id - 1] State Transitioned: Interim state ==> Shared credential opted to logon : Initiating Checkout
18:16:57.0830100        [State Machine Id - 1] Fired Trigger: Fire immediately
18:16:57.1080114        [State Machine Id - 1] State Transitioned: Shared credential opted to logon : Initiating Checkout ==> Interim State
18:16:57.1340129        [State Machine Id - 0] Action: Run a VBScript or JScript. Property line is set to '1'.
18:16:57.1670148        [State Machine Id - 0] Action: Run a VBScript or JScript. Property Session_Recording_needed is set to '1'.
18:16:57.2010167        [State Machine Id - 1] Executed Action: Run a VBScript or JScript
18:16:57.2330186        [State Machine Id - 1] Fired Trigger: Fire immediately
18:16:57.2620202        [State Machine Id - 1] The following condition number was not met: 1. Therefore this trigger was not fired: Fire immediately
18:16:57.2920219        [State Machine Id - 1] State Transitioned: Interim State ==> Check Exit Code
18:16:57.3310242        [State Machine Id - 1] Got an error while executing a plugin script. The row number was: 9. The error description was: ActiveX component can't create object: 'SessionRecorder.SessionManager'
18:16:57.3700264        [State Machine Id - 1] Executed Action: Run a VBScript or JScript
18:16:57.4160290        [State Machine Id - 1] The following condition number was not met: 1. Therefore this trigger was not fired: Fire immediately
18:16:57.4600315        [State Machine Id - 1] The following condition number was not met: 1. Therefore this trigger was not fired: Fire immediately
18:16:57.5080343        [State Machine Id - 1] The following condition number was not met: 1. Therefore this trigger was not fired: Fire immediately


well, solution is : 

1. you must check the permission dll execution on Access Agent on AA folder.

ibm session recorder itim





ispim itim ibm tivoli





2. check that its DLL already registered on windows. check via regsvr32.
Read more ...

Apr 4, 2015

cheat impression blackhat


Hi all, just my note about someone who make cheat to gain impression with blackhat technique.

how it  impression blackhat works

adding bad script on template.

well, let see this transaction : someone can change one node of this template to call his node (web or other script), it means for every template that downloaded by people will automatically gain his impression.

adsense blackhat



execute some script to call other external script

let see this script that loaded on template: (this is just an example that i found, some lines was deleted for security reason)

on this script, someone want to do something when user do something.



<script type='text/javascript'>
function fireEvent(element,event) {
        if (document.createEvent) {      
            var evt = document.createEvent(&#39;HTMLEvents&#39;);
            evt.initEvent(event, true, true );
            return !element.dispatchEvent(evt);
        } else {
            var evt = document.createEventObject();
            return element.fireEvent(&#39;on&#39;+event,evt)
        }
}
function logIt() {
    var randp = Math.floor(Math.random()*2);
    var i = document.getElementsByTagName(&quot;iframe&quot;);
    var iframe = i[randp];
       var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
       var a = iframeDoc.getElementsByTagName(&quot;a&quot;);
       var elem = a.item(randp);
       if(elem != null) {
        if(elem.createTextRange) {
            var range = elem.createTextRange();
            range.move(&#39;character&#39;, caretPos);
            range.select();
        }
        else {
            if(elem.selectionStart) {
                elem.setSelectionRange(caretPos, caretPos);
                fireEvent(elem, &#39;click&#39;);
                elem.focus();               
            }        

      }       
    }
}

</script>

expr:onclick='&quot;logIt()&quot;'
Read more ...