Tuesday, December 16, 2014

How to check SSL version used to connect to a website


To see what version of SSL you are using, in Internet Explorer (IE)
Visit the website you want to check in IE
Once the page is loaded, go to File (You may have to press Alt key for menu options to show up) and then select Properties
































Now, review the connection value in this popup. This shows the type of connection made as well as the SSL versions. In this example, this popup shows TLS 1.2




























In chrome, click the green icon next to the URL once the page loads. Now, click the tab connection and shows the SSL versions. In the below example, it shows TLS 1.2








Monday, December 1, 2014

Saints Row IV - the steam servers are too busy to handle your request (error code 53)

Was getting error the steam servers are too busy to handle your request (error code 53) trying to start  Saints Row 4.

Turned our McAfee was creating an issue. All I had to do to solve as turn off real time scanning for a moment while the first time the game was run. Once the game started up for first time, I was able to enable McAfee real time scanning back on. Happily, didn't see this issue anymore. Guess the real time protection was blocking installing the software.

Friday, November 21, 2014

Validation of viewstate MAC failed when posting from one aspx file to another (cross posting asp.net forms)

The error
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.


We have a aspx form that posts to another form. This was done by changing form action for the first form to point to the second form. When this happens, asp.net was giving the above error.

As a solution, the submit button on the form was also changed to update the postbackURL to point to the second aspx page. So essentially, the form action and also the submit button postback URL were both pointed to the second aspz page where the form data is submitted!

Example:
this.Form.Action = "MyPage2.aspx";
SubmitButtonCtl.PostBackUrl = "MyPage2.aspx";

Friday, November 7, 2014

How to Mirror or Sync entire directory and subdirectories with all files included using robocopy in windows

Windows comes with a nice command line tool called robocopy. Use the below command to sync up two folders.

robocopy dirA DirB\ /MIR /W:5

where DirA is the source folder and DirB is the destination folder. If DirB do not exist, it will create one for you. If it already exist, it will check every item in Destination folder DirB and its sub-folders and make sure it mirrors the source directory DirA and its sub-folders. It deletes extra files or copies over new or updated files to complete this task.


Internet Information Services 8.5, Windows server 2012 R2, asp.net 4.5.1 error "The resource cannot be found."


After configuring my application in IIS, I was continuously getting this error "The resource cannot be found." while requesting any aspx files. Images and html files were opening just fine


Server Error in '/' Application.
The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /myapp/Index.aspx


It turned out that I have created the website and pointed the folder as f:
ie; the in the site, the physical path was pointing to f:
It started working after I changed f: to f:\

I didn't care about this as nobody was supposed to access the site directly; they all will go to a sub application folder. I had then proceeded to create my application myapp under this site and copy all the application files over. Unfortunately, the application refused to execute any aspx code with this odd error "The resource cannot be found." in any subfolders (sub applications under main site) until I fixed the path of the main site as f:\


HTTP Error 500.24 - Internal Server Error ASP.net 4

HTTP Error 500.24 - Internal Server Error

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

Most likely causes:

  • system.web/identity@impersonate is set to true.

Things you can try:

  • If the application supports it, disable client impersonation.
  • If you are certain that it is OK to ignore this error, it can be disabled by setting system.webServer/validation@validateIntegratedModeConfiguration to false.
  • Move this application to an application pool using Classic .NET mode - for example, %SystemRoot%\system32\inetsrv\appcmd set app "Default Web Site/" /applicationPool:"Classic .NET AppPool"
(You can set "Classic .NET AppPool" to the name of another application pool running in Classic managed pipeline mode)

Detailed Error Information:

Module   ConfigurationValidationModule
Notification   BeginRequest
Handler   StaticFile
Error Code   0x80070032
Requested URL   https://localhost:443/images/welcome/login2.jpg
Physical Path   C:\images\welcome\login2.jpg
Logon Method   Not yet determined
Logon User   Not yet determined

More Information:

If you are not sure or unable to use the first two options, then it is preferred that you move this application to Classic mode. View more information »


It started working once I changed from
<identity impersonate="true" /> to <identity impersonate="false" /> in file : C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config

