Tuesday, 25 February 2020

Make life easier — Git automation with single command file

Make life easier — Git automation with single command file

Posted on medium

#makelifeeasier series - Automation of git related activity.. If you like it do not forget to like the post :-)    

If you are spending lot of time with git commands for creating project repositories, creating feature branches, make changes and commit, syncing remote feature branch, creating pull request to merge request with master, then I have good news for you.


https://link.medium.com/KfIHkrT2n4

Wednesday, 25 September 2019

AWS region selection help URL

Hi,

I found one URL which is very helpful choosing the region while creating any new service. If you are not sure try it -

Navigate to the below link
https://www.cloudping.info/

Click on HTTP Ping




You should see the latency details and based on that you can choose the region -


Wednesday, 18 September 2019

Issue 01- No valid crumb was included in the request while configuring git with Jenkins

Hi,

Received Error -
No valid crumb was included in the request while setting git url from github in Jenkins Job configuration


Solution -

Enable the below checkbox and the error will be gone.

Tuesday, 10 September 2019

Angular getting started - part 1




Angular Getting Started
                                                                   
Prerequisites – Knowledge of Typescript, Basic HTML and CSS

Installation in windows
  Prerequisites:  Node.js and NPM
Make sure you have node and npm installed. Below commands should return response
·         node -v
·         npm -v

Command to install angular

                npm install -g @angular/cli

Note: if you under corporate proxy you might have to configure proxy to npm work properly

Verify successful installation and check version

                ng –version

To create project

                ng new <project_name>
                example: ng create my-first-angular-project       
               

To launch Angular application

ng serve
                To launch to different port than default
                ng serve –port 8080

Note: First time ng serve gave me error like ' The serve command requires to be run in an Angular project, but a project definition could not be found'

Solution: I was not inside the project folder so move inside the project folder and run the command again and It works. (Funny 😊).



Webpack –

                                Angular uses webpack build automation tool. The technique is also known as - HMR - HOT Module replacement / Hot module reloading. It means you do not need to restart the application for any changes in the component.



Create a component using angular cli

ng g c <componentName>
ng g c courses

To Create component inside of another component

ng g c Courses/course-details --skipTests
Note- skipTests can be used if you don’t want to generate test file for the component


Create a service using angular cli

ng g s [serviceName]


continued….

GIT Command reference

Below is list of git commands for quick reference

Initialize git with new Folder

git init [ProjectFolder] 
example - git init sample-git-demo

Initialize git with existing Folder
Navigate to existing folder and execute git init

Display modified files in the working directory vs Git's staging area.
git status

Add new or newly modified filename to Git's staging area
git add [filename]
To add recursively all new and newly modified files.
git add .

Commits all files in Git's staging area
git commit -m "First Commit to git"

Below command to directly commit newly modified already committed files
git commit -am "Second Commit to git"

Reset File from Git's staging area
git reset HEAD [filename]

Checkout last committed version from Git
git checkout -- [filename]

Display Git log history
git log

Creating a remote repository reference
git remote add origin [full URL for the remote repository]

List Git's Remote repos
git remote -v

Send Changes to Remote - The -u parameter is needed the first time
git push -u [RemoteName] [BranchName]
git push [RemoteName] [BranchName]

Receive Changes from Remote

git push [RemoteName] [BranchName]

About WebRTC

I was/am highly impressed by WebRTC so started exploring different things related to it.

To start with the basic definition of WebRTC -
WebRTC (Real Time Communication) is a free, open project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. It has inbuilt security and encryption functionality which is making it more valuable.

Use cases are -
  • Video Chat
  • Screen Sharing
  • File Sharing

Emerging Use Cases are
  • IOT
  • Healthcare
  • Real time Team Collaboration

There are some brilliant sites available, describing the capabilities and usage of WebRTC and for understanding the basic -

One stunning demonstration is in the link below. Open it in Chrome.

Thursday, 6 June 2019

