April 18, 2012

Print first column of passwd

The delimiter used to differentiate different fields in the /etc/passwd files is colon ' : ' . Therefore we need to look only after the semicolon.
To deal with column based files or formatted text the most commonly used command is awk.
Command below will print out the first column of /etc/passwd file:

 awk < /etc/passwd -F: '{ print $1 }'

Here

awk             is the text processor

< /etc/passwd    will serve as input file for awk

-F:             is a parameter for awk that specifies the delimiter. In our      
                           case is colon.

{ print $1 }    This will print the first line. You can put $2, $3 etc. to
                           print respective column.

My command produced following output:

 root  
 daemon  
 bin  
 sys  
 adm  
 lp  
 uucp  
 nuucp  
 smmsp  
 listen  
 gdm  
 webservd  
 postgres  
 svctag  
 nobody  
 noaccess  
 nobody4  

Labels: , , , , , ,

April 8, 2012

Quick Configure Subversion on Ubuntu 11.10 oneiric

Subversion is quiet good version control system, used by many developers across the world and is awesome!
I searched throughout Google to find a simple guide to deploy a least working subversion just to see it and was unable to.

(Note: use sudo whenever required.)
To install and get a simple up and running subversion on Ubuntu:
First install subversion packages

sudo apt-get install subversion libapache2-svn

After packages got installed, you need to create repositories.
To create a repository, I used my home directory.

mkdir /home/kaustubh/project1

Then create a repository

sudo svnadmin create /home/kaustubh/project1

Then open repository/conf/svnserve.conf (/home/kaustubh/project1/conf/svnserve.conf in my case) in your favorite text editor.
uncomment following parameters in the file. (Note: There should be no spaces before or after any parameter line. The svnserve will then be unable to read the config.) Most commonly made mistake.

auth-access = write
password-db = passwd

Then open repository/conf/passwd (/home/kaustubh/project1/conf/passwd in my case) in your favorite text editor.
Add lines below everything in following format

username = password

Its time to fire up the server
Enter following to start the server and after its started, use ctrl+c to kill the server.

svnserve -d --foreground -r /home/kaustubh

Here, -d means demon mode, --foreground means it will run in foreground, -r specifies path to repository.

Now you can easily connect to your repository using

svn://servername/project1

You will have to enter username and password mentiond in your repo/conf/passwd file.

Labels: , ,

April 7, 2012

Plugin Registration havoc, CRM 2011

It is very unfortunate that developers do their stuff without reading the proper or updated documentation from Microsoft.
This results in havoc.
:(
Recently one of our developer, had complete access to the CRM 2011 Server. To destroy the server's CRM (not intentionally) he used big spear tool "gacutil.exe".


What his problem was he was unable to register a CRM plugin from his workstation and was not succeeding. On some blog (like this one ;)) he found that he needs to register two dll files in GAC on CRM 2011 Server.


Microsoft.Xrm.Client.dll
Microsoft.Xrm.Sdk.dll


As soon as he did that, CRM stopped working. It started giving out following error:
 The Web Service plug-in failed in OrganizationId: d8c6077d-e52f-e111-b5ff-00155d000b01; SdkMessageProcessingStepId: e8af0b30-4bae-48a6-a5be-6e64af544ae1; EntityName: sitemap; Stage: 30; MessageName: RetrieveMultiple; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.MissingMethodException: Method not found: 'Void Microsoft.Xrm.Sdk.AliasedValue.set_NeedFormatting(Boolean)'.  
   at Microsoft.Crm.BusinessEntities.BusinessEntityToEntityConverter.HandleAliasing(Entity entity, IAttributeInfo attributeInfo)  
   at Microsoft.Crm.BusinessEntities.BusinessEntityToEntityConverter.Convert(ICrmConversionContext conversionContext, BusinessEntity businessEntity)  
   at Microsoft.Crm.BusinessEntities.BusinessEntityCollectionToEntityCollectionConverter.Convert(ICrmConversionContext conversionContext, BusinessEntityCollection inputCollection)  
   at Microsoft.Crm.BusinessEntities.BusinessEntityCollection.Converter.ConvertTo(ITypeDescriptorContext context, CultureInfo culture, Object value, Type destinationType)  
   at Microsoft.Crm.BusinessEntities.ConversionHelpers.Convert(ICrmConversionContext conversionContext, Object source, Type destinationType)  
   at Microsoft.Crm.Extensibility.DictionaryMapper.Map(PropertyBag inputs, ICrmConversionContext context)  
   at Microsoft.Crm.Extensibility.PropertyBagMapper.Map(PropertyBag source, ParameterCollection target, ICrmConversionContext context)  
   at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)  
   at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)  


He showed me this screen and told me to re-install the whole CRM test setup and solve the error.


Then referring the following URL
http://social.microsoft.com/Forums/en/crm/thread/bc3edd6d-c692-424c-8042-cc2f97f7e442

I registered following dll files from Server/CRMWeb/bin into the Global Assembly Cache of CRM server.


Microsoft.Xrm.Sdk.dll
Microsoft.Crm.Extensibility.dll


And it started working again!

Labels: