Posts

Java Keytool Export Private Key, PKCS#12 or .p12 export or conversion from java keystore

So, I had to create a PKCS#12 type or .p12 extension certificate from a java keystore which was created using java keytool. FYI, I have jdk 1.4.2. I came to know that using keytool you cannot export the private key. I tried various options available in keytool i.e. create a keystore of type PKCS#12 to begin with instead of the default JKS (java keystore). -storetype PKCS12. All this didnt work and on further search on google, I came across 2 free products which can help you a lot in terms of handling the keystore, generate keystore, export private key and so on. You can download these free products from here. The tools are portecle-1.5 http://sourceforge.net/projects/portecle/ KeyTool IUI – GUI http://www.icewalkers.com/download/KeyTool-IUI/3073/adl/ For my needs, i.e. generate a PKCS#12 certificate from an existing java keystore, portecle-1.5 worked just fine and it was very easy to use. I also tried the KeyTool IUI – GUI just for testing the tool and it helped me to export the p...

Good stuff on Normal forms

Database Normalization stuff here

SQL Server Index Articles

Here are some good articles on SQL Server Indexes. SQL Server Indexes: The Basics SQL Server Indexing Basics SQL Server Indexes

How to Use SQL Server Group By

I found this great article on SQLTeam which shows How to Use GROUP BY in SQL Server Very good step by step guide.

SQL Server Exists Not Exists dont work with min max Aggregate functions

In my last post , I mentioned how @@ROWCOUNT gets affected when MIN, MAX i.e. aggregate functions are used. Today, I had similar issues while using EXISTS and NOT EXISTS. I was using NOT EXISTS and records were showing up when really it should have removed the results. select col1 from tbl1 where not exists (select min(something) from tbl2 where tbl2.col9 = tbl1.col2) select col1 from tbl1 where not exists (select distinct something from tbl2 where tbl2.col9 = tbl1.col2) Hope this helps.

SQL Server @@ROWCOUNT returns 1 if Min Max used in query

Hi, I came across this crazy issue today. You expect @@Rowcount to return number of rows returned by query right. But in my case it was returning 1 for 0 rows returned. Here is an example. SELECT * FROM yourtable WHERE 1 = 2 SELECT @@ROWCOUNT -- THIS GIVES 0 But if you have MIN function being used, the result will be different declare @company_id int SELECT @company_id = min(company_id) FROM yourtable WHERE 1 = 2 SELECT @@ROWCOUNT -- THIS GIVES 1 Apparently, since NULL was the result set, @@rowcount was giving 1 as the count. I hope this helps someone.

SQL Server Insert Into Identity Column

We all know that if you have an identity column and if you try to insert a value in the identity column, you will get an error. Here is how you can avoid the error First thing to do here is to set Identity to ON on the tblname you want to insert row in. SET IDENTITY_INSERT tblname ON INSERT tblname (ID,colname) VALUES(5,'ajas') SET IDENTITY_INSERT tblname OFF Do not forget to set IDENTITY_INSERT to off once you are done with inserting the record because you dont want it to be off if you have an application where developers will be working on it. Hope this Helps.

RDP End a Disconnected session

Image
We all have had issues where in a RDP disconnected session wont allow other users to login until the administrator manually kills that disconnected session. Well, I just found out that there is a setting in Windows Server 2003 which would allow to automatically kill a RDP Disconnected session. Go to Start - Administrative Tools - Terminal Services Configuration. In Terminal Services Configuration, select Connections - RDP-Tcp. Right click RDP-Tcp and select properties. Go to sessions tab and select override user settings which is disabled by default. Here is a snapshot of the setting. Many thanks to Cameron Childress for this post titled How to Automatically Log Off Disconnected Remote Desktop / Terminal Services Sessions This article is also good.

Lets Fifa - Fifa 10 Demo Trailer