Windows Server 2012 R2, Internet explorer 11 (IE) not able to browse https (SSL secured) sites

Not sure why this is, but the only way it started working was by unchecking option “warn if changing between secure and nonsecure mode” in  Internet explorer 11 (IE) advanced settings. Once done, was able to browse any https sites.

It was really odd this has to be done so https sites can be browsed. Before the change, if you try to navigate via https, the browser will act as if it was not clicked or accessed. I had Internet Explorer Enhanced Security Configuration enabled, so not sure if this has anything to do with the problem

Monday, September 15, 2014

SQL Server Reporting Services (SSRS) and HTTP 400 Bad Request (Invalid Hostname)

If iis (Internet Information Services) is stopped and SSRS (SQL Server Reporting Services) is kept running, you will receive HTTP 400 error with message Bad Request (Invalid Hostname) for any sites that was accessible under the same iis host.

This is bad if you are running under a LB (load balancer) and users accessing the site will start getting the 400 errors.

Only solution is to be sure you stop or start iis and ssrs at the same time. You cannot have one stopped while the other is kept running.

Thursday, September 4, 2014

How to delete empty folders using windows command prompt

A simple way is to do this is to use xcopy to make a copy of the entire directory structure using /s switch. help for /s says Copies directories and subdirectories except empty ones.

xcopy dirA dirB /S

where dirA is source with Empty folders. DirB will be the copy without empty folders

.Net C# - How to Bypass invalid SSL certificate errors when calling web services from .Net

C# (ASP.Net) error
Error:
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
and:
The remote certificate is invalid according to the validation procedure.

Below code can be used to bypass ssl related errors while calling webservices from your .net code


string sUrl = "http://mysite.com/myservice";
System.Net.WebClient client = new System.Net.WebClient();
System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
string sHttpResonse = client.DownloadString(sUrl);

HP Fortify Software Security Center (SSC) install - Deploying Software Security Center in Tomcat

On Deploying Software Security Center in Your Application Server ==> Deploying Software Security Center in Tomcat

From documentation:
Extract the ssc.war file contents into a deployment folder in the Tomcat installation directory


You need to extract the contents. For this, you can use winzip or 7-zip or even rename the .war as zip and open in windows explorer. Extract the contents in folder tomcat_directory_root\webapps (create a new folder ssc over here ie; under webapps)

Wednesday, September 3, 2014

HP Fortify Software Security Center (SSC) install - Error while trying to seed process templates


Seeding a New Fortify Software Security Center (SSC) Database

In SSC configuration tool, option database setup, Seed process Templates was giving an unexpected error.

The HP-Fortify-Server-WAR\logs\ssc-configuration.log file had the below

INFO 2014-09-03 22:55:20,586 [com.fortify.server.configuration.db.DBUtil] - Error occurred during initialization of VM
Could not reserve enough space for object heap

ERROR 2014-09-03 22:55:20,596 [com.fortify.server.configuration.db.DBUtil] - Error seeding db

ERROR 2014-09-03 22:55:20,596 [com.fortify.server.configuration.db.DBUtil] - Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


After a lot of googling, found that the java VM is not able to allocate enough memory while starting from the host OS. Turns out all I had to do to fix is to edit the "ssc-configuration.cmd" file in "HP-Fortify-Server-WAR" folder and change MAX_MEMORY & MAX_PERMGEN to 512M from the default of 1024M. The seeding process went fine after this update :)

Wednesday, August 6, 2014

With only ASPX (asp.net) code, connect to SQL server database, and list table contents with query (no compilation or dll needed)

Mypage.aspx


<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title></head>
<body>
    <form id="form1" runat="server">
        <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" EnableModelValidation="True" AllowPaging="True" AutoGenerateColumns="true">            
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:maniConnectionString %>" SelectCommand="SELECT * FROM [Server_Capacity_1]"></asp:SqlDataSource>
    </form>
</body>
</html>
Sample web.config connecting to SQL Server


<?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <add name="MyConnectionString" connectionString="Data Source=myservername.com;Initial Catalog=MyDBName;Persist Security Info=True;User ID=myuserid;Password=myPassword"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>

Hyperion interactive reporting studio BQY file grows large/huge over a period of time

