Posts

Copy linux system file on windows using Winscp

Image
*Copy file from linux system to windows system *How to use winscp on windows Background : We have a AWS linux box on our extranet environment. I need to download a file from particular directory. I need private keys to access that box. I got the keys, now steps are straight forward. Step:1 Download latest version of winscp for following url. I took portable version. https://winscp.net/eng/download.php Step: 2 Click on the tool button Step:2 Click on "Run Pagent" option & add your private key for ssh session Step: 3 Insert following information & hit login. It will connect to remote box. 

The process could not read file "C:\***filepath**** due to OS error 3

The process could not read file due to OS error 3 Pull replication setup issue. In my scenario, I'm was trying to setup replication across the servers using SQL Server 2008 R2.  I was setting up pull subscription on another server. When i encountered same issue.  Reason behind this issue is that when you configure Pull subscription across server it expect snapshot replication to be shared folder. So I have created a shared folder & updated snapshot location at my publication. And then into my subscriber server as well.  To configure snapshot folder with security, use link below:- https://msdn.microsoft.com/en-us/library/ms151151.aspx Details about distribution agent security:-  https://msdn.microsoft.com/en-in/library/ms189691.aspx

Running powershell on new computer - Beginners

Hi Some time when you have setup a new computer, you might need to run powershell on the same. By default Powershell execution policy is "Restricted". to set it unrestricted execute following command:- PS C:\> Set-ExecutionPolicy Unrestricted The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution policy? [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y After pressing 'Y', It will set execution policy unrestricted. Reference links:- https://technet.microsoft.com/en-us/library/ee176961.aspx https://technet.microsoft.com/en-us/library/hh849812.aspx

Enable PowerShell remoting on windows machine

Use following command to enable remoting on window machine:- Enable-PSRemoting -force Set-Item wsman:\localhost\client\auth\CredSSP -value true -force Enable-WSManCredSSP -force -role server set-item wsman:localhost\client\trustedhosts -value * -force set-item wsman:\localhost\listener\listener*\port -value 80 -force restart-Service winrm winrm get winrm/config winrm enumerate winrm/config/listener Set-ExecutionPolicy RemoteSigned

Could not connect via HTTPS to https://forge.puppetlabs.com on windows

Error: Could not connect via HTTPS to https://forge.puppetlabs.com Unable to verify the SSL certificate The certificate may not be signed by a valid CA The CA bundle included with OpenSSL may not be valid or up to date This issue occurred when your windows system ssl cert is not updated. Few links suggest that you need to take update & try opening forge website. But this doesn't work with me.  I end up applying following solution :- Step 1: Put following content in a file name it as : geotrustglobal.pem  -----BEGIN CERTIFICATE----- MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt SGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG A1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe MBwGA1UEC...

The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by running the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.

Image
PowerShell execution remotely Error New-PSSession : [10.53.191.167] Connecting to remote server 10.53.191.167 failed with the following error message : The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by running the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic. At C:\BuildAgent\work\26c4aa5ad049462c\Build\Deploy\DeployToCI.ps1:76 char:11 +     $rs = New-PSSession -ComputerName 10.53.191.167 -Credential $cred -Authentic ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ...

Ranking the rows using ROW_NUMBER()

Hi Guys, here i m going to explain how you can give rank to the rows on the basis of column's information and by creating Partition. suppose you have a table, like:- M_Emp EmpId EmpName E001 GAGAN E001 GAGAN E001 GAGAN E002 AMAN E002 AMAN E003 NAMAN Now  Execute following query :-     SELECT EmpId, EmpName,     ROW_NUMBER()OVER(Partition by EMPID ORDER by EMPID) RowId       FROM M_Emp Output :- EmpId EmpName RowId E001 GAGAN 1 E001 GAGAN 2 E001 GAGAN 3 E002 AMAN 1 E002 AMAN 2 E003 NAMAN 1 This will results in the ranking of rows on the basis of column information. I hope you understand the logic/syntax behind. basically It is used to perform any rank based operation.