Thursday, June 8, 2023

Angular Command

 command

ng serve

ng build -- not working in >=14 version

ng build -configuration -skip

ng install @angular/cli

ng g c <name>

ng g s <name>

npm run start

ng generate environments

ng new <Project Name>

cd <Project Name>

ng serve

ng generate environments
git config --global user.email "you@example.com"

git config --global user.name "Your Name"


ng add @ng-bootstrap/schematics

Asp.net Core Web API

Exception handler

https://www.codeproject.com/Articles/1250932/Logging-and-Exception-handling-Versioning-in-ASP-N

https://www.c-sharpcorner.com/UploadFile/1492b1/restful-day-sharp6-request-logging-and-exception-handingloggin/

https://medium.com/@luisalexandre.rodrigues/logging-http-request-and-response-in-net-web-api-268135dcb27b

Git Command

 git init

git add -a

git commit -m <comment>

git branch new

git branch

git push

git pull

git fetch

git add remote origin <repository url="">

git status

git revoke</repository></comment>

Sunday, May 14, 2023

Azure Devops for SQL scripts

https://dotnetthoughts.net/run-ef-core-migrations-in-azure-devops/

https://kontext.tech/article/697/entityframework-core-database-migration-in-azure-devops-pipeline

Tuesday, February 21, 2023

How to resolve Azure deployment connection string issue in appsettings.json file

1) Easily Read Key Vault Secrets From ASP.NET Core Web API Application.

Click here

2) Simple Configuration Of Connection String Through Key Vault.

Click here

3) Use 'Azure App Service Settings' build pipeline and add appsettings.json.

Click here

4) Build Pipeline with Azure DevOps – AppSettings.json Transformations with Variables.

Click here

Tuesday, January 5, 2021

Write data in Excel file with use of Python code

import xlsxwriter as xw

wbTransaction = xw.Workbook('Transaction.xlsx')

wsTransaction= wbTransaction.add_worksheet('Transations1')

transaction = (
    ['Tran Date','Tran Type','Tran Amount'],
    ['5/01/2019','Buy',100.00],
    ['5/02/2020','Buy',200.00],
)

row_number = 0
col_number = 0

for tranDate,tranType,tranAmt in transaction:
    wsTransaction.write(row_number,col_number,tranDate)
    wsTransaction.write(row_number,col_number + 1,tranType)
    wsTransaction.write(row_number,col_number + 2,tranAmt)

    row_number += 1

wsTransaction.write(row_number,1,'Total Amount')
wsTransaction.write(row_number,2,'=SUM(C2:C' + str(row_number) + ')')

wbTransaction.close()

Get Google Search list in CSV file with using Python Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from datetime import datetime
import csv
import pandas as pd
import requests
from bs4 import BeautifulSoup
# Performing google search using Python code
class Gsearch_python:
   def __init__(self,name_search):
      self.name = name_search
   def Gsearch(self):
      Listresult =[]
      GoogleList =[]
      
      #count = 0
      try :
         from googlesearch import search
      except ImportError:
         print("No Module named 'google' Found")
      for i in search(query=self.name,tld='co.in',lang='en',num=10,stop=1000,pause=2):
         GoogleList.append(i)
         
      now = datetime.now()
      date_time = now.strftime("%d%m%Y %H%M%S")
      my_df = pd.DataFrame(GoogleList)
      FilePath =r'F:\Technology\Python\DataScraping\Data' + '/' + str(date_time) +' GoogleList.csv'
      my_df.to_csv(FilePath, index=False, header=False)
         #count += 1
         #print (count)
         #print(i + '\n')


      for weburl in GoogleList:
         try:
            page = requests.get(weburl)
            soup = BeautifulSoup(page.content, 'html5lib')
            for line in soup.find_all('a'):
               if line.get('href'):
                  indexContobj = line.get('href').find("contact")
                  if indexContobj >= 0:
                     indexHtpobj = line.get('href').find("http")
                     #print(indexHtpobj)
                     if indexHtpobj >= 0:
                        #print(line.get('href'))
                        Listresult.append(line.get('href'))
         except ImportError:
            print("Connection Error")
         

                  
      #print(Listresult)
      mylist = list(dict.fromkeys(Listresult))
      now = datetime.now()
      date_time = now.strftime("%d%m%Y %H%M%S")
      FilePath =r'F:\Technology\Python\DataScraping\Data' + '/' + str(date_time) +' Listresult.csv'
      my_df = pd.DataFrame(mylist)
      my_df.to_csv(FilePath, index=False, header=False)
      

if __name__=='__main__':
   gs = Gsearch_python("real estate developers in Pune")
   gs.Gsearch()
   print("Completed")