If you use Brio to develop reports and save the file multiple time's you may have noticed that the file have grown huge over a period of time, and hence takes a long time to save. To reduce the file size, follow the below steps:

Warning: You will temporarily lose all data saved in the report (ie; generated report). Please don't try if you cannot generate it back and this data is important


  1. Open the bqy file in hyperion interactive reporting studio (I have tied this on 11.1.2)
  2. File --> Save Options --> Save Query Results with Document
  3. A small popup will open. In the left box that say query results, uncheck all boxes and hit OK
  4. Save the document. Now if you see the file size, it will be much smaller
  5. Close the report (or if you want, you can close the hyperion interactive reporting studio itself)
  6. Follow the below steps if you need to save the data as well
  7. Re-open the bqy report
  8. Process your report again so it will generate results
  9. File --> Save Options --> Save Query Results with Document
  10. A small popup will open. In the left box that say query results, check all boxes and hit OK
  11. Save the file
  12. You should have the data back, and the file size will be still much lower

Thursday, May 15, 2014

Creating a self signed certificate for development with subject alternative names

this is for IIS and assumption is Visual Studio is installed

cd C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin

makecert.exe -n "CN=My Development Root CA,O=My,OU=Development,L=Houston,S=TX,C=US" -pe -ss Root -sr LocalMachine -sky exchange -m 120 -a sha1 -len 2048 -r

makecert.exe -n "CN=mypc01, CN=mypc01.mydomain.net, CN=localhost, CN=mypc01.mycompany.com" -pe -ss My -sr LocalMachine -sky exchange -m 120 -in "My Development Root CA" -is Root -ir LocalMachine -a sha1 -eku 1.3.6.1.5.5.7.3.1

Saturday, April 26, 2014

ZyXEL NSA320 resetting admin password

Locate the reset button hole between the power connector and Ethernet cable at the back of the NSA box. Take a small pin and push the button until you hear a single beep (it will beep in about 1 or 2 seconds). Now remove the pin (ie; dont push anymore). Now, you can login with your default admin userid/password of admin/1234

None of your data or settings are lost by doing this!

Saturday, March 8, 2014

Provider load failure on SQL Server 2008 R2 reporting services (SSRS) installation

