<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bhavin on Medium]]></title>
        <description><![CDATA[Stories by Bhavin on Medium]]></description>
        <link>https://medium.com/@ItsMeBhavin?source=rss-2cc423dd4201------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*crAX8r32DDrSZmZM.png</url>
            <title>Stories by Bhavin on Medium</title>
            <link>https://medium.com/@ItsMeBhavin?source=rss-2cc423dd4201------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 10:53:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ItsMeBhavin/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Title]]></title>
            <link>https://medium.com/@ItsMeBhavin/title-4b3bb7476686?source=rss-2cc423dd4201------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b3bb7476686</guid>
            <category><![CDATA[webscrapingecommercedata]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Bhavin]]></dc:creator>
            <pubDate>Mon, 28 Aug 2023 21:46:37 GMT</pubDate>
            <atom:updated>2023-08-28T21:46:37.008Z</atom:updated>
            <content:encoded><![CDATA[<h3>Downloading PDFs with Python using Requests and BeautifulSoup</h3><p>Reference : <a href="https://www.geeksforgeeks.org/downloading-pdfs-with-python-using-requests-and-beautifulsoup/#">Downloading PDFs with Python using Requests and BeautifulSoup — GeeksforGeeks</a></p><pre># Import libraries<br>import requests<br>from bs4 import BeautifulSoup<br><br># URL from which pdfs to be downloaded<br>url = &quot;https://www.geeksforgeeks.org/how-to-extract-pdf-tables-in-python/&quot;<br><br># Requests URL and get response object<br>response = requests.get(url)<br><br># Parse text obtained<br>soup = BeautifulSoup(response.text, &#39;html.parser&#39;)<br><br># Find all hyperlinks present on webpage<br>links = soup.find_all(&#39;a&#39;)<br><br>i = 0<br><br># From all links check for pdf link and<br># if present download file<br>for link in links:<br> if (&#39;.pdf&#39; in link.get(&#39;href&#39;, [])):<br>  i += 1<br>  print(&quot;Downloading file: &quot;, i)<br><br>  # Get response object for link<br>  response = requests.get(link.get(&#39;href&#39;))<br><br>  # Write content in pdf file<br>  pdf = open(&quot;pdf&quot;+str(i)+&quot;.pdf&quot;, &#39;wb&#39;)<br>  pdf.write(response.content)<br>  pdf.close()<br>  print(&quot;File &quot;, i, &quot; downloaded&quot;)<br><br>print(&quot;All PDF files downloaded&quot;)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b3bb7476686" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop ‘Hung’ docker container with status=created]]></title>
            <link>https://medium.com/@ItsMeBhavin/stop-hung-docker-container-with-status-created-5880408ae185?source=rss-2cc423dd4201------2</link>
            <guid isPermaLink="false">https://medium.com/p/5880408ae185</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Bhavin]]></dc:creator>
            <pubDate>Tue, 21 Feb 2023 14:38:47 GMT</pubDate>
            <atom:updated>2023-08-27T14:59:36.530Z</atom:updated>
            <content:encoded><![CDATA[<p>Stop ‘Hung’ docker container with status=created</p><p>I have also encountered this a few times. What I did to stop the ‘hung’ container was -</p><ol><li>docker ps to display container ID</li><li>net stop docker - stop docker engine (Note all containers will stop)</li><li>Delete folder in c:\programdata\docker\containers whose name starts with the ID from step 1</li><li>net start docker - start docker engine</li></ol><p>Unfortunately the docker service still has to be stopped and started but at least I didn’t have to re-install.</p><p>NOTE: Above steps and process is for Windows Server.</p><h3>About Me</h3><p>I’m Loïc Azar, a French creative and product manager living in London. I’m passionate about creativity, technology, and productivity, and I write about these topics on my personal website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1/0*xOoNDOEI7pVtkpqn" /></figure><p><em>Originally published at </em><a href="https://itsmebhavin.wordpress.com/2023/02/21/stop-hung-docker-container-with-statuscreated/"><em>http://itsmebhavin.wordpress.com</em></a><em> on February 21, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5880408ae185" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some helpful frameworks from FB (opensource)]]></title>
            <link>https://medium.com/@ItsMeBhavin/some-helpful-frameworks-from-fb-opensource-aa04e592315b?source=rss-2cc423dd4201------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa04e592315b</guid>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[documentation-tool]]></category>
            <dc:creator><![CDATA[Bhavin]]></dc:creator>
            <pubDate>Thu, 29 Sep 2022 13:26:03 GMT</pubDate>
            <atom:updated>2023-08-27T15:00:34.662Z</atom:updated>
            <content:encoded><![CDATA[<p>Some helpful frameworks from FB (opensource)</p><h3>About Me</h3><p>I’m Loïc Azar, a French creative and product manager living in London. I’m passionate about creativity, technology, and productivity, and I write about these topics on my personal website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1/0*Nm_6MLajloSJ5UOZ" /></figure><p><em>Originally published at </em><a href="https://itsmebhavin.wordpress.com/2022/09/29/some-helpful-frameworks-from-fb-opensource/"><em>http://itsmebhavin.wordpress.com</em></a><em> on September 29, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa04e592315b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[gRPC Microservices — nest.js & asp.net core]]></title>
            <link>https://medium.com/@ItsMeBhavin/grpc-microservices-nest-js-asp-net-core-4053fe364cc?source=rss-2cc423dd4201------2</link>
            <guid isPermaLink="false">https://medium.com/p/4053fe364cc</guid>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[grpc]]></category>
            <category><![CDATA[grpc-gateway]]></category>
            <dc:creator><![CDATA[Bhavin]]></dc:creator>
            <pubDate>Tue, 12 Apr 2022 19:37:43 GMT</pubDate>
            <atom:updated>2023-08-27T15:02:20.182Z</atom:updated>
            <content:encoded><![CDATA[<h3>gRPC Microservices — nest.js &amp; asp.net core</h3><p>nestjs-microservices-gRPC-example</p><p>gRPC Microservices example using nest.js and asp.net core microservices and nest.js based gateway API to consume in client app.<br><a href="https://github.com/itsmebhavin/nestjs-microservices-gRPC-example"><strong>Explore the docs “</strong></a></p><p><a href="https://github.com/itsmebhavin/nestjs-microservices-gRPC-example/issues">Report Bug</a> · <a href="https://github.com/itsmebhavin/nestjs-microservices-gRPC-example/issues">Request Feature</a></p><h3>About The Project</h3><h3>Micorservices example using gRPC. Two microservices written in nest.js and ASP.NET Core using gRPC. Both of them connect to the gateway API (written in nest.js) using common <strong>proto</strong> file interfaces. No need to install Redis or RabbitMQ etc. as communication happen on RPC.</h3><h3>Why gRPC?</h3><p>gRPC is a modern open source high performance Remote Procedure Call (RPC) framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking and authentication. It is also applicable in last mile of distributed computing to connect devices, mobile applications and browsers to backend services.</p><h3>Why nest.js?</h3><p>NestJS is a framework for building efficient, scalable Node.js web applications. It uses modern JavaScript and is built with TypeScript. If you develop an API built with TypeScript, then NestJS is the way to go! It’s heavily inspired by Spring and Angular.</p><h3>What is an API Gateway?</h3><p>An API gateway is an entry point for all clients, in our case, for all client requests based on HTTP, but it doesn’t need to be limited to HTTP only. The API gateway handles requests in one of two ways. Some requests are simply proxied/routed to the appropriate service. It handles other requests by fanning out to multiple services</p><h3>Built With</h3><h3>Getting Started</h3><p>Here is the outline we are going to do -</p><ol><li>Common proto folder with <strong>proto</strong> files</li><li>nest.js microservice</li><li>.NET core microservice</li><li>nest.js gateway</li></ol><h3>Proto folder</h3><pre>$ cd grpc-nest-proto $ npm init --y $ git init $ mkdir proto $ touch proto/book.proto &amp;&amp; touch proto/greet.proto $ code .</pre><p>Now we have the proto folder and two files book.proto and greet.proto available. We are going to use book.proto in nest.js microservice and greet.proto in .NET Core microservice.</p><pre>//book.proto syntax = &quot;proto3&quot;; package book; service BookService { rpc getBooks (getBooksRequest) returns (getBooksResponse) {} rpc getBookById (getBookByIdRequest) returns (getBookByIdResponse) {} } // getBooks message getBooksRequest{ } message getBooksResponse { repeated Book books = 1; } message Book { int32 id =1; string title = 2; string description = 3; string author = 4; } // getBookById message getBookByIdRequest { int32 id = 1; } message getBookByIdResponse { Book book =1; }</pre><p>Book.proto has two methods to implement. getBooks and getBookById.</p><pre>// Greet.proto syntax = &quot;proto3&quot;; option csharp_namespace = &quot;aspnetcore_api&quot;; package greet; // The greeting service definition. service Greeter { // Sends a greeting rpc SayHello (HelloRequest) returns (HelloReply); } // The request message containing the user&#39;s name. message HelloRequest { string name = 1; } // The response message containing the greetings. message HelloReply { string message = 1; }</pre><p>Greet.proto will be used in .NET core microservice and it has one method to just greet hello {message}</p><p><strong>Package.json</strong> We have to install some dependencies to compile these two proto files into pure *.ts file so that our gateway API can understand these contracts.(i.e. methods)</p><pre>npm install @nestjs/microservices npm install rxjs npm install ts-proto</pre><p>We are also going to add some scripts to compile the files.</p><pre>&quot;proto:book&quot;: &quot;protoc --plugin=node_modules/.bin/protoc-gen-ts_proto -I=../grpc-nest-proto/proto --ts_proto_out=src/book/ ../grpc-nest-proto/proto/book.proto --ts_proto_opt=nestJs=true --ts_proto_opt=fileSuffix=.pb&quot;, &quot;proto:greet&quot;: &quot;protoc --plugin=node_modules/.bin/protoc-gen-ts_proto -I=../grpc-nest-proto/proto --ts_proto_out=src/greet/ ../grpc-nest-proto/proto/greet.proto --ts_proto_opt=nestJs=true --ts_proto_opt=fileSuffix=.pb&quot;, &quot;proto:all&quot;: &quot;npm run proto:book &amp;&amp; npm run proto:greet&quot;</pre><p><strong>NOTE:</strong> If you see some issues running these script and compiling your proto files, then you can download <a href="https://github.com/protocolbuffers/protobuf/releases">proto compiler</a> and compile your files.</p><pre>// here is how i run this commmand in windows powershell &gt;$nestjs-microservice-gRPC\grpc-nest-proto&gt; ..\protoc-3.20.0-win64\bin\protoc.exe --plugin=./node_modules/.bin/protoc-gen-ts_proto.cmd --ts_proto_out=./build ./proto/*.proto --ts_proto_opt=nestJs=true --ts_proto_opt=fileSuffix=.pb</pre><h3>nest.js microservice</h3><p>ok, so now we have proto files (i.e. contracts) ready to start with. We are going to make our first microservice using nest.js.</p><pre>$ cd grpc-nest-book-svc $ code . $ npm i @nestjs/microservices @grpc/grpc-js @grpc/proto-loader @nestjs/typeorm typeorm pg class-transformer class-validator $ npm i -D @types/node ts-proto $ nest g mo book &amp;&amp; nest g co book --no-spec &amp;&amp; nest g s book --no-spec</pre><p>Now, let’s start with bootstrapping-</p><pre>async function bootstrap() { const app = await NestFactory.createMicroservice(BookModule, { transport: Transport.GRPC, options: { url: &#39;0.0.0.0:50051&#39;, protoPath: &#39;./../grpc-nest-proto/proto/book.proto&#39;, package: &#39;book&#39;, }, }); // tslint:disable-next-line: no-console app.listen(); }</pre><p>Add dummy mock data for books — <a href="https://github.com/itsmebhavin/nestjs-microservices-gRPC-example/blob/master/grpc-nest-book-svc/src/books.mock.ts">mock books data</a></p><pre>@Controller(&#39;book&#39;) export class BookController { constructor(private readonly bookService: BookService) {} @GrpcMethod(&#39;BookService&#39;,&#39;getBooks&#39;) @Get() async getBooks(getBooksRequest): Promise&lt;getBooksResponse&gt; { return { books: await this.bookService.getBooks() } } @GrpcMethod(&#39;BookService&#39;,&#39;getBookById&#39;) @Get(&#39;:id&#39;) async getBookById(id:number): Promise&lt;getBookByIdResponse&gt; { return {book: await this.bookService.getBookById(id)} } }</pre><pre>import { getBooksResponse,Book } from &#39;../../grpc-nest-proto/build/proto/book.pb&#39;; import { Injectable, HttpException } from &#39;@nestjs/common&#39;; import { GrpcMethod } from &#39;@nestjs/microservices&#39;; import { BOOKS } from &#39;./books.mock&#39;; @Injectable() export class BookService { books = BOOKS; getBooks(): Promise&lt;Book[]&gt; { return new Promise(resolve =&gt; { resolve(this.books); }); } getBookById(param): Promise&lt;Book&gt; { console.log(param); return new Promise(resolve =&gt; { const book = this.books.find($book =&gt; $book.id === param.id); if (!book) { throw new HttpException(&#39;Book does not exist!&#39;, 404); } resolve(book); }); } }</pre><p><strong><em>Build and Run this microservice</em></strong></p><h3>ASP.NET Core microservice</h3><p><a href="https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp">C# for VSCode -optional if you use .NET IDE</a></p><pre>dotnet new grpc -o aspnetcore-api dotnet dev-certs https --trust</pre><p>Here is how we are going to use our <strong>SayHello</strong> contract from greet.proto file</p><pre>public override Task&lt;HelloReply&gt; SayHello(HelloRequest request, ServerCallContext context) { return Task.FromResult(new HelloReply { Message = &quot;Hello &quot; + request.Name }); }</pre><p><strong><em>Important files to check or take a look</em></strong></p><pre>Program.cs Appsettings.json proto/greet.proto (same as our generic grpc-nest-proto folder. You can even refer it from there)</pre><h3>nest.js API Gateway</h3><p>API Gateway is going to communicate with both of our microservices. It will be regular http based API which will handle request and responses to/from these microservices. It will use gRPC communication channel to talk to these microservices.</p><p>Gateway will have two sub-module</p><ul><li>Book</li><li>controller.ts’</li><li>module.ts</li><li>book.pb.ts (compiled book.proto file)</li><li>Greet</li><li>controller.ts</li><li>module.ts</li><li>greet.pb.ts (compiled greet.proto file)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q5NF8fyU4m7ZoNrm.png" /></figure><h3>Resources</h3><p><em>Originally published at </em><a href="https://itsmebhavin.wordpress.com/2022/04/12/grpc-microservices-nest-js-asp-net-core/"><em>http://itsmebhavin.wordpress.com</em></a><em> on April 12, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4053fe364cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Migrate Git Repository with Branches and Commit History]]></title>
            <link>https://medium.com/@ItsMeBhavin/how-to-migrate-git-repository-with-branches-and-commit-history-2131f2edddb7?source=rss-2cc423dd4201------2</link>
            <guid isPermaLink="false">https://medium.com/p/2131f2edddb7</guid>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Bhavin]]></dc:creator>
            <pubDate>Fri, 27 Aug 2021 02:49:16 GMT</pubDate>
            <atom:updated>2023-08-27T15:03:28.862Z</atom:updated>
            <content:encoded><![CDATA[<p>How to Migrate Git Repository with Branches and Commit History</p><h3>Overview</h3><p>A short and useful post today, recently we had a customer requirement to migrate their git repositories from one account to another service provider, for example moving from bitbucket to GitHub, the repositories had a history of branches and commit for over 5 years and were quite huge in size.</p><p>The solution was quite simple but I thought to document this for anyone who is looking to solve a similar problem.</p><h3>Solution</h3><p><strong>Step 1</strong> is to mirror the Git repository to your local machine by the following command</p><pre>$ git clone --mirror https://url-of-the-source-git-repo.git</pre><p>The above command would create a directory with your repository name.git format for example myproject.git</p><p><strong>Step 2</strong> is to create a new repository on the destination server with the same name (not required though)</p><p><strong>Step 3</strong> is set the remote repository URL, run the command from inside your git repo folder</p><pre>$ cd to-your-git-repo-folder.git $ git remote set-url --push origin https://url-of-the-destination-git-repo.git</pre><p><strong>Step 4</strong> is to push the repository to the destination</p><p>By running the following commands you can migrate the complete Git repository with all Commit history and Branches.</p><h3>About Me</h3><p>I’m Loïc Azar, a French creative and product manager living in London. I’m passionate about creativity, technology, and productivity, and I write about these topics on my personal website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1/0*35Lt2QeRYpKIl863" /></figure><p><em>Originally published at </em><a href="https://itsmebhavin.wordpress.com/2021/08/27/how-to-migrate-git-repository-with-branches-and-commit-history/"><em>http://itsmebhavin.wordpress.com</em></a><em> on August 27, 2021.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2131f2edddb7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>