December 07, 2020

C# get windows user app data folder path

 Hi folks,

Today I will explain to get the folder path of the windows user specific app data for storing any program (app) based information in C# (.NET Framework, .NET CORE, .NET 5)


Source

using System;

using System.IO;

namespace NETFrameworkConsoleApp1

{

    class Program

    {

        static void Main(string[] args)

        {

            string dir = Path.Combine(

                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),

                "FolderName"

            );

            Console.WriteLine("User Appdata Path: \n " + dir);

            Console.ReadLine();

        }

    }

}


Hope this helps you to customize your requirement.

References

https://docs.microsoft.com/en-us/dotnet/api/system.environment?view=net-5.0

Please share your comments and feedback to psrdotcom@gmail.com


C++ get windows user app data folder path

 Hi folks,

Today we will see how we can get the folder path of the windows user specific app data for storing any program (app) based information.


Source

#include <iostream>

#include <tchar.h>

#include <shlwapi.h>

#pragma comment(lib,"shlwapi.lib")

#include "shlobj.h"

using namespace std;

int main()

{  

    TCHAR szPath[MAX_PATH];

    // Get path for each computer, non-user specific and non-roaming data.

    if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, szPath)))

    {

        // Append product-specific path

        PathAppend(szPath, _T("\\App Folder Path\\"));

        wcout << "User AppData Roaming Folder Path: \n" << szPath << endl << endl;

    }

    

    // Get path for each computer, non-user specific and non-roaming data.

    if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, 0, szPath)))

    {

        wcout << "System Program Files Folder Path: \n" << szPath << endl << endl;

    }

    cout << "==end==";

}


Hope this helps you to customize your requirement.

References

https://docs.microsoft.com/en-us/windows/win32/shell/csidl

Please share your comments and feedback to psrdotcom@gmail.com


November 10, 2020

Run or deploy Go (Golang) project code in IIS as web server

 Hi folks,

Today we are going to see, how we can run or deploy the Go (Golang) project in IIS.

Development

  1. Create your Golang project with web APIs
  2. Build the Go project
  3. Go build
  4. Result will be an .exe file
  5. Create a web.config file
  6. Update the following content

<?xml version="1.0" encoding="utf-8"?>

<configuration>

    <system.webServer>

        <handlers>

            <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />

        </handlers>

        <aspNetCore processPath=".\<<GoProject>>.exe" />

    </system.webServer>

</configuration>

Deployment 

  1. Place the <<GoProject.exe>> and web.config in IIS server accessible folder.
  2. Open IIS
  3. Create a new website
  4. Enter the web app details with port different from the project internal port
  5. Create or choose pool with .NET CLR version as "No managed code"
  6. The configured website looks like below
  7. After starting the website, user should be able to access the APIs
Hope, this information helps you to deploy the GOlang project in IIS.

 Request you send your feedback and comments to psrdotcom@gmail.com


October 31, 2020

Generate or Create ECDSA - Elliptic Curve Digital Signature Algorithm Keys using OpenSSL in Windows

 Hi folks,

Today we will see how we can create ECDSA (Elliptic Curve Digital Signature Algorithm) Keys


Pre-requisites

OpenSSL

Add openssl bin directory to the environment PATH variable 


Generate Keys

Open Powershell and execute the following commands

1. Get the ECC curves list

openssl ecparam -list_curves
2. Generate a private key using your chosen curve
openssl ecparam -name prime256v1 -genkey -noout -out private-key.pem
3. Generate public key from the private key
openssl ec -in private-key.pem -pubout -out public-key.pem

4. Create a self-signed certificate with 1 year validity
openssl req -new -x509 -config "<opensslDirPath>/share/openssl.cnf" -key private-key.pem -out cert.pem -days 360

5. Convert pem to pfx
get-content private-key.pem, cert.pem | out-file cert-with-private-key
openssl pkcs12 -export -inkey private-key.pem -in cert-with-private-key -out cert.pfx

 Note: Enter the password when prompted (Optional)

Now, you can install the PFX file and check the certificate properties and make use of it.

Send your valuable feedback and comments to psrdotcom@gmail.com


October 07, 2020

Microsoft Azure DevOps Boards move or copy tasks between projects

 Hi all,


Today we will go through the different ways to organize the work items in Microsoft Azure DevOps Boards.

Pre-requisites

User should have appropriate permissions in both the projects.


Moving the work items between projects

  • Select the required items from Boards -> Work items
  • Select the more options icon (...) from any one of the selected work item
  • Choose "Open selected items in Queries" options
  • Queries page navigation will happen
  • Select all the items from query results (Ctrl+A)
  • Select the more options icon (...) from any one of the selected work item
  • Choose "Move to team project" options
  • Queries Page

  • Move work item dialog opens up

  • Choose appropriate options and click Ok.
  • All the items would be listed in moved project queries window.
  • Click on "Save items" option.