Some live saving facts about day to day activity in documentum environment

Below are some facts which I personally think very useful. Hope you guys finds the same.


Fact -1 


You want to change the content of a document to test something very quickly. Many times for some unknown reason UCF error is one of the hurdle in your way, so in such scenario using below API you can do it very easily-


retrieve,c,dm_sysobject where object_name='test.xml'
checkout,c,l
setfile,c,l,'[TempLocation]\test.xml',xml
set,c,l,log_entry
Testing the xml content
checkin,c,l





Fact - 2




Quick way of Cleaning up dmi_queue_item table - garbage entries of full text users.


dmi_queue_item is one of the table which is responsible for performance of your system functionalities like workflows.
Many time, I noticed we have entries of full text index users which does not make sense, may be because of upgrade or failed index requests or removal of index agents.

To clean up, you can follow the below steps -
1. Shutdown your repository services.2. take back up of the table by using below command -




exp USERID=<schema_user>@<schema_name> FILE=<schema_user>_dmi_queue_item_s.DMP LOG=<schema_user>_dmi_queue_item_s.LOG full=n TABLES=dmi_queue_item_s consistent=y compress=y statistics=none BUFFER=2000000 RECORDLENGTH=64000

3. Execute below queries
SQL:
CREATE TABLE dmi_queue_item_s_backup AS (SELECT * FROM dmi_queue_item_s where name !='dm_fulltext_index_user');
truncate TABLE dmi_queue_item_s;
insert into dmi_queue_item_s select * from dmi_queue_item_s_bkp;
drop table dmi_queue_item_s_backup;

PURGE recyclebin;

You can manage user events according to your need.

4. Restart your repository services.


FACT - 3

For version mismatch error during workflow activities -
I found setting up below parameters resolved most of the issues

retrieve,c,dm_docbase_config 
dump,c,l
append,c,l,r_module_name
WF_SKIP_PARALLEL_TASK_EXECUTION
append,c,l,r_module_mode
1
save,c,l
retrieve,c,dm_docbase_config 
dump,c,l



To be continued ...

Quick start for npm under proxy [POC/Learning purpose only]


NPM (Node Package Manager) is the default package manager for Node.js. Setting up NPM for downloading packages, one common issue is working behind the corporate proxy. 

Below is a workable solution - 


Fire up your command line and type in the following:


npm config set proxy http://<proxy_user_id>:<password>@<proxy_url>:<proxy_port>


npm config set https-proxy https://<proxy_user_id>:<password>@<proxy_url>:
<proxy_port>




Note: For https_proxy url starts with https.



If you get error like "SSL routines:ssl3_get_record:wrong version number" then you have problem with the entry you made above for https_proxy.
  • If SSl not configured properly then try not to use https_proxy command above.

There is one file which maintains all entries related to npm - C:\Users\<account_id>\.npmrc See if you have proper entries inside of that. You can make the changes there as well.

Performance degradation after upgrading Oracle database from 11g to 12c for documentum applications

I faced major performance issues when I upgrade database environment for one of the system from 11g to12c (12.1.0.2.0). Front end application is Document D2.

Here is my analysis -

In Oracle 12.1 the adaptive optimizer features are controlled by the OPTIMIZER_ADAPTIVE_FEATURES parameter, which was set to TRUE by default.

This is introduced to better estimate statistics and optimize plans. In some system,  this lead to the performance issues.


SOLUTION -

I found the below tuning works for my environment

Use the following system setting to disable Adaptive Query Optimization:
ALTER SYSTEM SET OPTIMIZER_ADAPTIVE_FEATURES = FALSE SCOPE=BOTH; 


Also there are some tables which still contains statistics, so have to flush them out as well to get the better result. Contact your DBA team with these details.








Thursday, 28 February 2019

IMP-00010: not a valid export file, header failed verification - ERROR during oracle database schema import


Hi Everyone,

This is one of the error which I received while trying to import database dump exported from another oracle database version as part of migration activities. It took me some time to work out the things -