Below was the error on the log:
2014-03-09 03:08:36 Slp: Sco: Attempting to open registry subkey SOFTWARE\Microsoft\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Setup
2014-03-09 03:08:36 Slp: Sco: Attempting to get registry value SQLPath
2014-03-09 03:08:36 RS: Setting InstanceId.
2014-03-09 03:08:36 RS: Setting Authentication Type.
2014-03-09 03:08:36 Slp: Sco: Attempting to get account sid for user account NT AUTHORITY\NETWORK SERVICE
2014-03-09 03:08:36 Slp: Sco: Attempting to get sid for user account NT AUTHORITY\NETWORK SERVICE
2014-03-09 03:08:36 Slp: Sco: GetSidForAccount normalized accountName NT AUTHORITY\NETWORK SERVICE parameter to NT AUTHORITY\NETWORK SERVICE
2014-03-09 03:08:36 RS: Setting AsOleDb folder.
2014-03-09 03:08:36 RS: Persisting configurations.
2014-03-09 03:08:36 Slp: Configuration action failed for feature RS_Server_Adv during timing ConfigRC and scenario ConfigRC.
2014-03-09 03:08:36 Slp: Provider load failure
2014-03-09 03:08:37 Slp: The configuration failure category of current exception is ConfigurationFailure
2014-03-09 03:08:37 Slp: Configuration action failed for feature RS_Server_Adv during timing ConfigRC and scenario ConfigRC.
2014-03-09 03:08:37 Slp: System.Management.ManagementException: Provider load failure
2014-03-09 03:08:37 Slp:    at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
2014-03-09 03:08:37 Slp:    at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
2014-03-09 03:08:37 Slp:    at Microsoft.ReportingServices.WmiProvider.WmiProviders.GetInstance(String machineName, String instanceName, RSWmiNamespaces rsNamespace, ConnectionOptions connOptions, ObjectGetOptions getOptions)
2014-03-09 03:08:37 Slp:    at Microsoft.ReportingServices.WmiProvider.WmiProviders.GetReportServerAdmin(String machineName, String instanceName, ConnectionOptions connOptions, ObjectGetOptions getOptions)
2014-03-09 03:08:37 Slp:    at Microsoft.ReportingServices.WmiProvider.WmiProviders.GetReportServerAdmin(String machineName, String instanceName)
2014-03-09 03:08:37 Slp:    at Microsoft.SqlServer.Configuration.RSExtension.Configuration.ConfigurationWMI.Connect(String instanceName)
2014-03-09 03:08:37 Slp:    at Microsoft.SqlServer.Configuration.RSExtension.Configuration.ConfigurationAPI..ctor(String configFilePath, String instanceName)
2014-03-09 03:08:37 Slp:    at Microsoft.SqlServer.Configuration.RSExtension.Configuration.ReportServerConfiguration.GetConfigurationAPI(String instanceName)
2014-03-09 03:08:37 Slp:    at Microsoft.SqlServer.Configuration.RSExtension.Configuration.ReportServerConfiguration.Persist(String instanceID, String instanceName)
2014-03-09 03:08:37 Slp:    at Microsoft.SqlServer.Configuration.RSExtension.SQLRSConfigurationPrivate.Install_ConfigRC(Dictionary`2 actionData, PublicConfigurationBase spcb)
2014-03-09 03:08:37 Slp:    at Microsoft.SqlServer.Configuration.RSExtension.SQLRSConfigurationPrivate.InstallImpl(ConfigActionTiming timing, Dictionary`2 actionData, PublicConfigurationBase spcb)
2014-03-09 03:08:37 Slp:    at Microsoft.SqlServer.Configuration.RSExtension.SQLRSConfigurationPrivate.Install(ConfigActionTiming timing, Dictionary`2 actionData, PublicConfigurationBase spcb)
2014-03-09 03:08:37 Slp:    at Microsoft.SqlServer.Configuration.SqlConfigBase.PrivateConfigurationBase.Execute(ConfigActionScenario scenario, ConfigActionTiming timing, ConfigBaseAction action, Dictionary`2 actionData, PublicConfigurationBase spcbCurrent)
2014-03-09 03:08:37 Slp:    at Microsoft.SqlServer.Configuration.SqlConfigBase.SqlFeatureConfigBase.Execute(ConfigActionScenario scenario, ConfigActionTiming timing, ConfigBaseAction action, Dictionary`2 actionData, PublicConfigurationBase spcbCurrent)
2014-03-09 03:08:37 Slp:    at Microsoft.SqlServer.Configuration.SqlConfigBase.SlpConfigAction.ExecuteAction(String actionId)
2014-03-09 03:08:37 Slp:    at Microsoft.SqlServer.Configuration.SqlConfigBase.SlpConfigAction.Execute(String actionId, TextWriter errorStream)
2014-03-09 03:08:37 Slp: Exception: System.Management.ManagementException.
2014-03-09 03:08:37 Slp: Source: System.Management.
2014-03-09 03:08:37 Slp: Message: Provider load failure .


Turns out http://support.microsoft.com/kb/980142 describes the same error.
Solved by 
  1. running SQL Server R2 installation, do not select Reporting services at this time, select something else (eg: client utilities), complete install
  2. Install SQL Server R2 Service Pack 2 (SP2)
  3. Go back to R2 install, this time select Reporting Services, complete install (no error this time - yay)
  4. Install SP2 again and complete install

Sunday, February 23, 2014

Clumsy Ninja, level 22, bounce the ninja off the trampoline sideways

Get a trampoline, drag the Ninja and smash him onto the trampoline so he bounces off outside and lands on feet. that's it

It wont work if the ninja lands on the trampoline and the white circle appears around the trampoline indicating the ninja has started to do the "regular" bouncing. In this case, even if he lands on his feet left/right, you wont pass it. Key is not to start the regular bounce and have him jump off to side and land on feet

Turn on Windows 11 Fast Boot

If windows starting is slow, to enable windows 11 fast startup/boot,  Press Windows + R, type powercfg.cpl, and hit Enter.  This will direct...