Showing posts with label windows 7. Show all posts
Showing posts with label windows 7. Show all posts

Thursday, May 31, 2012

Steps to Create Self Signed Certificate for use with C# Thrift Server and Java Thrift Client over SSL

The C# implementation of Thrift does not have build in support for SSL as of version 0.8.0.27874. It doesn't seems like there is any interest in integrating the two provided solutions, https://issues.apache.org/jira/browse/THRIFT-181 and https://issues.apache.org/jira/browse/THRIFT-66, from the community either. The Java implementation does have support for SSL though.

Unfortunately, I have a need to provide a Thrift service over SSL using C#. I used the solution provided in issue 181.

This is the story on how I went about creating a self signed certificate for the server and client side.

This is what I have on my computer
1. .Net 4.0
2. Java SDK

Create the self signed certificate on Windows
(I am using Windows 7)

1. Open IIS Manager
2. Click on your computer name on the left pane. It should look something like this.
3. Double click on Server Certificates
4. Right click and select Create Self-Signed Certificate
5. Enter "Thrift Self Signed Certificate Demo" or whatever name you want to give your certificate.
6. Export the Certificate by right click on it and select Export.
7. Fill in the file name for the certificate and the password. You should see a pfx file created in your chosen directory. For this demo purpose, my exported certificate file name is ThriftSelfSignedCertificateDemo.pfx Now we have a self signed certificate.

Convert the Certificate to JKS store type

1. For the next couple of steps you will need to have a copy of openssl. If you don't have it then you can download it from http://slproweb.com/products/Win32OpenSSL.html. I downloaded "Win64 OpenSSL v1.0.1c Light" and "Visual C++ 2008 Redistributables (x64)"
2. Open up a command prompt
3. Type in
openssl.exe pkcs12 -in ThriftSelfSignedCertificateDemo.pfx -out ThriftSelfSignedCertificateDemo.pem

4. Enter the password you provided during the certificate export process.
5. Enter in a new password for the PEM file.
6. Next type in
openssl.exe pkcs12 -export -in ThriftSelfSignedCertificateDemo.pem -out ThriftSelfSignedCertificateDemo.p12 -name " ThriftSelfSignedCertificateDemo"
7. Enter the password you provided during the PEM export process
8. Enter in a new password for p12 file.
9. Finally, we are ready to create the jks file. Type in keytool -importkeystore -srckeystore ThriftSelfSignedCertificateDemo.p12 -destkeystore  ThriftSelfSignedCertificateDemo.jks -srcstoretype pkcs12 -deststoretype JKS
10. Enter a password for the new JKS keystore
11. Enter the password you provided when creating the p12 file

Now you have all the necessary certificates for the Java Thrift client ssl and C# Thrift Server ssl.

ThriftSelfSignedCertificateDemo.jks is for the Java client.
ThriftSelfSignedCertificateDemo.pfx is for the C# server.

Saturday, April 07, 2012

Dell XPS 15z active window randomly lost focus

I have been using the Dell XPS 15z for a few months and it has this really annoying bug that drive me crazy. Some how my active window would lose focus and I have no idea why. I look at the task bar and there appears to be no other active window. This is especially frustrating while writing code. After doing a little research, I cut and paste together a little utility that helps pin point the thief. It was Dell quickset.exe util. Further research reveal that the ambient light sensor trigger quickset.exe which in turn steals the focus from the active window. You can read more from this forum, http://en.community.dell.com/support-forums/laptop/f/3518/t/19393785.aspx?PageIndex=3.

Here is the code to my little utility. I didn't come up with the idea nor the code.
https://bitbucket.org/tuesdaysiren/detectfocusstealingprocess/overview

There doesn't seem to be a fix for the problem except taping over the sensor. The only temporary fix is to adjust the back-light by pressing Fn + F6.

Thursday, April 07, 2011

Make taskbar smaller when docking on the side

In Windows 7, you can set your taskbar icon to small and the taskbar will shrink to a smaller side. Unfortunately, it will grow back to normal size if you dock the taskbar to either the left or right side of the desktop. There is no way to make just wide enough to fit the small icons. Well, there is none supported way to do it.

Here are the steps to get back the small taskbar when docking on the side:
1. Right click on the taskbar and select properties
2. Make sure Lock the taskbar, Auto-hide the taskbar, Use small icons are all checked
3. Click Ok
4. Press Windows Key and type services
5. Restart the "Desktop Window Manager Session Manager" service by right clicking on the service and select Restarst
6. Unhide your taskbar and select Properties
7. Uncheck Auto-hide the taskbar
8. Sit back and enjoy the smaller taskbar

Here is a video that goes through the steps.