Script(s)

technology as-is

August 17, 2015
by gchandra
0 comments

Linux Tip : Convert date time to Unix Time (Epoch)

Simple script to covert  regular  date time to unix epoch time format  (UTC) $dat=’01/02/2015′ #If date is passed without time then its assumed as midnight  00:00:00 for that day. $sepoch=$(date “+%s” -d “$dat”) $echo $sepoch will return 1420156800 #If you … Continue reading

August 17, 2015
by gchandra
0 comments

Linux Tip : Split Date into Day, Month, Year

Easy way to split date into  Day, Month, Year  in Linux.  This code was tested using Bash shell. $dat=’13/2/2015′ sday=$(date -d “$dat” ‘+%d’) smonth=$(date -d “$dat” ‘+%m’) sfourdigityear=$(date -d “$dat” ‘+%Y’) stwodigityear=$(date -d “$dat” ‘+%y’) echo $sday  will display   02 echo … Continue reading

September 4, 2014
by gchandra
0 comments

SQLServer : Get Last Businessday of previous month

DECLARE @LastmonLastBusinessDay date, @inputdate date SET @inputdate = ’05/25/2014′ SELECT @LastmonLastBusinessDay = DATEADD(ms,-3,DATEADD(mm,DATEDIFF(mm,0,@inputdate),0)) – CASE DATENAME(dw,DATEADD(ms,-3,DATEADD(mm,DATEDIFF(mm,0,@inputdate),0))) WHEN ‘SUNDAY’ THEN 2 WHEN ‘SATURDAY’ THEN 1 ELSE 0 END print @LastmonLastBusinessDay

March 17, 2014
by gchandra
0 comments

How to kill or terminate a frozen windows task manager

Here is a simple command line statement to kill frozen windows task manager. START – RUN – CMD (make sure you are running it as Administrator) C:>taskkill /F /FI “WindowTitle eq Windows*” Taskkill – Command /F – Forcefully terminate the … Continue reading

August 12, 2013
by gchandra
0 comments

SQLServer Delete Duplicate Rows

Deleting duplicate rows in SQLServer is very simple. Example : Check this table let me call it as Sample, order number 1,2 & 3  have identical values. Now we need to delete the duplicate rows.   Step 1 : Insert … Continue reading

May 4, 2011
by gchandra
1 Comment

Visual Studio Debug Problem with IE8

Thanks to  : Abdulla AbdelHaq Source : http://weblogs.asp.net/abdullaabdelhaq/archive/2009/06/01/VS-Debug-Problem-with-IE8.aspx   How VS debugger could be crashed with IE8? If you opened multiple instances of IE8 and you attempt to debug your project, you mostly will have the issue where VS debugger … Continue reading