Monday 30 September 2019

Postgres Update with From clause

In Postgres Update query with From clause can be used to update by catching between two or more tables.

The thing to keep in mind is the use of aliases in a certain way. For eg. the below example works where the alias before set is missing i.e. the alias for the 1st table to be compared is missing.

update schema.table1 set col1=v.col1 from schema.table2 v where ...
...
and table1.col2=v.col2 and table1.col3=value and table1.state_cd=v.state_cd;

Wednesday 18 September 2019

Connecting to two SignalR websites using Android with different site names on same IIS

The host header needs to be set with the target domain 

mHubConnection = new HubConnection(serverUrl);Credentials credentials = new Credentials() {
    @Override    public void prepareRequest(Request request) {
        request.addHeader("Host", "domain name");    }
};mHubConnection.setCredentials(credentials);

Friday 13 September 2019

Creating New .Net Web App Instance with Different Domain


11)      Restore the database and since the database is the same for same URL path, the File option has to be selected and the log file name and mdf file names have to be changed as per the database name. Rest of the steps for the database are the same as for deploying a new instance.

22)      Create different containing directory in wwwroot for the web-app of the different instance.
For eg. C:\inetpub\wwwroot\nic_tms_out which will have the web app files
33)      Create a new Website in IIS and give its Physical Path as C:\inetpub\wwwroot\<containing path to webapp>

44)      Change the database name in the new web-app’s web.config


Thursday 12 September 2019

Creating New .Net Web App Instance with Same URL Path and Different Domain


1)      Restore the database and since the database is the same for same URL path, the File option has to be selected and the log file name and mdf file names have to be changed as per the database name. Rest of the steps for the database are the same as for deploying a new instance.

2)      Create different containing directories in wwwroot for the web-apps of the different instances.
               Inside the different containing directories the web-app name folder should be same as the                   path name needed.
               For eg. C:\inetpub\wwwroot\tms_as\tms  and C:\inetpub\wwwroot\tms_dl\tms
   

3)      Create a new Website in IIS and give its Physical Path as C:\inetpub\wwwroot\<containing path to webapp>

4)    Under the new website, select the containing directory, select the web-app folder under it,
       right(context) click and select Convert to Application.

5)     Change the database name in the new web-app’s web.config


Wednesday 11 September 2019

Enable local DNS for testing

1) Carry out the entry in C:\Windows\System32\drivers\etc\hosts file

2) As Administrator run the command ipconfig /dnsflush

3) To see the new testing DNS entries use the command ipconfig /displaydns


In Chrome disable auto picking HTTPS in the URL

Type chrome://net-internals/#hsts in the URL bar and click on

Delete domain security policies

after entering the URL.

You can add it again using 

Add HSTS domain


Tuesday 10 September 2019

MDF file exists issue while restoring same database with different name in SQL Server

While restoring same database with different name in SQL Server, on facing an issue of mdf file existing, click on the Files tab on the left during restore, and change the names of the files in the last column named Restore As.

Friday 6 September 2019

See size of JVM memory per class/object

Run the command for the respective Java version
 
cd /path/to/java/jdk1.8.0_65/
./jmap -dump:format=b,file=/path/to/dump/tomcat_dump.bin PID
 
Open the dump file in VisualVM