Thursday, July 26, 2007

Little trick in the user account details of Active Directory

registered the dll file acctinfo.dll for extra information for a user. Did the following

 "regsvr32 %systemroot%\system32\acctinfo.dll"

This creates a new tab in the user properties called "Additional Account Info"

I find it useful to check when a user has last logged in to the server. Since none of the windows users login to the domain in my office (they dont believe in windows AD stuff nor do I find it worthwhile as there are convinence and double the troubles at the same time.), I use this to findout when some one has logged into the pptp vpn (RRAS) last and I can tell my manager that those who claimed to be working from home are not working and indeed they use the company laptop for entertainment purpose ....

Thursday, July 12, 2007

when you wanted to set up a quick cvs server

follow the below link. I got a cvs server up in 5 minutes. Cant get faster than this can you ?

http://home.wanadoo.nl/cwdegier/cvs.html

Monday, July 2, 2007

Python, Bash yesterday's date

I wanted to get yesterday's date in a neat way for my backup scripts (bash). I found out a simple solution for the same pretty easily.
date -d "-1 day" +%d%m will give me the yesterdays date.

date -d "-1 month" +%d%m will give me date one month previous.

Here is what you do in python for the same.
>>> import datetime
>>> today = datetime.date.today()
>>> today
datetime.date(2008, 3, 20)
>>> yesterday = today - datetime.timedelta(1)
>>> yesterday
datetime.date(2008, 3, 19)
>>> monthbefore = today - datetime.timedelta(31)
>>> monthbefore
datetime.date(2008, 2, 18)
>>>