Its that time of the year again. Yes, Fifa 10 demo is available for download. Here are some videos of previews. Enjoy!!! Awesome trailer EA SPORTS FIFA 10

SQL Server Hidden Gems Perhaps

If you ever wanted to get name of all the databases on your server, you can use this query In SQL Server 2000, select name from master..sysdatabases In SQL Server 2005, select name from sys.databases :-)

ColdFusion CFID CFTOKEN Get lastvisit timecreated from CGLOBAL

I had a recent need to get information of CFID & CFTOKEN to see how many records we have in our datasource for CDATA, CGLOBAL and also from which date i.e. Last Min date to Last Max date the CGLOBAL table has values for. So I wrote this short query and then finally i cast the column as datetime so we can sort by date otherwise the sort will occur by string. select cast( substring(data, charindex('ts',data) + 4 , 19) as datetime) as 'lastvisit' , cast( substring(data, charindex('ts',data,charindex('ts',data)+4 ) + 4 , 19) as datetime) as 'timecreated', lvisit from cglobal where charindex('ts',data) gets the first occurrence and len('2009-08-18 22:36:55') gives you an idea of how many characters you need to extract and turns out its 19 characters. Link to how ColdFusion Purges Client Variables Hope this helps someone.

ColdFusion Optimization Performance tuning

Nice articles for ColdFusion Optimization and performance tuning. Adobe link for performance and scalability ColdFusion Tips For troubleshooting by Steve Erat ColdFusion Request Tuning Settings in Depth ColdFusion Tips For troubleshooting by Steve Erat Part 2 Nice post by Mark Kruger Sick Server Troubleshooting Part 2 - Things to Try Sick Server Troubleshooting Part 3 - In the Soup About Java Memory Management Toward Better CF Server Administration Part 1 of 2 Toward Better CF Server Administration Part 2 of 3 Updated on Mon Aug 31. From Ben Forta's book, Understanding Java Stack Traces From Exception.log To Be Continued...

SQL Server Hidden Gem - How to get next value of Identity for a column in a table

Hi, This is very nice tip if you ever wanted to find the next value of identity column without doing an insert, I repeat without doing an Insert. Lets say you have a table named company. Then you would use this command SELECT IDENT_CURRENT('company') + IDENT_INCR('company') where IDENT_CURRENT gives the current or last identity value used by that table and IDENT_INCR gives the increment you/anyone had set during creation of table. It could 1, 2 etc depending on your logic. The other way of finding next value of identity is after an insert statement by using SCOPE_IDENTITY(). You would add 1 or 2 and so on depending on the autoincrement setting you used during the table creation. Hope this helps.

Spread The MAX Widget Around, Win Cool Prizes

Image

Unable to RDP. Enable Disable Microsoft Terminal Services Client Control mstscax.dll

Image
So today i.e. Aug 17 2009 I was not able to remote desktop to my work computer from home. I am on WinXP Pro SP 2 with Internet Explorer 7 and I was able to remote desktop earlier without any issues. Today, I was getting the popup message saying you need to install active x control. See below I knew this had to do with Microsoft Terminal Services Client Control mstscax.dll and you need to enable it for RDP to work. For some reason, Internet Explorer 7, in its manage or enable disable add on feature wont show the Microsoft Terminal Services Client Control mstscax.dll. Here is a way to make it available so you can enable it. 1. When you get the pop up to install active X control as pop up , you get 2 options, Run and Dont run (install or dont install basically). I selected Dont Install. I will tell you later why I picked dont install, so hang on to that thought ;-). 2. Once I selected dont install, I got an small alert box or message info in yellow box from Internet explorer saying clic...

Dalcha v/s Hawks. Aug 1 2009. Final.