Copy work items between projects

Export work items

  • Select the required work items
  • Select the more options icon (...) from any one of the selected work item
  • Choose "Open selected items in Queries" options
  • Queries page navigation will happen
  • Select all the items from query results (Ctrl+A)
  • Export the work items to CSV file



Import the work items

  • Navigate to the required project boards section where the work items has to be created
  • Click on "Import work items" option
  • Import work item

  • Queries page navigation will happen
  • Import work items

  • Choose the exported CSV file and click on "Import" button
  • The work items would be listed in queries section
  • Click on "Save items"
  • Navigate to "Work items" section to view the added work items.


Request you send your comments and feedback below or send mail : psrdotcom@gmail.com


October 06, 2020

Download Chrome Extension for offline Installation

 Hi folks,

I tried to use my extension for offline usage for a VM based PC browser which doesn't have internet to download the extension.

So, I have come up with this approach where you can download the chrome extension (.crx) file.

Find the extension ID

Sample browser extension URL in chrome web store is below

https://chrome.google.com/webstore/detail/previous-next-page/fmichikmgflpgibapdhepmodjdjemmda

Last word is the extension ID (fmichikmgflpgibapdhepmodjdjemmda)

Download the extension file

Browser: Use Mozilla Firefox or other browser but not chrome

Syntax

https://clients2.google.com/service/update2/crx?response=redirect&prodversion=<<browser_version>>&acceptformat=crx2,crx3&x=id%3D<<extensionID>>%26uc

Example

https://clients2.google.com/service/update2/crx?response=redirect&prodversion=85.0.4183.121&acceptformat=crx2,crx3&x=id%3Dfmichikmgflpgibapdhepmodjdjemmda%26uc

Install the extension

  1. Copy the .crx file to your offline computer
  2. Open Chrome browser
  3. Navigate to chrome://extensions
  4. Enable developer mode
  5. Drag and drop the .crx file

Hope you will be able to use the offline extensions in chrome.


Request you send your comments and feedback in blog or mail : psrdotcom@gmail.com


Convert JSON file to CSV with Python

 Hi folks,

Today I will explain the code to implement the Json2CSV conversion.

Make sure you have valid JSON file with an array of objects.

Sample:

"Users":[

{"id": 1, "Name": "Suresh Raju", "Age": 35},

{"id":2, "Name": "PSR", "Age": 34}

]

I have chosen Python language to convert because of inbuilt library support for json and csv and command line execution with Notepad++ as editor.

Source Code Snippet: GitHub Gist

Please send your valuable feedback and comments to psrdotcom@gmail.com


October 04, 2020

Base 64 Encode with Powershell Script

 Hi all,

Today I will explain the snippet which gives you a base 64 encoded string

$enc = [system.Text.Encoding]::UTF8

$guid = "42f930c2-2ba2-4d5a-a102-898321122414"

$base64encodedstring = [System.Convert]::ToBase64String($enc.GetBytes($guid))

Write-Host "bBse64 Encoded String: $base64encodedstring"

Hope this helps when you are planning to generate and use/store the base64 encoded value

September 09, 2020

Record Whatsapp Video Call with Audio on Android

 Hi all,

Keeping legal things apart, if you want to record video call of your own Whatsapp, please use below information

Android Play Store Apps

  1. AZ Screen Recorder - Video Recorder, Livestream
  2. Cube ACR Call Recorder 

iOS

Use the iOS screen recorder option to record the video

Hope this helps you to record whatsapp video.

Please send your comments and feedback to psrdotcom@gmail.com

August 27, 2020

Notepad ++(PlusPlus) Auto increment line numbering or symbol (bullet) to the text content using Column / Multi-Selection Editor

 Hi folks,

I was searching for automatically adding numbers for the content which is distributed in sequential lines

Sample Input

A

B

C

Multi-line Column Select

  • Press and hold Alt keyboard button and drag the mouse cursor from top-bottom (bottom-top) in the same column (say column 1)
  • Keyboard Shortcut: Press and hold Shift + Alt and Click DownArrow/UpArrow until the end of the column

Column / Multi-Selection Editor

  1. Click Edit Menu
  2. Select Column Editor (Alt + C)

Insert Number list

  1. Choose "Number to Insert" section
  2. Enter the values in "Initial Number", "Increased by" and "Repeat"
  3. Check "Leading Zeros", if required

Insert Text

  1. Choose "Text to Insert"
  2. Insert the desired text/symbol

Format Selection

  1. Choose the desired format
  2. Default to "Decimal"

Please find the below image for your reference

Sample Output of auto increment number

1A

2B