Error Received during import of schema: 

                          IMP-00010: not a valid export file, header failed verification

Schema dump exported from oracle version:

                          V12.01.00

Schema dump imported into oracle version:

                           V11.02.00

 From oracle note available in web:
                           If you are running Oracle Database 12c Release 1 (12.1.0.2) and specify VERSION=11.2 on an export, then the dump file set that is created can be imported into an Oracle 11.2 database.

It means I must redo the export again which I cannot afford due to some time constraints.

Quick and dirty resolution I work out which works:

 1. First I checked the content of the DMP file with the help of some commands, then I noticed there is one line with the version number inside of DMP file. If you can execute Unix commands, then try 
                       head -5 {dump_file_name}.DMP

Result shows like below -

                       gEXPORT:V12.01.00 

 2. I replaced the line with version of the target oracle instance by below command-

                       sed 's/gEXPORT:V12.01.00/gEXPORT:V11.02.00/' {dump_file_name}.DMP > {dump_file_name}_new.DMP


3. Then try to import the new DMP file i.e. {dump_file_name}_new.DMP and guess what?

It successfully imported into new schema. Do let me know if it helps you. 😊


Friday, 9 February 2018

Documentum D2 DQL Queries

In day to day life I think you will find below queries very helpful. Do not forget to like or post comment :-)


Execute D2 Core Method – for folder and security recalculation

execute do_method with method='D2CoreMethod', arguments='-docbase_name $DOCBASENAME -user $DOCBASEUSERID -dql_filter "select r_object_id from dm_sysobject(all) where r_modify_date BETWEEN DATE(''10/31/2011 11:30:00'',''mm/dd/yyyy hh:mm:ss'') AND DATE(NOW)" -naming false -autolink true -security true -apply_for_vd false -create false -transaction false'


Run D2UpdateChildACLMethod as per security config

EXECUTE do_method WITH method = 'D2UpdateChildACLMethod', arguments = '-user_name username -docbase_name docbasename -acl_config_name doc_approved_acl¬doc_draft_acl

DQL to get workflow history of document in D2 application (provide documents i_chronicle_id in red color section)
select a.r_object_id,a.audited_obj_id,a.event_name as event_name,a.object_name AS workflow_name ,doc.object_name AS document_name,ra.child_label AS document_version,a.owner_name As supervisor_name,w.tracker_state as task_state, w.start_date as date_sent,a.user_name AS task_performer,a.time_stamp AS task_completion_time,a.string_2 AS outcome,a.event_source AS event_source, a.string_3 AS delegation_from,a.string_4 AS delegation_to from dm_audittrail a ,d2c_workflow_tracker w , dm_relation ra, dm_sysobject doc where a.audited_obj_id in( select w.r_object_id from d2c_workflow_tracker w where r_object_id in (select distinct w.r_object_id from dm_relation r,d2c_workflow_tracker w where r.relation_name = 'D2_WF_TRACKER_DOCUMENT' and r.child_id = '$object$(i_chronicle_id)' and r.parent_id = w.r_object_id)) and a.audited_obj_id=w.r_object_id and ra.parent_id = w.r_object_id and a.audited_obj_id=ra.parent_id and ((a.event_name='d2_workflow_sent_task' and a.user_name not in ( select user_name from dm_audittrail b where b.event_name in ('d2_workflow_rejected_task','d2_workflow_forwarded_task','d2_delegation_delegated_task','d2_workflow_delegated_task') and b.audited_obj_id=a.audited_obj_id)) or (a.event_name in ('d2_workflow_rejected_task','d2_workflow_forwarded_task') and a.string_2 is not nullstring) or (a.event_name in ('d2_delegation_delegated_task','d2_workflow_delegated_task'))) and doc.i_chronicle_id=ra.child_id and ra.child_label NOT In ('CURRENT',' ')  order by 1 desc

Full Text Index Queue Summary