After 3 weeks of thrilling and exciting games, it's the Hawks who won the CPL trophy. Like any other league game, this match was no different and the Hawks had to work hard to win the finals as the Dalcha's pushed them to the limit. We witnessed Ujwal's semi final performance which was unbelievable and in the finals, it was his counterpart Sagar, who performed brilliantly, to lead the Hawks to a famous victory. The Hawks started with Sashi and Bhavin. Binnoy opened the bowling and gave only 5 runs of the first over. Sashi got out going for a big shot and Vinay joined Bhavin at the crease. Bhavin hit a six and four of consecutive balls and Hawks were looking good again with 16 for 1 after 2 overs. Vinay who played brilliantly in the semi final, couldnt get it going as He was not given any room by some fiery bowling from Binnoy. Kareem bowled well in the next over and got another wicket, this time of Vinay who made 5. Ujwal brought himself into the attack and got the prize wi...

Birthday Cake using Coldfusion & SQL Server

Image
So, I made this cake for one of my colleagues at work, M.J. , and I was thinking what to write on the cake. After a while, I got this idea of why not write something which she does, i.e. write queries every now and then. So, I wrote a CFQuery tag for her on the birthday cake. ColdFusion is the way to go, pretty much, in normal life too. ;-)

Blazers v/s Hawks. Aug 1 2009. Semi Final 2.

Who is the man, you ask and I say, Bhavin. Fantastic, Amazing, and Brilliant, at his best; He has performed in every game and He didnt dissapoint his team in the Semi Final against Blazers. He stood tall again and his innings along with Vinays power hitting, made the difference to the game. Before I go into the match details, one more thing, I would like to add. For some reason, I forgot to give credit to star batsman Vinay, for his beautiful innings on the opening day when He scored 30 plus. When I wrote Preview for Semi Final 2, I wrote about him as one of the danger batsman to watch out for and also updated the bulletin page for that game. The Blazers won the toss and elected to field first, which I guess most captains did in CPL and won 90% of the games. So nothing wrong with that. Sashi and Bhavin opened the innings and Ravi Bachala bowled the first over. He gave only 8 runs and it was a decent start. The Hawks started carefully and by end of 4, they were 36 for 1, with Sashi gone...

Veterans v/s Dalcha. Aug 1 2009. Semi Final 1.

The word Ujwal means bright or you can say shining. Indeed, true to its meaning, Captain Ujwal shined when his team needed the most. He remained calm and cool and bowled probably the best over of the tournament, when it looked like they were going home early from the party. Radha won the toss and elected to field first which was no surprise as the field was wet and conditions suited the team batting second. Ashish opened the batting with Harsha. Ashish started the proceedings with a big six over squre leg region in the very first over as 9 runs came of it. Good start right. Radha gave debutant Ramesh, who was a last minute addition, the 2nd over. What does Amchi Mumbai boy Ashish do? Well, He saw the first ball and defended it. Next ball, He whacked it way over long on for a big six. But next ball He tried again but this time it took an edge and He was caught behind by Keeper Rajesh. Another wicket fell in same fashion in the same over. End of over 2, Dalcha were 17 for 2, out of which...

DareDevils v/s Blazers. July 27 2009. Match 18.

Ravi Bachala's timely 31 enabled the Blazers to another victory. He put up a show of classy batting today for the Blazers. DareDevils fought back well but could not come up with a win. What this means is that DareDevils are out of semi final race. They play Cheetahs next in the last round robin game of the tournament. The Blazers won the toss and elected to bat first. Ravi Bachala started the innings with Ravi K. By the time, the first wicket fell, Blazers had scored 19 of 2 overs. Ravi Bachala was timing the ball well and hit 2 sixes and 2 fours on his way to an impressive 31 runs. When He got out, the score was 59 in 5 overs. This was the break through, the DareDevils needed, as they tightened the screws on the Blazers. Sunil played his part and scored 10. Ramesh batted sensibily along with debutant Makam Ravi, to take the Blazers to a total of 84. For DareDevils, Suman took 3 wickets with his accurate bowling. The DareDevils lost a wicket in the first over. Vinod joined Suman an...