Search This Blog

Thursday 21 July 2016

I/O Redirection concept in bash script

​For background:
  • a number 1 = standard out (i.e. STDOUT)
  • a number 2 = standard error (i.e. STDERR)
  • if a number isn't explicitly given, then number 1 is assumed by the shell (bash)

First let's tackle the function of these. For reference see the Advanced Bash-Scripting Guide.

Functions

2>&-

The general form of this one is M>&-, where "M" is a file descriptor number. This will close output for whichever file descriptor is referenced, i.e. "M".

2>/dev/null

The general form of this one is M>/dev/null, where "M" is a file descriptor number. This will redirect the file descriptor, "M", to /dev/null.

2>&1

The general form of this one is M>&N, where "M" & "N" are file descriptor numbers. It combines the output of file descriptors "M" and "N" into a single stream.

|&

This is just an abbreviation for 2>&1 |. It was added in Bash 4.

&>/dev/null

This is just an abbreviation for >/dev/null 2>&1. It redirects file descriptor 2 (STDERR) and descriptor 1 (STDOUT) to /dev/null.

>/dev/null

This is just an abbreviation for 1>/dev/null. It redirects file descriptor 1 (STDOUT) to /dev/null.

Wednesday 20 July 2016

"Failed to load the JNI shared Library" for eclipse application

Solution: use alternate javaw.exe / javaw version path in eclipse.ini "-vm" (based on architecture x64 / x86)

Monday 18 July 2016

TFS Restoration postscript Steps.

Steps
  • ​TFSConfig RemapDBs /DatabaseName:hades;TFS_Configuration /SQLInstances:hades /AnalysisInstance:hades
  • TFSConfig Accounts /ResetOwner /SQLInstance:hades /DatabaseName:Tfs_Configuration
  • TfsConfig RegisterDB /SQLInstance:hades /DatabaseName:Tfs_Configuration ​

Steps to uninstall Oracle11g in Windows

​Steps:
  • START -> RUN -> Services.msc
  • Locate all Ora* services & click on STOP
  • Start -> RUN -> Regedit
  • Locate HKEY_LOCAL_MACHINE folder in the registry
  • Open Software folder
  • Delete the Oracle folder under Software
  • Open System folder in HKEY_LOCAL_MACHINE
  • Open CurrentControlSet folder within the System folder
  • Open Services
  •  Delete all keys related to Oracle. Every key starts with "ORA.."
  •  Close the regedit
  • Delete ORACLE_HOME folder
  • Delete the Oracle folder in Program Files
  • Delete the Oracle reference Path variables.
  • Reboot​
note:Error in deleting oci.dll
stop microsoft distributed transaction coordinator (msdtc) service and delete oci.dll file manually.
incase file is not deleted,rename the file and delete it. 

Removing an unwanted workspace from Eclipse

Remove workspaces from eclipse.

1. Go to your workspaces folder and delete the folders/workspaces you no longer require. If you start eclipse at this stage you will see the folders you just deleted are still available in the eclipse workspace dropdown. So close/cancel eclipse.

2.  Go to the folder where the eclipse.exe lives, move to \configuration\.settings and open the file org.eclipse.ui.ide.prefs for editing.

3. In the variable RECENT_WORKSPACES=C:/blah/blah , remove the paths to the folders you deleted in step one.

4. Start eclipse and the unwanted options should not be in the recent workspaces option drop-down


Friday 15 July 2016

TFS Backup Plan Wizard - A backup plan already exists for the TFS Configuration

TFS 2010 server to another TFS 2010 server and trying to configure a backup plan using the Backup plan wizard that comes along with the TFS Power Tools. The tool allows you to set up Team Foundation Server backups - 

The tool can schedule backups for the following databases that your deployment of Team Foundation Server uses:

  • the configuration database
  • the database for each team project collection
  • the databases that Team Foundation Server uses in conjunction with SharePoint Products, if your deployment includes integration with SharePoint Products
  • the databases that Team Foundation Server uses in conjunction with SQL Server Reporting Services, if your deployment includes reports

By using the restore wizard included with this tool, you can restore your entire deployment to new hardware, or selectively restore team project collections to an earlier point in time.

Problem

But when you migrate from One TFS server to another, you are run your self into the following error message – TF254027: Error – Backup Plan Verifications – A backup plan already exists for this Tfs Configuration.

Backup Plan error

Solution

The wizard has a feature to prevent multiple backup plans from being created for the same TFS databases (because they might interfere). It works by setting an extended attribute in the TFS Configuration SQL database (called TFS_BACKUP_PLAN_CONTROLLER) that identifies a configured backup plan. You can't configure another backup plan from a different machine. To do it, you will need to delete this extended attribute using SQL Server Management Studio.

You can use the following command to delete the attribute by,

Use Tfs_Configuration   EXEC sp_dropextendedproperty @name = 'TFS_BACKUP_PLAN_CONTROLLER'