select min(date_sent) as minimum from dmi_queue_item where delete_flag = 0 and (task_state is NULL or task_state = ' ') and name IN (select queue_user from dm_ftindex_agent_config)
select count(*) as number from dmi_queue_item where delete_flag = 0 and task_state = 'warning' and name IN (select queue_user from dm_ftindex_agent_config)
select count(*) as number from dmi_queue_item where delete_flag = 0 and task_state in ('error','failed') and name IN (select queue_user from dm_ftindex_agent_config)
select count(*) as number from dmi_queue_item where delete_flag = 0 and (task_state is NULL or task_state = ' ') and name IN (select queue_user from dm_ftindex_agent_config)

Halted Workflows

select pr.object_name as process, wf.object_name as workflow, wf.supervisor_name, qi.name, wi.r_creation_date from dm_process pr, dm_workflow wf, dmi_workitem wi, dmi_queue_item qi where wf.r_runtime_state = 3 and pr.r_object_id = wf.process_id and wi.r_workflow_id = wf.r_object_id and qi.r_object_id = wi.r_queue_item_id and qi.delete_flag = 0 order by 1, 2

User Workflows

select pr.object_name as process, wf.object_name as workflow, qi.name, wf.r_runtime_state, wi.r_creation_date from dm_process pr, dm_workflow wf, dmi_workitem wi, dmi_queue_item qi where pr.r_object_id = wf.process_id and wi.r_workflow_id = wf.r_object_id and qi.r_object_id = wi.r_queue_item_id and qi.delete_flag = 0 AND wf.supervisor_name = USER order by 1, 2

Job Details

select r_object_id, object_name, title, subject, method_name, pass_standard_arguments, start_date, expiration_date, max_iterations, run_interval, run_mode, is_inactive, target_server, method_trace_level, a_continuation_interval, a_current_status, a_iterations, a_last_invocation, a_next_invocation, method_arguments from dm_job order by title, object_name

Number of Workflows by Supervisor

select wf.supervisor_name, count(*) as number from dm_workflow wf where wf.r_runtime_state != 2 and wf.r_runtime_state != 4 group by supervisor_name order by supervisor_name

DQL – Check if index exists or successfully created

SELECT r_object_id,index_type,attribute,attr_count,data_space from dmi_index where index_type in (select r_object_id from dm_type where name=’dmi_workitem’)

DQL/API – Create Index

DQL:  Sample 1:
  EXECUTE make_index WITH type_name='dm_audittrail', attribute='chronicle_id',index_name='chronicle_id_index', use_id_col=true;
  Sample 2:
  EXECUTE make_index WITH type_name=’dm_sysobject’,attribute=’i_is_deleted’,index_name=’DM_SYSOBJECT_S_NI1?,index_space=’TEST_INDEX’,use_id_col=true,“UNIQUE”=true
API:  Sample 1:   apply,c,NULL,MAKE_INDEX,NAME,S,dm_sysobject,ATTRIBTUE,S,i_is_deleted,INDEX_NAME,S,DM_SYSOBJECT_S_NI1,INDEX_SPACE,S,TEST_INDEX,USE_ID_COL,B,true

 
Sample 2:   apply,c,NULL,MAKE_INDEX,NAME,S,dm_sysobject,ATTRIBTUE,S,i_is_deleted,INDEX_NAME,S,DM_SYSOBJECT_S_NI1,INDEX_SPACE,S,TEST_INDEX,USE_ID_COL,B,true,“UNIQUE”,B,true

DQL/API – Drop Index

DQL:  Syntax:
   EXECUTE drop_index [[FOR] dmi_index_id] [WITH name = index_name]
  Example:
   EXECUTE drop_index WITH name=’chronicle_id_index′ 
 
API:  Syntax:
   apply,session,dmi_index_id,DROP_INDEX [,NAME,S,index_name]
 Example:
   apply,session,dmi_index_id,DROP_INDEX,NAME,S,chronicle_id_index