3C

Sample Output of prefixing hyphen (-) to list

- A
- B
- C

Hopy this blog gives to explore more of Notepad++ editor. Happy hacking.

Please send your feedback and response to psrdotcom@gmail.com

August 24, 2020

Microsoft Azure DevOps Server move or copy Project Source Code from one organization to another organization

Hi folks,

Today I will explain the process of moving the projects from one organization to another in Azure DevOps Server which includes the source repository code, history of commits, tags.


Pre-requisites

  • Git command line tool
  • ssh-keygen tool
  • Azure DevOps Project access


Environment Setup

  1. Create ssh key on your local PC
  2. Same user account on both the organization with required permissions (Admin)
  3. On Azure DevOps, to go user profile
  4. Add the generated SSH pub key of PC to Azure DevOps


Procedure in terminal/command prompt

1. git clone <old org project repo ssh url>

2. cd <project>

3. git branch -a

    a. git checkout <all branches one by one>

4. git fetch --tags

5. git remote rm origin

6. git remote add orgin <new org project repo ssh url>

7. git push origin --all

8. git push --tags


Hope you are able to move/copy the project source code which includes the history of commits and tags.

Please send your comments and feedback to psrdotcom@gmail.com


August 13, 2020

Microsoft Windows Sysinternals Suite with file, disk, network, process, security utilities

Hi Folks,

Today, i will give an overview of Microsoft Windows Sysinternals Suite.

This suite helps users and admins to troubleshoot the OS and devices.

Sysinternals Suite

The Suite is a bundling of the following selected Sysinternals Utilities: AccessChk, AccessEnum, AdExplorer, AdInsight, AdRestore, Autologon, Autoruns, BgInfo, BlueScreen, CacheSet, ClockRes, Contig, Coreinfo, Ctrl2Cap, DebugView, Desktops, Disk2vhd, DiskExt, DiskMon, DiskView, Disk Usage (DU), EFSDump, FindLinks, Handle, Hex2dec, Junction, LDMDump, ListDLLs, LiveKd, LoadOrder, LogonSessions, MoveFile, NotMyFault, NTFSInfo, PageDefrag, PendMoves, PipeList, PortMon, ProcDump, Process Explorer, Process Monitor, PsExec, PsFile, PsGetSid, PsInfo, PsKill, PsList, PsLoggedOn, PsLogList, PsPasswd, PsPing, PsService, PsShutdown, PsSuspend, PsTools, RAMMap, RegDelNull, RegHide, RegJump, Registry Usage (RU), SDelete, ShareEnum, ShellRunas, Sigcheck, Streams, Strings, Sync, Sysmon, TCPView, VMMap, VolumeID, WhoIs, WinObj, ZoomIt

Individual Utilities

If you want to use or explore individual utilities then please use the below links for navigation

  1. File and Disk Utilities
  2. Networking Utilities
  3. Process Utilities
  4. Security Utilities
  5. System Information
  6. Miscellaneous

My favorites

  1. DiskMon - Disk monitor whenever read/write happens to hard disk
  2. Disk2vhd - Convert your physical harddisk to Microsoft VHD (Virtual Hard Disk) format
  3. TCPView - List the TCP and UDP ports usage with process name
  4. Active Director Explorer - Advanced Active Directory (AD) viewer and editor
  5. VMMap - Virutal and physical memory analysis utility

Hope, these tools will help you to troubleshoot and/or make use of official Microsoft utilities to explore OS more.

Please send your feedback and comments to psrdotcom@gmail.com

July 27, 2020

Pay Vijayawada Municipal Corporation (VMC) Trade License Bill Online Payment

Hi Vijayawada residents,

Do not stand in the big queue/line for paying the property tax and water bill.

Now you can pay property tax and water bill online. 

Citizen Services Home Page

Click the below link to view all online payment links for Citizen services


Trade License (TL) Tax Payment Procedure

1. After clicking the citizen service link, click "Click here to pay your Trade taxes"
If that link not worked click on this link
2. Enter your trade license number (new or old) 
3. You would be redirected to a page where you have to do the following
  1. Amount
  2. Select payment gateway
  3. Accept terms and conditions
  4. Click on "Pay Online"
4. After clicking on "Pay Online" button, you would be redirected to the below page
5. Click on "Online Payment"
6. Then the following screen will come
7. Click on "SBI" button
8. Now you would be taken to SBI payments page, where you have to select the type of payment mode
9. Click on the appropriate mode and perform the payment
  • The credit card and netbanking charges differ from the screenshot (image) above
10. Once the payment is successful, you will get "Generate Receipt" button
11. Click on it and download the payment receipt.

Hope this blog post help you to do the online payment.

Please send your feedback and comments to psrdotcom@gmail.com

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com