Thursday, August 30, 2007

How to remove one replica from one clan

How to remove one replica from one clan

    1. Remove one replica which is never imported into another site

    2. We can use multiutil mkreplica –export to export one project and import the package in the destination site to create another family replica using multiutil mkreplica –import command. After each mkreplica –export command, some records will be logged into the schema db and project db before the project really setup in another site. For example, we have a family WOS in Q3 site and the clan name is OL. Now we want to make replica in another site ZH.  We run the below command to export the project in Q3 site,

      multiuitl –export –cl OL –site Q3 –family WOS –u admin –p adminpwd –out c:\temp\export_wos_to_zl zhengol:ZH

      After execute the command successfully, we can view the replica info in Q3 site as below (the project is not imported into ZH yet),

      multiutil –lsreplica –cl OL –site Q3 –family WOS –u admin –p adminpwd
      You can see that the WOS has the replica in ZH already.

      Sometimes maybe the site name you type in the command is wrong; the site name should be ZL instead of ZH for example. How can we remove the replica form the master site? If we do not remove the obsolete replica and then setup the project in ZL maybe another site XX, the ZH replica can still be found in the family replicas. It may cause some error if some defects is changed its mastership to ZH wrongly. We use above scenario to remove the ZH replica records in Q3 (master) site.

      multiutil –rmreplica –cl OL –site Q3 –family WOS –u admin –p adminpwd ZH

      If the project is created in other sites, need to sync the package into other sites.
      Pls note that even the ZH replica removed, it still can be viewed by the multiuitl lsreplica but the ZH can not be viewed in ClearQuest mastership dropdown list.


    2.      Remove one functionality replica

      Supposed we have one clan OL with family WOS in OL and Q3 (Master) sites. Now we want to remove the WOS replica from OL site. Here are the steps,

a.      change mastership of all objects in WOS project from OL to Q3 in OL site

          multiutil chmaster –cl OL –site ZL –family WOS –u admin –p adminpwd Q3 –all –long

        b.      sync the updated package from OL to Q3

          multiutil syncreplica –export –cl OL –site ZL –family WOS –u admin –p adminpwd –out c:\temp\syncout.txt Q3
          In Q3 site, import the package
          multiutil syncreplica –import –cl OL –site Q3 –family WOS –u admin –p adminpwd c:\temp\syncout.txt

        c.      remove WOS replica from OL site in master site

          In the master site Q3, run the command as blow,
          multiutil rmreplica –cl OL –site Q3 –family WOS –u admin –p adminpwd ZL

               Here are some cases need be mentioned here,

      1. If the OL site has only one family WOS and is not used any more, we should change mastership of the user/groups from OL to Q3 before above step b. Here is the command in OL site,
      2. multiutil chmaster –cl OL –site ZL –family Mastr –u admin –p adminpwd Q3 –all –long

      b.      If we have another site named JC, we need to sync the update info from Q3 to JC after above step c.

      c.      For the removed replica+site, we can not use it any more. As this case, after remove the WOS from OL site, we can not make replica of WOS in OL site again. That means it will fail if run below command

        multiutil mkreplica –export –cl OL –site Q3 –family WOS –u admin –p adminpwd –out c:\temp\wos_out_to_ZL zhengol:ZL


Tuesday, August 28, 2007

Using system and exec (Part 9)-- Perl Study Notes

Using system and exec (Part 9)-- Perl Study Notes

Execute command shelll

  Using system commad

     
    the function system to invoke the shell command and return the exist code until the  shell command finished
         #example of system command usage
         #example 1
         #execute the date and output the result to the file right_now.
         #output one message and exit if the command fails
           system("date >right_now") && die "cannot create right_now";

         #example 2
         $where = "who_out.".++$i;
         #command followed $ like below, the shell will return without waiting
         # for the command finished.   
         # in below case, the return value is true if the command is executed or
         # false if the command is not invoked successfully.
         system "(date) >$where

    system can also receive command arguments, for example
         #example
        @args1=qw(perl.exe C:\clearquest\MultiScript\cq_exportol_zl.pl)
    system(@args1)==0 || die "system @args failed: $?"

        
    system can run multiple command and separated with comma, but the return value is not the exit code of each command but the successful or not indicator of invoking the command