Use of ESCAPE character

SELECT r_object_id FROM dm_document WHERE object_name LIKE '%\_%' ESCAPE '\'         [Note:Your LIKE predicate would look like this:
LIKE ’\%\_\\’ ESCAPE ’\’   escape character can escape itself]

Virtual Document / Assembly objects / D2C Snapshots

# get the associated assembly id from the virtual document root object
select distinct book_id from dm_assembly where parent_id='090eruhterh380586f30' ;


# get all the component under assembly object/d2csnapshot object using assembly id
select r_object_id,object_name,a_status,r_version_label,i_latest_flag from dm_document(all) where r_object_id in (select r_object_id from dm_sysobject(all) in assembly id('0800fdhdhd80586f34') descend);


# get D2CSnapshot objects for an virtual document using i_chronicle_id
select r_object_id,upper(object_name),object_name,r_object_type,a_content_type,r_is_virtual_doc,r_link_cnt,r_lock_owner,r_policy_id,r_assembled_from_id,r_immutable_flag,r_frozen_flag ,r_creation_date,title from d2c_snapshot where r_assembled_from_id in (select r_object_id from dm_sysobject(all) where i_chronicle_id = '0900gsgsts04fd9db') order by r_object_id;


[DM_CRYPTO_F_KEYSTORE_INIT]fatal: "Failed to initialize keystore" - during repository start

One fine day, I found that documentum repository was down and I am not able to access it anymore. I tried to start the services but found below error in repository log:


Error description in repository log:

[DM_CRYPTO_F_KEYSTORE_INIT]fatal:  "Failed to initialize keystore

RESOLUTION:

In LINUX environment, below shell script can be utilized :

#!/bin/bash

# Take the backup of the $DOCUMENTUM/dba/secure folder
cp -r $DOCUMENTUM/dba/secure $DOCUMENTUM/dba/secure_bkp
if [ -f $DM_HOME/bin/dm_crypto_manage_lockbox ]; then
  cd $DM_HOME/bin/
  chmod +x dm_crypto_manage_lockbox
  dm_crypto_manage_lockbox -lockbox <lockbox name .lb> -lockboxpassphrase -resetfingerprint
  dm_crypto_boot -all -passphrase
else
    echo "$DM_HOME/bin/dm_crypto_manage_lockbox does not exist.. so issue can not be resolved"
    exit 1
fi
Note:In content server $DM_HOME/bin/dm_crypto_manage_lockbox should be already present for other version you need to place it manually.

# Execute like  : ./solveFingerprintlockboxIssue.sh

On other environment you can execute below commands :


dm_crypto_manage_lockbox -lockbox <lockbox name .lb> -lockboxpassphrase -resetfingerprintdm_crypto_boot -all -passphrase




Saturday, 4 February 2017

Quick start for Docker under proxy [POC/Learning purpose only]


Installation on Windows:


Preparation:
To get started you have to enable virtualization from your computer.
Start your computer and press ESC that will give you options to choose. In my case F10 key is responsible for BIOS setting. Go to system setting (Under Advanced section) and enable the virtualization setting and you are good to go.

Installation:
Installation is very straight forward. The easiest way to install Docker is to go to their website and follow the installation instructions for your Operating System.  
In my case I want install docker in my windows 7 machine so docker toll box needs to be installed. Refer the url here for docker toolbox https://www.docker.com/products/docker-toolbox

After Installation
Once you install docker you will see below Icons in you desktop





Click on Docker Quick start to get started.
Interesting part is that to make docker work under proxy you need to do some tweaks. After installation if you run the below command for testing docker, it will not work –
docker run hello-world
In my case I have not used the default docker machine. I have created one new docker machine with the below command –

docker-machine create -d virtualbox     --engine-env HTTP_PROXY=http://<your_proxy>:<port>     --engine-env HTTPS_PROXY=https://<your_proxy>:<port>  --engine-env NO_PROXY= localhost,127.0.0.1,<machine_ip>  test1


