Wednesday, January 30, 2013

Feels great to see that your product is used

I work remotely for a company in california from texas and was working on a customer ticket and saw that the customer account in my city only.

Feels good to see that the product you work on is used globally and even at a stone's throwaway from you.

Tuesday, January 15, 2013

openldap adding an index

We use ldap to store customer metadata like users, customers and other stuff. Right now each node has a ldap and we are trying to consolidate ldaps across different nodes. So I loaded one ldap with data from 20 nodes and some of the queries were taking 4000 msec.  So I saw that indexes were missing .

I went to  slapd.conf  and  added

index customerNumber,customerDomain,email   eq
index customerName eq,sub

I also updated the cache size to 4G in DB_CONFIG file

set_cachesize   4 0 1

I restarted ldap and suddenly things were flying but something  was fishy as the new numbers for 100 threads was faster then previous 1 thread time for all operations. So I picked one query and ran it manually and found that a simple query like below was coming empty

ldapsearch -x -H ldap://localhost:389 -b "dc=xxx,dc=com" "(&(objectclass=objuser)("|grep email|more

I removed the index and restarted ldap and same query started returning results. Upon googling I found that if you add a new index you have to reindex your data, wth.  so I
1) shutdown ldap
2) ran

/usr/sbin/slapindex -f ~/openldap/etc/slapd.conf -b "dc=xxx,dc=com"
3) started ldap
and now the query was returning results.

And LDAP rocks even 500 threads its rocking fast.

Monday, January 14, 2013

It seems people work less in december in US

Traffic to my blog was down to 60% in december and I was worried what had changed but I am glad to see that its back to original level in 2nd week of January.  It seems people work less in December.

Fun to see bugs

Received this spam email today morning and first thing i saw that instead of image it had a path of "c:\users\Manoj". :)

Wednesday, January 2, 2013

LDAP wildcard search

I was able to make a LDAP query with wild card on a field username like


but I wasnt able to make it on a field like


me and my teammate searched and finally found that username was inheriting from a super type uid and thats why it was working on it but customername was not.

Luckily solution to the problem was to add a SUBSTR clause to enable wildcard match on a field in ldap schema.

SUBSTR caseIgnoreSubstringsMatch