Using backslash

         #example 1
         # get each output line of the command dir in each iternation
        foreach (`dir`)   
         {
            chomp();  
                   #get only file lists and exclude the folder
            unless (/<DIR>/) 
            {
                       ($modify_date,$modify_time,$amorpm,$filename)=/(\S+)\s+(\S+)\s(\S+)\s+\S+\s+(.*)/;
           print "$filename is created at $modify_date $modify_time $amorpm";
                     }
            }
          

  Using filehandles
       #example 1
       # to get the result to print the line which contains zhengol
       open (COMMANDOUTPUT, "dir|");
       foreach (<COMMANDOUTPUT>)
          {
               #print the user containing zhengol
               print if (/DIR/);
          }
       close (COMMANDOUTPUT);

        #example 2
        #to print the message to the printer
        open(COMMANDINPUT, "|lpr -Pslatewriter");
        print COMMANDINPUT, "Testing Message";
        close(COMMANDOUTPUT) ;
 
  Using folk/exec/wait/waitpid
     fork to clone current process to run    
     #example 1

    if (!defined($kidpid = fork())) {
       # fork returned undef, so failed
        die "cannot fork: $!";
    } elsif ($kidpid == 0) {
        # fork returned 0, so this branch is the child
        exec("date");
        # if the exec fails, fall through to the next statement
         die "can't exec date: $!";
    } else {
        # fork returned neither 0 nor undef,
        # so this branch is the parent
        waitpid($kidpid, 0);
    }

Wednesday, August 22, 2007

CIA criticises ex-chief over 9/11

CIA criticises ex-chief over 9/11

A CIA inquiry has accused the agency's ex-chief George Tenet and his aides of failing to prepare for al-Qaeda threats before the 9/11 attacks on the US.

"The agency and its officers did not discharge(履行) their responsibilities in a satisfactory manner," the CIA inspector general wrote in a scathing report.

The document was completed in June 2005 and kept classified until now. Its release was ordered by Congress.
Ex-CIA director George Tenet said the inspector general was "flat wrong".
Mr Tenet, who enjoyed strong support from President George W Bush, resigned in 2004 citing "personal reasons".
The review team led by Inspector General John Helgerson found no "single point of failure" that would have stopped the attacks on 11 September 2001.

But he says US spy agencies lacked a comprehensive plan to counter al-Qaeda.
The report concludes that Mr Tenet "by virtue of his position, bears ultimate responsibility for the fact that no such strategic plan was ever created".

It adds that various bodies "did not always work effectively and cooperatively".
For the record
Mr Helgerson called for accountability boards to look at the performance of Mr Tenet and his aides.
Such a move was rejected after the internal report was submitted to CIA leaders.
Current CIA Director Michael Hayden said the decision to release the report was not his preference, but that he was making it available as required by Congress in a law signed by Mr Bush earlier this month.

"I thought the release of this report would distract officers serving their country on the front lines of a global conflict," he said.

The BBC's James Coomarasamy says the criticism is in keeping with previous inquiries into the 11 September attacks.
It is notable, however, for having an unusually critical tone for an internal inquiry and for its personal criticism of Mr Tenet.

In a statement, the former CIA director said he had implemented a "robust plan, marked by extraordinary effort and dedication to fighting terrorism, dating back to long before 9/11".

"Without such an effort," Mr Tenet added, "we would not have been able to give the president a plan on September 15, 2001, that led to the routing of the Taliban... and combating terrorists across 92 countries".

Our correspondent says the administration has already taken steps to address some criticisms against the intelligence community, making this latest report more of an interesting historical document than a consequential one.

Tuesday, August 21, 2007

How to determine the master site in multisite


How to determine the master site in multisite

In ClearQuest multisite, we have only one master site. Many tasks should be acted in this site, such as make replica, import schema,change schema and so on. We have one command lsreplica to determine the master site in the multisite env.

Syntax of lsreplica
   multiutil lsreplica -cl.an name -site name -family name -u.ser username -p p.assowrd -working.master

For example
   multiutil lsreplica -clan productclan -site ZL -family CS2 -u admin -p 123456 -working

Then you can get the output like 'Multiutil:Working master site is XXX'. XXX is the master site.

But pls note that if we use Mastr in the family, it gets error message and says 'Multiutil: Error: Please log into a user db to figure out working master site.' That means you can only use the project name to get the master site instead of schema family name.

Friday, August 17, 2007

Padilla guilty in US terror trial

Padilla guilty in US terror trial

US citizen Jose Padilla has been found guilty of plotting(策划) to kill people overseas and supporting terrorism.
His two co-defendants, Lebanese-born Palestinian Adham Amin Hassoun and Jordanian-born Kifah Wael Jayyousi, were convicted on the same counts.

All three denied charges of conspiring to (密谋) murder in Chechnya, Afghanistan, Bosnia and elsewhere from 1993 to 2001. They now face possible life in jail.

Padilla was once suspected of, but not charged with, plotting a "dirty bomb".
The three men are due to be sentenced on 5 December this year, the judge in Miami said.
The jurors took only a day-and-a-half to find them guilty on all three counts against them.
They were convicted of conspiracy to murder, kidnap and maim (残害); conspiracy to provide material support for terrorism; and providing material support for terrorism.

'Coded calls'
Padilla's mother, Estela Lebron, said she expected her son's lawyers to appeal against his conviction.
Meanwhile, the White House was quick to welcome the verdict (裁决).
"We commend the jury for its quick work in this trial and thank it for upholding a core American principle of impartial justice for all," said White House spokesman Gordon Johndroe.

"Jose Padilla received a fair trial and a just verdict."
The chief evidence presented against Padilla was what the prosecution called an al-Qaeda application form bearing his fingerprints and date of birth that was found in Afghanistan.

The defence had suggested that Padilla handled the document once he was in custody.
FBI recordings of telephone conversations in Arabic between the defendants were also produced, containing, according to the prosecution, coded references to terrorist activity.

Defence lawyers argued that the three men had links with countries such as Afghanistan and Bosnia because they were involved in humanitarian aid for Muslims and said the charges against them were exaggerated.

A lawyer for Hassoun said he was "very disappointed" by the verdict but that his legal team would continue to fight for justice.

Legal battle
Padilla, a former Chicago gang member of Puerto Rican descent, is a convert to Islam.
He was arrested at Chicago's O'Hare Airport in May 2002 after returning from Pakistan.
He was accused of planning to detonate a radioactive dirty bomb and held in US military custody for more than three years.

Following a long battle between the Bush administration and civil liberties groups, Padilla was transferred to the civilian courts in 2006.

The indictment (诉状) against him made no mention of the alleged (有嫌疑) bomb plot.
Padilla has said he was tortured while in military detention, an accusation US officials deny.


Monday, August 13, 2007

Darfur force 'to be all-African'

Darfur force 'to be all-African'

African Union (AU) chairman Alpha Oumar Konare says enough African troops have been promised to a Sudan peacekeeping force for no outside help to be needed.

He said African countries can provide the 26,000 peacekeepers needed for the combined AU-United Nations force. The AU already has 7,000 troops in Darfur.

The UN had expected to call on Asian troops. Critics say Africa lacks enough trained troops for an effective force.
Sudan's government has long opposed the involvement of non-African soldiers.
Viable(可行的, 能生存的)plan?
Speaking after talks in Khartoum with the Sudanese President Omar al-Bashir, Mr Konare said: "I can confirm today that we have received sufficient commitments from African countries that we will not have to resort to non-African forces."

He added that the "ball is now in the court of the UN" to provide funding for the force.
Mr Bashir, who has long argued that a UN-backed force would be a violation of Sudan's sovereignty and could worsen the situation there, backed Mr Konare's plan.

"(We) support the AU force, which consolidates the efforts of the Sudanese government to ensure security, peace and stability in Darfur," he said after their meeting.

Mr Konare did not give a breakdown of the countries offering to supply more personnel, leading correspondents to question the viability of an all-African force.

The BBC's Africa editor, David Bamford, said it was unclear where so many African troops would come from.
Our correspondent questioned whether African nations would have the political commitment to stand alone against the forces seeking to continue to disrupt lives in Darfur.

Deadline looming
Mr Konare's announcement came just days after the UN published a list of Asian countries it said had already committed troops and police officers to a Darfur force.

UN officials said the joint AU-UN force would be "predominantly African", but confirmed that countries including Indonesia, Pakistan, Nepal and Bangladesh had pledged personnel.

According to a UN resolution, the composition of the force must be decided by 30 August.
At least 200,000 people are believed to have died and more than two million have been left homeless in Darfur since fighting broke out in 2003.

Sudan's Arab government, and the pro-government Janjaweed militias, are accused of war crimes against the region's black African population - although the UN has stopped short of calling it genocide (中古灭绝).

Friday, August 10, 2007

Russia sparks Cold War scramble

Russia sparks Cold War scramble

Russian bombers have flown to the US Pacific island of Guam in a manoeuvre(调动) reminiscent of (使人联想)the Cold War era.

Two Tu-95 turboprops flew this week to Guam, home to a big US military base, Russian Maj Gen Pavel Androsov said, a story confirmed by the US.

They "exchanged smiles" with US pilots who scrambled(紧急起飞) to track them, he added.
The sorties, believed to be the first since the Cold War ended, come as Russia stresses a more assertive(肯定的) foreign policy, correspondents say.

The flight is part of a pattern of more expansive Russian military operations in recent weeks, says BBC diplomatic correspondent Jonathan Marcus.

Old practice
Gen Androsov said the strategic bombers had flown 13 hours from their base in the Russian Far East during the exercise.

"It has always been the tradition of our long-range aviation to fly far into the ocean, to meet [US] aircraft carriers and greet [US pilots] visually," he said at a news conference.

"Yesterday [Wednesday] we revived this tradition, and two of our young crews paid a visit to the area of the base of Guam," he said.

"I think the result was good. We met our colleagues - fighter jet pilots from [US] aircraft carriers. We exchanged smiles and returned home," he added.

A spokesman for the Pentagon confirmed that the Tu-95s were spotted(noticed) heading to Guam, adding that US fighter readied themselves to repel(驱赶)them.

"We prepared to intercept(拦截) the bombers but they did not come close enough to a US Navy ship or to the island of Guam to warrant an air-to-air intercept," the spokesman said.

During the Cold War, Soviet bombers regularly flew long-haul missions to areas patrolled by Nato and the US.
The bombers have the capability of launching a nuclear strike with the missiles they carry.