Above command will create the docker machine named test1 for you.

Once you execute the command you will see line like below

“Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this vi
rtual machine, run: C:\Program Files\Docker Toolbox\docker-machine.exe env test1

Then execute the below commands-
docker-machine ls
docker-machine env test1

then execute the eval command
eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env test1)


Then you can test the command –
docker run hello-world

This should work now….

Installation on Centos 7


Prerequisites:
Docker requires a 64-bit OS and version 3.10 or higher of the Linux kernel.
Check using below command
uname -r
Installation
Install with yum… first update all the packages using below command..
sudo yum update
Install the
sudo yum install docker-engine
sudo systemctl enable docker.service
sudo systemctl start docker

After Installation:
Create directory:
mkdir /etc/systemd/system/docker.service.d
Create one file called http-proxy.conf under /etc/systemd/system/docker.service.d



Content of the file is like below
[Service]
Environment="HTTP_PROXY=http://<username>:<password>@<proxy_name>:<proxy_port>/" "HTTP_PROXY=http:// <username>:<password>@<proxy_name>:<proxy_port>/" "NO_PROXY=localhost,127.0.0.1,<machine_ip>"

Upload the changes:
sudo systemctl daemon-reload

Restart the docker service
sudo systemctl restart docker

Now you are good to go. Go ahead to check the below command
sudo docker run hello-world


Hope this will be helpful... :-)


Note: Blogs which I have written are totally my personal view based on my personal experience.


Thursday, 15 December 2016

Documentum D2 4.7 is here

Documentum D2 4.7 is here with enhanced features-


1. Introduction of Java free client (Documentum Client Manager)..
2. Removal of D2 Lockbox  utility by D2Keystore
3. Property page advance view editor functionality is back..
4. Installers are available as Docker image as well..
and many more.... :-)

Tuesday, 29 November 2016

cURL it !!

curl

In this post I would like to highlight how you can setup and use one of the powerful tool curl in windows machine. Out of many features, I found curl very useful while testing rest/soap services. 

cURL is a command line tool for getting or sending files using URL syntax.
It supports a range of common Internet protocols, currently including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, DAP, DICT, TELNET etc.

You can download the software from below location:


Installation is very easy in windows.

1.       Extract the zip file and keep it in a location in your computer.
2.       Go to http://curl.haxx.se/docs/caextract.html and download the digital certificate file named ca-bundle.crt.

Machine generated alternative text:
Computer 
Local Disk REST 
curl 
New folder 
Include in library 
Name 
Share with 
mloads 
curl.exe 
curl-ca-bundle.crt


3.       Add the curl folder path to your Windows PATH environment variable so that the curl command is available from any location at the command prompt.

Testing with curl command

I mainly used this during some activity related to salesforce. So example urls can be different in your case. Now you are ready to get your hands dirty ;-)

a.       Open command prompt and type :- 

b.      In proxy enabled system ,you may get Timed out issue.

c.       Curl support proxy so you can type the command above like below

                                    i.     curl https://ap1.salesforce.com/services/data -H "X-PrettyPrint:1" --proxy <proxy_name>:<port> --proxy-user <proxy_user>:<proxy_user_credential>

                                     ii.            In above command -H "X-PrettyPrint:1" is added to get the output in formatted way. You can test the output without that part to get the clear idea.


d.      You may face the certification issue while executing the above command. In development environment you can skip this part by adding -k after curl command. For example-

                                                 i.   curl -k https://ap1.salesforce.com/services/data -H "X-PrettyPrint:1" --proxy <proxy_name>:<port> --proxy-user <proxy_user>:<proxy_user_credential>


e.      For help or other usage you can simply type the command curl --help


Hope this will be helpful... :-)



Note: Blogs which I have written are totally my personal view based on my personal experience.

Make life easier — Git automation with single command file

Make life easier — Git automation with single command file Posted on medium #makelifeeasier series - Automation of git related activity...