<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-877888251631454942</atom:id><lastBuildDate>Sun, 12 Jul 2026 10:53:32 +0000</lastBuildDate><category>laravel</category><category>database</category><category>heroku</category><category>ubuntu</category><category>apache</category><category>api testing</category><category>https</category><category>postgresql</category><category>postman</category><category>certbot</category><category>file upload tests</category><category>life experience</category><category>linux</category><category>postgres</category><category>ssl certificate</category><category>terminal</category><category>validation</category><category>web security</category><category>.ics</category><category>AI</category><category>Artificial Intelligence</category><category>Automation</category><category>DevOps</category><category>Developer Productivity</category><category>PHP</category><category>Software Engineering</category><category>Testing</category><category>accessors</category><category>aws</category><category>block</category><category>block IPs</category><category>chrome</category><category>circleci</category><category>collection run</category><category>commands</category><category>containers</category><category>context menu</category><category>cookie</category><category>cookie consent</category><category>cookie in laravel</category><category>cookie policy</category><category>cookie popup</category><category>database functions</category><category>debugging</category><category>directory owner</category><category>docker</category><category>docker-compose</category><category>ec2</category><category>eloquent</category><category>events</category><category>free</category><category>gdpr</category><category>greatest</category><category>heroku adon</category><category>heroku papertrail</category><category>heroku postgres adon</category><category>how to lead</category><category>http</category><category>http to https</category><category>icalender</category><category>index</category><category>inspect element</category><category>javascirpt</category><category>javascript snippet</category><category>jenkins</category><category>jobs</category><category>json</category><category>json vs jsonb</category><category>jsonb</category><category>laravel security</category><category>laravel validation</category><category>leadership</category><category>least</category><category>let&#39;s encrypt</category><category>maximum</category><category>meet</category><category>middleware</category><category>mysql</category><category>node.js</category><category>papertrail</category><category>parent child tree</category><category>permissions</category><category>postman cloud</category><category>postman test storage data</category><category>procfile</category><category>query explain</category><category>query optimization</category><category>rational database</category><category>redirect</category><category>relationships</category><category>rewrite rules</category><category>right click</category><category>screen sharing</category><category>security</category><category>server</category><category>sql</category><category>ssl</category><category>successful leader.</category><category>system logs</category><category>tech radar</category><category>thoughtworks</category><category>tool</category><category>ubuntu 22.04</category><category>unique rule</category><category>user groups</category><category>virtual columns</category><category>virtual hosts</category><category>webpack</category><category>webrtc pipewire</category><category>wildcard</category><category>zoom</category><title>Update Yourself</title><description>This blog is to share my personal experience, the knowledge that I gain in my life.</description><link>https://sssurii.blogspot.com/</link><managingEditor>noreply@blogger.com (Surinder Singh INSAN)</managingEditor><generator>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-4561663882497663147</guid><pubDate>Sun, 12 Jul 2026 09:30:27 +0000</pubDate><atom:updated>2026-07-12T15:00:27.936+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">AI</category><category domain="http://www.blogger.com/atom/ns#">Artificial Intelligence</category><category domain="http://www.blogger.com/atom/ns#">Automation</category><category domain="http://www.blogger.com/atom/ns#">Developer Productivity</category><category domain="http://www.blogger.com/atom/ns#">DevOps</category><category domain="http://www.blogger.com/atom/ns#">laravel</category><category domain="http://www.blogger.com/atom/ns#">PHP</category><category domain="http://www.blogger.com/atom/ns#">Software Engineering</category><category domain="http://www.blogger.com/atom/ns#">Testing</category><title>How are AI tools helping solve real, complex, and time-consuming problems faster?</title><description>&lt;p class=&quot;PDq2pG_selectionAnchorContainer&quot; data-end=&quot;1785&quot; data-start=&quot;1737&quot;&gt;Nowadays, almost everyone is either using &lt;a data-preview=&quot;&quot; href=&quot;https://www.google.com/search?ved=1t:260882&amp;amp;q=AI+tools+for+engineers&amp;amp;bbid=877888251631454942&amp;amp;bpid=4561663882497663147&quot; target=&quot;_blank&quot;&gt;AI tools&lt;/a&gt; or thinking about incorporating them into their daily work. At the same time, many professionals are still hesitant, worrying that AI might replace their jobs. While those concerns are understandable, I believe the bigger risk is ignoring these tools altogether.&lt;/p&gt;&lt;p class=&quot;PDq2pG_selectionAnchorContainer&quot; data-end=&quot;1785&quot; data-start=&quot;1737&quot;&gt;From my experience, AI isn&#39;t replacing engineers—it is helping engineers work faster and focus on solving more meaningful problems. Like any other tool, its value depends on how effectively we use it. The more we learn to collaborate with AI, the more productive and efficient we can become.&lt;/p&gt;&lt;p class=&quot;PDq2pG_selectionAnchorContainer&quot; data-end=&quot;1785&quot; data-start=&quot;1737&quot;&gt;Here are two real examples from my recent work where AI tools helped me solve complex and time-consuming engineering problems significantly faster.&lt;/p&gt;&lt;p class=&quot;PDq2pG_selectionAnchorContainer&quot; data-end=&quot;1785&quot; data-start=&quot;1737&quot;&gt;AI helped me audit and upgrade my project&#39;s tech stack by checking dependency compatibility and flagging version-specific issues in advance. Instead of manually reviewing every package and verifying the latest compatible versions, I was able to upgrade &lt;a data-preview=&quot;&quot; href=&quot;https://www.google.com/search?ved=1t:260882&amp;amp;q=PHP+8.2+compatibility&amp;amp;bbid=877888251631454942&amp;amp;bpid=4561663882497663147&quot; target=&quot;_blank&quot;&gt;PHP 8.2&lt;/a&gt; to &lt;a data-preview=&quot;&quot; href=&quot;https://www.google.com/search?ved=1t:260882&amp;amp;q=PHP+8.4+release+notes&amp;amp;bbid=877888251631454942&amp;amp;bpid=4561663882497663147&quot; target=&quot;_blank&quot;&gt;PHP 8.4&lt;/a&gt; (since some dependencies were not yet compatible with &lt;a data-preview=&quot;&quot; href=&quot;https://www.google.com/search?ved=1t:260882&amp;amp;q=PHP+8.5+compatibility+issues&amp;amp;bbid=877888251631454942&amp;amp;bpid=4561663882497663147&quot; target=&quot;_blank&quot;&gt;PHP 8.5&lt;/a&gt;) and &lt;a data-preview=&quot;&quot; href=&quot;https://www.google.com/search?ved=1t:260882&amp;amp;q=Laravel+upgrade+path&amp;amp;bbid=877888251631454942&amp;amp;bpid=4561663882497663147&quot; target=&quot;_blank&quot;&gt;Laravel&lt;/a&gt; from 10.x to 13.x, following the recommended upgrade path (10.x → 11.x → 12.x → 13.x). Of course, having well-written and comprehensive test cases gave me the confidence to validate the upgrade and ensure everything continued to work as expected.&lt;/p&gt;&lt;p class=&quot;PDq2pG_selectionAnchorContainer&quot; data-end=&quot;1785&quot; data-start=&quot;1737&quot;&gt;I had been facing an issue with our &lt;a data-preview=&quot;&quot; href=&quot;https://www.google.com/search?ved=1t:260882&amp;amp;q=define+CI+pipeline&amp;amp;bbid=877888251631454942&amp;amp;bpid=4561663882497663147&quot; target=&quot;_blank&quot;&gt;CI pipeline&lt;/a&gt; for quite some time. Running the complete &lt;a data-preview=&quot;&quot; href=&quot;https://www.google.com/search?ved=1t:260882&amp;amp;q=software+test+suite&amp;amp;bbid=877888251631454942&amp;amp;bpid=4561663882497663147&quot; target=&quot;_blank&quot;&gt;test suite&lt;/a&gt; took &lt;b&gt;more than 6 minutes&lt;/b&gt;, even with parallel execution enabled. I knew something wasn&#39;t right, but investigating the problem required a significant time investment, so it kept getting postponed. When we resumed development, I used an AI tool to investigate the issue. It identified the likely root cause within a couple of minutes, and I was able to fix the long-standing problem in about 5–7 minutes, reducing the CI execution time to &lt;b&gt;under 2 minutes&lt;/b&gt;.&lt;/p&gt;&lt;p class=&quot;PDq2pG_selectionAnchorContainer&quot; data-end=&quot;1785&quot; data-start=&quot;1737&quot;&gt;In both cases, AI didn&#39;t replace engineering knowledge—it accelerated the investigation, highlighted potential issues, and allowed me to spend more time solving the problem instead of searching for it.&lt;/p&gt;</description><link>https://sssurii.blogspot.com/2026/07/httpshow-ai-tools-helping-solve-real-problems.html</link><author>noreply@blogger.com (sssurii)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-5423924820497169909</guid><pubDate>Fri, 19 Jul 2024 13:27:00 +0000</pubDate><atom:updated>2024-07-19T21:55:28.945+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">api testing</category><category domain="http://www.blogger.com/atom/ns#">debugging</category><category domain="http://www.blogger.com/atom/ns#">postman</category><title>Postman Echo - An Easy Way to debug the Postman Requests</title><description>&lt;p&gt;While Testing APIs, sometimes we have a situation when we want to debug/know how my input payload goes to the server.&lt;br /&gt;&lt;br /&gt;I had a similar situation when I was testing a file uploading API using Postman cloud storage files, but on CircleCi it was returning an error with the message - file path not found.&lt;br /&gt;&lt;br /&gt;So I have to find what input payload it actually sends at that very moment.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here comes to save me - Postman Echo API.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Postman Eco API is a public API endpoint with POST method. As its name states, it just returns the input payload you send in the response. So That you can validate, what file path or input value actually sent in the request from the postman.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;POST&amp;nbsp;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #212121; white-space-collapse: preserve;&quot;&gt;https://postman-echo.com/post&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhtXxqqbAKcer4h9YOz6cYCvr8_fKAkjIgrGJJtRGfbH12grtycIWqY-fZoJYst6aO4ONiJfSdUxdvniaE-uksQlS8tMIriZQrc_FXB2jP2WMsl6h9zafXpU5ZcFwTunRj1QX5iFryOU7njFytR043o_Ao8-Oq61YcLS2hs-meSqkc5ZeGNLhxHIKDCJwJI&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;882&quot; data-original-width=&quot;1351&quot; height=&quot;418&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhtXxqqbAKcer4h9YOz6cYCvr8_fKAkjIgrGJJtRGfbH12grtycIWqY-fZoJYst6aO4ONiJfSdUxdvniaE-uksQlS8tMIriZQrc_FXB2jP2WMsl6h9zafXpU5ZcFwTunRj1QX5iFryOU7njFytR043o_Ao8-Oq61YcLS2hs-meSqkc5ZeGNLhxHIKDCJwJI=w640-h418&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;So, I found this cool feature really helpful. You don&#39;t need to go to other tool or application to debug and check the input payload.&lt;br /&gt;&lt;br /&gt;You can easily do it using Postman Echo.&lt;br /&gt;&lt;br /&gt;Hope it will also help you. Let me know your experience with it in comments,&amp;nbsp; once you use this.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;</description><link>https://sssurii.blogspot.com/2024/07/postman-echo-easy-way-to-debug-postman.html</link><author>noreply@blogger.com (sssurii)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEhtXxqqbAKcer4h9YOz6cYCvr8_fKAkjIgrGJJtRGfbH12grtycIWqY-fZoJYst6aO4ONiJfSdUxdvniaE-uksQlS8tMIriZQrc_FXB2jP2WMsl6h9zafXpU5ZcFwTunRj1QX5iFryOU7njFytR043o_Ao8-Oq61YcLS2hs-meSqkc5ZeGNLhxHIKDCJwJI=s72-w640-h418-c" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-1934905455828472778</guid><pubDate>Mon, 20 May 2024 07:46:00 +0000</pubDate><atom:updated>2024-05-20T13:16:03.013+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">api testing</category><category domain="http://www.blogger.com/atom/ns#">file upload tests</category><category domain="http://www.blogger.com/atom/ns#">postman</category><category domain="http://www.blogger.com/atom/ns#">postman cloud</category><category domain="http://www.blogger.com/atom/ns#">postman test storage data</category><title>Using Postman Cloud - Test Data Storage for file uploading APIs Collection Run</title><description>Last year in Dec. Postman has announced Test Data file storage facility to make file uploading API testing much simpler and share those files among the team, so everyone can directly use them from the cloud storage of Postman without configuring Working directory and placing the files inside it.&lt;br /&gt;In case you want to know about the older way, I have already explain older way in &lt;a href=&quot;https://sssurii.blogspot.com/2024/03/postman-collection-run-test-file-uploading-api-circleci-jenkins.html&quot; target=&quot;_blank&quot;&gt;last post&lt;/a&gt;&amp;nbsp;.&lt;br /&gt;&lt;br /&gt;For using Postman shared cloud storage for uploading files and sharing among the team, Please make sure you are using the latest version of Postman desktop application. Similarly, make sure you are using latest version of Postman CLI in-case you are testing file uploading APIs using Postman CLI collection run command.&lt;br /&gt;&lt;br /&gt;Let&#39;s understand now, how we can use this cool new feature of Postman Cloud File Storage, sharing among the team members and using it during the API testing.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;One can upload a file to Postman File storage&amp;nbsp;Using Postman API request Body - form data&lt;/b&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To upload files to the Postman cloud storage and share among the team:&lt;br /&gt;- Go to the request uploading file&lt;br /&gt;- Choose form-data as body type&lt;/div&gt;&lt;div&gt;- Select File type for input will be used to upload the file.&lt;/div&gt;&lt;div&gt;- To upload a new file, click on the Upload icon on the right side of value section, which will open a select file model. Select any file to upload.&lt;br /&gt;&lt;br /&gt;- Once selected and uploaded, the file one cloud storage will be shared among the team, you can select the uploaded file to use for the collection run. It will also show the list of files uploaded already, in-case there are some.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicvepKjNiCCUUu7m1lHgA9P52wBBa0bp2jxeCSJG3J8t_WEhJ26WEVTDBHYsQYCCjw9NV_ZlC4cCzmbDcP7rbbAHkvwtg3n7dObalrv1XdUPv_-TEHlG7-WHkyXYRQr1zyMcR4s6YhxWvXs4giAYuA5BnF1hhq5ttS5POOzQG_GZrCPeyO1d4CY6YRToGP/s848/postman%20test%20file%20upload.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Postman test file upload&quot; border=&quot;0&quot; data-original-height=&quot;478&quot; data-original-width=&quot;848&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicvepKjNiCCUUu7m1lHgA9P52wBBa0bp2jxeCSJG3J8t_WEhJ26WEVTDBHYsQYCCjw9NV_ZlC4cCzmbDcP7rbbAHkvwtg3n7dObalrv1XdUPv_-TEHlG7-WHkyXYRQr1zyMcR4s6YhxWvXs4giAYuA5BnF1hhq5ttS5POOzQG_GZrCPeyO1d4CY6YRToGP/s16000/postman%20test%20file%20upload.gif&quot; title=&quot;Postman test file upload&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All the files are uploaded to a request in a shared collection to the team, All the team members can see those files and can use the same at their end.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Managing Files on Postman Storage Cloud&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Open Postman &lt;b&gt;Teams&lt;/b&gt; dropdown menu on the top right corner and select &lt;b&gt;Resource Usage&lt;/b&gt; menu option. Now you will see the Resource Usage detail page having many sub-sections. &lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Scrolling down you will see &lt;b&gt;Test Data Storage&lt;/b&gt; under &lt;b&gt;Other resources&lt;/b&gt;&amp;nbsp;. Click on view detailed usage and you can see the list of uploaded test files on the Postman cloud storage.&lt;br /&gt;&lt;br /&gt;Here you can also see options to download or delete an already uploaded file. Here it&#39;s worth mentioning that if you delete a file, it will be deleted for the team as well.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Note: This Postman Test Data Storage feature is available to Free accounts as well.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>https://sssurii.blogspot.com/2024/05/using-postman-test-data-storage-testing-file-upload-collection-run.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicvepKjNiCCUUu7m1lHgA9P52wBBa0bp2jxeCSJG3J8t_WEhJ26WEVTDBHYsQYCCjw9NV_ZlC4cCzmbDcP7rbbAHkvwtg3n7dObalrv1XdUPv_-TEHlG7-WHkyXYRQr1zyMcR4s6YhxWvXs4giAYuA5BnF1hhq5ttS5POOzQG_GZrCPeyO1d4CY6YRToGP/s72-c/postman%20test%20file%20upload.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-5006079357899210039</guid><pubDate>Sun, 17 Mar 2024 08:53:00 +0000</pubDate><atom:updated>2024-03-17T14:23:13.437+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">api testing</category><category domain="http://www.blogger.com/atom/ns#">circleci</category><category domain="http://www.blogger.com/atom/ns#">collection run</category><category domain="http://www.blogger.com/atom/ns#">file upload tests</category><category domain="http://www.blogger.com/atom/ns#">jenkins</category><category domain="http://www.blogger.com/atom/ns#">postman</category><title>Postman Collection Run - How to Test File Uploading API on CircleCi or Jenkins </title><description>&lt;p style=&quot;text-align: left;&quot;&gt;From last couple of days,&amp;nbsp; I was doing R&amp;amp;D on&amp;nbsp;how we can test file uploading API on CircleCi or Postman collection Run?&lt;br /&gt;&lt;br /&gt;Finally, I found a way to test the File uploading APIs using the Postman Desktop app&amp;nbsp; OR Postman CLI collection run.&lt;br /&gt;I have also tested this solution, even on CircleCi for running the automated testing postman APIs by Postman CLI collection run.&lt;br /&gt;&lt;br /&gt;Here is step by step process, how you can test the file uploading API on CircleCi or Postman collection Run?&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Local Desktop App settings:&lt;/h3&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Open and go to Local Postman app settings -&amp;gt; General&lt;/li&gt;&lt;li&gt;Set working directly location&amp;nbsp; (&lt;i&gt;default is postman installation directory but can also choose any other directory&lt;/i&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigJNdArVaOb_IMw-6mlahyphenhyphen4XdhEH-zjZGptJeIWvmwjnYSXGv1VoQ1g8sQG8781l-oZ2t121l8VPEFpfTIglzcHXFS_FQCsQDIYHZ48yIiRjQgMh-04zJYqD1hS326a-CIpgzRlCsLedet63rPBrBIlND4Mm6qm8oGtd2rdfmw4ag4L8jMjAWbIun2qoOq/s941/postman%20settings.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;755&quot; data-original-width=&quot;941&quot; height=&quot;508&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigJNdArVaOb_IMw-6mlahyphenhyphen4XdhEH-zjZGptJeIWvmwjnYSXGv1VoQ1g8sQG8781l-oZ2t121l8VPEFpfTIglzcHXFS_FQCsQDIYHZ48yIiRjQgMh-04zJYqD1hS326a-CIpgzRlCsLedet63rPBrBIlND4Mm6qm8oGtd2rdfmw4ag4L8jMjAWbIun2qoOq/w632-h508/postman%20settings.png&quot; width=&quot;632&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Place files (to use in file upload APIs during the collection run) in the working directory selected as in the above step and also in the root directory of your project.&lt;/li&gt;&lt;li&gt;Now go to the API in which you need to upload a file, and select the file from the working directory selected in step 2.&lt;/li&gt;&lt;li&gt;Save that API and collection.&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioyrvTnMg22lZXcSRso91zqQXiwF9vNk5bNmIXEwqo7AEX_PEYRuIQ__nNoLgGQWbJxtJZSYByeTJQQ1HyHoTBdBg92YFoHpqid9lhx8tRR24X2koaUPqgYsdbxcQQ4EEe4TgrMAd51StV8mVna5-QJDETiaw6GAbUT4rEpR5Yqu4_xTjW_SZXwFinn-MH/s1096/postman-file-upload-api.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;797&quot; data-original-width=&quot;1096&quot; height=&quot;474&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioyrvTnMg22lZXcSRso91zqQXiwF9vNk5bNmIXEwqo7AEX_PEYRuIQ__nNoLgGQWbJxtJZSYByeTJQQ1HyHoTBdBg92YFoHpqid9lhx8tRR24X2koaUPqgYsdbxcQQ4EEe4TgrMAd51StV8mVna5-QJDETiaw6GAbUT4rEpR5Yqu4_xTjW_SZXwFinn-MH/w650-h474/postman-file-upload-api.png&quot; width=&quot;650&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;CircleCi or Jenkins Postman command&lt;/h3&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Now update the command to run postman collection in &lt;b&gt;.circleci/config.yml&lt;/b&gt; like&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;postman collection run postman/ci-collection.json --working-dir [project-root-directory]&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;where &lt;b&gt;project-root-directory&lt;/b&gt; can be &lt;b&gt;/var/www/html&lt;/b&gt; when using docker.&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Now the upload API should run normally for collection run on local Postman App and on CircleCi as well.&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;In case you still face any issue, please comment below, I will try to help you as soon as possible.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Note: Please keep your Postman App and CLI updated.&lt;/b&gt;&lt;/p&gt;</description><link>https://sssurii.blogspot.com/2024/03/postman-collection-run-test-file-uploading-api-circleci-jenkins.html</link><author>noreply@blogger.com (sssurii)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigJNdArVaOb_IMw-6mlahyphenhyphen4XdhEH-zjZGptJeIWvmwjnYSXGv1VoQ1g8sQG8781l-oZ2t121l8VPEFpfTIglzcHXFS_FQCsQDIYHZ48yIiRjQgMh-04zJYqD1hS326a-CIpgzRlCsLedet63rPBrBIlND4Mm6qm8oGtd2rdfmw4ag4L8jMjAWbIun2qoOq/s72-w632-h508-c/postman%20settings.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-5797232031755785024</guid><pubDate>Tue, 12 Mar 2024 06:54:00 +0000</pubDate><atom:updated>2024-03-12T12:24:09.014+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">eloquent</category><category domain="http://www.blogger.com/atom/ns#">laravel</category><category domain="http://www.blogger.com/atom/ns#">parent child tree</category><category domain="http://www.blogger.com/atom/ns#">relationships</category><title>How to Build Nested Tree Structures for Parent-Child using The Laravel Eloquent Relationships</title><description>&lt;p&gt;A few days back, working on a Laravel project I had to create an API returning the deeply nested Tree structure for the parent-child relationship of a given object entity - in this case, a Company. &lt;br /&gt;&lt;br /&gt;Although as an experienced PHP developer, I know how to build&amp;nbsp;Nested Tree Structures for Parent-Child relationships using core PHP and SQL queries. But I was looking to, if Laravel Eloquent provides any efficient inbuilt method to fetch the Parent-child relationship with a deep nested tree structure. &lt;br /&gt;&lt;br /&gt;This led me to search on ChatGPT for the same. Here I want to give credit to ChatGPT which not only saved my time but also suggested a new way to get the desired result using Laravel Eloquent Relationships.&lt;br /&gt;&lt;br /&gt;Before I explain the solution for building a Nested Tree Structure, first let&#39;s understand it.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Understanding Nested Tree Structures: &lt;/h3&gt;A nested tree structure organizes data in a hierarchical manner, making it easy to represent parent-child relationships. Each node in the tree can have multiple children, creating a flexible and intuitive structure.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Setting up the Database: &lt;/b&gt;&lt;br /&gt;Start by setting up a table in your database to store the companies. Include a parent_company column to establish the parent-child relationship. This column will contain the ID of the parent company. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Defining the Model: &lt;/b&gt;&lt;br /&gt;Create a model for your company table using Laravel Eloquent. This model will enable you to interact with the database and perform operations on the data.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;div style=&quot;background-color: white; color: #080808;&quot;&gt;&lt;pre style=&quot;font-family: &#39;JetBrains Mono&#39;,monospace; font-size: 10.5pt;&quot;&gt;&lt;span style=&quot;color: #0033b3;&quot;&gt;class &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Company &lt;/span&gt;&lt;span style=&quot;color: #0033b3;&quot;&gt;extends &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Model&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;    &lt;span style=&quot;color: #0033b3;&quot;&gt;protected &lt;/span&gt;&lt;span style=&quot;color: #871094;&quot;&gt;$fillable &lt;/span&gt;= [&lt;span style=&quot;color: #067d17;&quot;&gt;&#39;name&#39;&lt;/span&gt;, &lt;span style=&quot;color: #067d17;&quot;&gt;&#39;parent_company&#39;&lt;/span&gt;];&lt;br /&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Building the Tree Structure:&lt;/b&gt;&lt;br /&gt;To construct a nested tree structure, utilize methods provided by Laravel Eloquent. For instance, you can use the `hasMany` relationship to define the children of a company:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;div style=&quot;background-color: white; color: #080808;&quot;&gt;&lt;pre style=&quot;font-family: &#39;JetBrains Mono&#39;,monospace; font-size: 10.5pt;&quot;&gt;&lt;div&gt;&lt;pre style=&quot;font-family: &#39;JetBrains Mono&#39;,monospace; font-size: 10.5pt;&quot;&gt;&lt;span style=&quot;color: #0033b3;&quot;&gt;class &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Company &lt;/span&gt;&lt;span style=&quot;color: #0033b3;&quot;&gt;extends &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Model&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;    &lt;span style=&quot;color: #0033b3;&quot;&gt;public function &lt;/span&gt;&lt;span style=&quot;color: #00627a;&quot;&gt;children&lt;/span&gt;()&lt;br /&gt;    {&lt;br /&gt;        &lt;span style=&quot;color: #0033b3;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #660000;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #00627a;&quot;&gt;hasMany&lt;/span&gt;(&lt;span style=&quot;color: black;&quot;&gt;Company&lt;/span&gt;::&lt;span style=&quot;color: #0033b3;&quot;&gt;class&lt;/span&gt;, &lt;span style=&quot;color: #067d17;&quot;&gt;&#39;parent_company&#39;&lt;/span&gt;, &lt;span style=&quot;color: #067d17;&quot;&gt;&#39;id&#39;&lt;/span&gt;);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0033b3;&quot;&gt;public function &lt;/span&gt;&lt;span style=&quot;color: #00627a;&quot;&gt;descendants&lt;/span&gt;(): &lt;span style=&quot;color: black;&quot;&gt;HasMany&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;        &lt;span style=&quot;color: #0033b3;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #660000;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #00627a;&quot;&gt;children&lt;/span&gt;()-&amp;gt;&lt;span style=&quot;color: #00627a;&quot;&gt;with&lt;/span&gt;(&lt;span style=&quot;color: #067d17;&quot;&gt;&#39;descendants&#39;&lt;/span&gt;)-&amp;gt;&lt;span style=&quot;color: #00627a;&quot;&gt;withCount&lt;/span&gt;(&lt;span style=&quot;color: #067d17;&quot;&gt;&#39;users&#39;&lt;/span&gt;);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Retrieving the Tree with Children:&lt;/b&gt;&lt;br /&gt;Now, fetching the entire nested tree becomes straightforward. Suppose you want to retrieve all companies with their respective children:&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;div style=&quot;background-color: white; color: #080808;&quot;&gt;&lt;pre style=&quot;font-family: &#39;JetBrains Mono&#39;,monospace; font-size: 10.5pt;&quot;&gt;&lt;span style=&quot;color: #660000;&quot;&gt;$companies &lt;/span&gt;= &lt;span style=&quot;color: black;&quot;&gt;Company&lt;/span&gt;::&lt;span style=&quot;color: black;&quot;&gt;with&lt;/span&gt;(&lt;span style=&quot;color: #067d17;&quot;&gt;&#39;children&#39;&lt;/span&gt;)-&amp;gt;&lt;span style=&quot;color: black;&quot;&gt;get&lt;/span&gt;();&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Retrieving the Tree with Descendants: &lt;/b&gt;&lt;br /&gt;Fetching the entire nested tree along with descendants becomes a simple eloquent query:&lt;br /&gt;&lt;div style=&quot;background-color: white; color: #080808;&quot;&gt;&lt;pre style=&quot;font-family: &#39;JetBrains Mono&#39;,monospace; font-size: 10.5pt;&quot;&gt;&lt;span style=&quot;color: #660000; font-size: 10.5pt;&quot;&gt;$companies &lt;/span&gt;&lt;span style=&quot;font-size: 10.5pt;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: black; font-size: 10.5pt;&quot;&gt;Company&lt;/span&gt;&lt;span style=&quot;font-size: 10.5pt;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: black; font-size: 10.5pt;&quot;&gt;with&lt;/span&gt;&lt;span style=&quot;font-size: 10.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #067d17; font-size: 10.5pt;&quot;&gt;&#39;descendants&#39;&lt;/span&gt;&lt;span style=&quot;font-size: 10.5pt;&quot;&gt;)-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-size: 10.5pt;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;font-size: 10.5pt;&quot;&gt;();&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;So this is how using Laravel Eloquent, I have easily built and managed nested tree structures for parent-child relationships. This approach enhances the readability and maintainability of your code, providing a solid foundation for handling hierarchical data. &lt;br /&gt;&lt;br /&gt;I hope this will help you learn the basics of creating a nested tree structure in Laravel Eloquent. Feel free to explore additional features and customization options to suit your specific needs.&amp;nbsp;&lt;/div&gt;</description><link>https://sssurii.blogspot.com/2024/03/how-to-build-nested-tree-structures-in-laravel.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-1240850971327417069</guid><pubDate>Fri, 09 Feb 2024 07:30:00 +0000</pubDate><atom:updated>2024-02-12T22:46:16.059+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">heroku</category><category domain="http://www.blogger.com/atom/ns#">node.js</category><category domain="http://www.blogger.com/atom/ns#">procfile</category><category domain="http://www.blogger.com/atom/ns#">tech radar</category><category domain="http://www.blogger.com/atom/ns#">thoughtworks</category><category domain="http://www.blogger.com/atom/ns#">webpack</category><title>Challenges and Solutions: Deploying Thoughtworks Tech Radar Node.js + Webpack on Heroku.</title><description>&lt;p&gt;A few days back, I got a chance to deploy &lt;a href=&quot;https://github.com/thoughtworks/build-your-own-radar&quot; target=&quot;_blank&quot;&gt;Thoughtworks Tech Radar &lt;/a&gt;&amp;nbsp;(a Node.js package) on Heroku as our own organization Tech Radar. Although Deploying a Node.js application with Webpack on Heroku can be an easy process, still you may face certain challenges while deploying. &lt;br /&gt;Here&#39;s a brief rundown of the challenges I have faced and how I tackled them during the deployment process.&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;1. Missing Procfile&lt;/h3&gt;&lt;div&gt;One of the initial challenges I faced was forgetting to include a Procfile in my project&#39;s root directory. This resulted in Heroku not knowing how to start my application as Heroku uses a Procfile to determine how to run your application. Know more about &lt;a href=&quot;https://devcenter.heroku.com/articles/procfile&quot; target=&quot;_blank&quot;&gt;Procfile&lt;/a&gt;&lt;br /&gt;To resolve this, I created a simple Procfile that specifies the below command to run my Node.js server.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;```&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #080808; font-family: &amp;quot;JetBrains Mono&amp;quot;, monospace; font-size: 10.5pt;&quot;&gt;web: npm install --include=dev &amp;amp;&amp;amp; npm run dev&lt;/span&gt;&lt;/div&gt;&lt;div&gt;```&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;2. Heroku-prebuild - command&lt;/h3&gt;&lt;div&gt;Webpack is commonly used to bundle and optimize JavaScript code for production. However, after the build process, I realized that Heroku wasn&#39;t automatically executing the necessary steps to prepare my application for deployment. To address this, I added a heroku-prebuild&amp;nbsp;script in my package.json to ensure that the required build commands are executed before build deployment on Heroku.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;```&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&quot;scripts&quot;: {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &quot;heroku-prebuild&quot;: &quot;npm install --include=dev &amp;amp;&amp;amp; npm run build:dev&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;```&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;3. Dynamic Port binding - Heroku provides a dynamic port.&lt;/h3&gt;&lt;div&gt;Heroku dynamically assigns a port to your application, and you need to ensure that your Node.js server uses the correct port. To achieve this, I modified my Webpack server configuration to use the &lt;b&gt;process.env.PORT&lt;/b&gt; variable provided by Heroku added the following configuration to my webpack.dev.js file&lt;/div&gt;&lt;p&gt;```&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;devServer: {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; port: process.env.PORT || 3000,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;```&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;5. Invalid Host Header - Configure allowed host on Webpack&lt;/h3&gt;&lt;div&gt;Finally, when the build is deployed to Heroku without any build error, then I encounter an &quot;Invalid Host Header&quot; error while accessing the application landing page. This is a security feature in Webpack. To fix this, I added the following configuration to my webpack.dev.js file to allow request from my heroku app hostname like heroku-app-name.herokuapp.com where `heroku-app-name` can be your subdomain url or your app on Heroku.&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;```&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;devServer: {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; allowedHosts: [&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#39;heroku-app-name.herokuapp.com&#39;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp;],&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;4. Using ENVs inside the node.js + Webpack app&lt;/h3&gt;&lt;div&gt;After resolving all the above challenges, I was finally able to see my landing page. But still, there was one challenge left - It was not considering the new ENV variables I added to provide the Tech radar Google sheet URL&amp;nbsp; or ID.&amp;nbsp; I couldn&#39;t access the value of ENVs simply using&amp;nbsp;&lt;b&gt;process.env.SHEET &lt;/b&gt;as we can use in normal JS apps. For Webpack we need to pass it through Webpack configuration to make them available inside the app or src files.&lt;br /&gt;To access ENVs variable inside your src directory files i used Webpack configuration like below:&lt;br /&gt;```&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;plugins: [&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; new webpack.DefinePlugin({&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;process.env.API_KEY&#39;: JSON.stringify(process.env.API_KEY),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#39;process.env.SHEET_ID&#39;: JSON.stringify(process.env.SHEET_ID),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;```&lt;br /&gt;&lt;br /&gt;Official documentation for &lt;a href=&quot;https://webpack.js.org/configuration/&quot; target=&quot;_blank&quot;&gt;Webpack configuration&lt;/a&gt;&amp;nbsp;helped me a lot to resolve configuration-related issues.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Deploying our own Tech Radar (Node.js + Webpack app) on Heroku for the organization was a good learning experience for me, and resolving the above challenges&amp;nbsp;has enhanced my understanding of the deployment process of the Node.js app on Heroku. Finally, I was able to successfully deploy and run my application on Heroku. &lt;br /&gt;&lt;br /&gt;I hope this blog post helps fellow developers resolve similar issues in their node.js + web pack deployment journey on Heroku or even on other cloud platforms.&amp;nbsp;&lt;br /&gt;If you face any different challenge than above, please do let me know in the comments.&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>https://sssurii.blogspot.com/2024/02/deploy-nodejs-webpack-on-heroku.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-1700570495515995884</guid><pubDate>Tue, 22 Aug 2023 17:28:00 +0000</pubDate><atom:updated>2023-08-22T22:58:25.053+05:30</atom:updated><title>Helping others costs nothing But your selfish nature.</title><description>&lt;p&gt;Helping others costs nothing,&amp;nbsp; But your selfish nature.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;When things are for others only then we can see others&#39; needs and the difficulties they are facing. &lt;br /&gt;Helping others need courage and time to help as well, which ultimately cuts time for ourselves.&lt;br /&gt;Being selfish we can&#39;t do all this.&lt;/p&gt;</description><link>https://sssurii.blogspot.com/2023/08/helping-others-costs-nothing-but-your.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-2194967552422362650</guid><pubDate>Sun, 31 Jul 2022 06:53:00 +0000</pubDate><atom:updated>2023-11-03T23:39:04.746+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">containers</category><category domain="http://www.blogger.com/atom/ns#">docker</category><category domain="http://www.blogger.com/atom/ns#">docker-compose</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>Install Docker Desktop on Ubuntu 22.04 LTS</title><description>&lt;div&gt;Install Docker Desktop on Ubuntu&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;Prerequisites&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
    &lt;ul style=&quot;text-align: left;&quot;&gt;
        &lt;li&gt;For non-Gnome Desktop environments, gnome terminal must be installed:&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;code&gt;$ sudo apt install gnome-terminal&lt;/code&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;

&lt;div&gt;
    &lt;ul style=&quot;text-align: left;&quot;&gt;
        &lt;li&gt;Set up the repository

        &lt;p&gt;&lt;/p&gt;
        &lt;p&gt;1. Update the apt package index and install packages to allow apt to use a repository over HTTPS:&lt;/p&gt;
        &lt;code&gt;$ sudo apt-get update&lt;/code&gt;
        &lt;p&gt;&lt;/p&gt;
        &lt;code&gt;$ sudo apt-get install ca-certificates curl gnupg lsb-release
            &lt;/code&gt;
        &lt;p&gt;&lt;/p&gt;
        &lt;p&gt;2. Add Docker’s official GPG key:&lt;/p&gt;
        &lt;code&gt;$ sudo mkdir -p /etc/apt/keyrings
&lt;br /&gt;$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg&lt;/code&gt;
        &lt;p&gt;&lt;/p&gt;
        &lt;p&gt;3. Use the following command to set up the repository:&lt;/p&gt;
        &lt;code&gt;$ echo \&lt;br /&gt;&amp;nbsp; &amp;nbsp;&quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ &lt;br /&gt;$(lsb_release -cs) stable&quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null&lt;/code&gt;
    	&lt;/li&gt;
 	&lt;/ul&gt;
&lt;/div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;

Install&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;p&gt;&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt; Download the latest Docker Desktop version &lt;a href=&quot;https://docs.docker.com/desktop/install/linux-install/&quot; target=&quot;_blank&quot;&gt;file&lt;/a&gt;.
&lt;/li&gt;&lt;li&gt;Install the package with apt as follows:
  &lt;p&gt;
  &lt;code&gt;
    $ sudo apt-get update
&lt;br /&gt;$ sudo apt-get install Downloads/docker-desktop-&amp;lt;version&amp;gt;-&amp;lt;arch&amp;gt;.deb
  &lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;</description><link>https://sssurii.blogspot.com/2022/07/install-docker-desktop-on-ubuntu-2204.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-3539715567250517151</guid><pubDate>Fri, 29 Jul 2022 04:15:00 +0000</pubDate><atom:updated>2022-07-29T09:45:08.256+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">chrome</category><category domain="http://www.blogger.com/atom/ns#">meet</category><category domain="http://www.blogger.com/atom/ns#">screen sharing</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><category domain="http://www.blogger.com/atom/ns#">ubuntu 22.04</category><category domain="http://www.blogger.com/atom/ns#">webrtc pipewire</category><category domain="http://www.blogger.com/atom/ns#">zoom</category><title>Solution for Screen Sharing not working on Ubuntu 22.04</title><description>&lt;p&gt;Recently, I upgraded my system OS from ubuntu 20.04 LTS to 22.04 LTS which I have been waiting for a long-time. It seems all goes well until I faced issues while sharing my screen over &lt;b&gt;MEET or ZOOM&lt;/b&gt; meetings.&lt;br /&gt;&lt;br /&gt;I searched for solutions and found most of the solutions on Stackoverflow suggesting to disable the Wayland display feature and working with X11 which was used in earlier versions of Ubuntu OS. But disabling the Wayland UI scheme is not the correct solution,&amp;nbsp; because will slow down the system because the Wayland display feature is very fast in performance as compared to Xorg&amp;nbsp;X11. Moreover, the Wayland display feature is more secure than Xorg X11 while providing access to the system.&lt;/p&gt;&lt;p&gt;Actually, it is not a problem with Ubuntu OS itself. It is problem with the browser hasn&#39;t developed a feature compatible with Wayland security protocols.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;If anyone is facing problems with screen sharing because of OS upgraded to &lt;b&gt;ubuntu 22.04,&lt;/b&gt; Here is the solution (without disabling the Wayland display feature):&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Go to &lt;a href=&quot;chrome://flags/#enable-webrtc-pipewire-capturer&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;chrome://flags/#enable-webrtc-pipewire-capturer &lt;/a&gt;using the address bar of your Chome or Brave browser.&lt;/li&gt;&lt;li&gt;Enable the &lt;b&gt;WebRTC PipeWire&lt;/b&gt; support&amp;nbsp; Flag&lt;/li&gt;&lt;li&gt;Relaunch the Browser.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Now you can share your complete screen to Meet and Zoom calls. The solution is working on my system, you can test it on your own.&lt;/p&gt;&lt;p&gt;I will happy to help anyone facing a problem in the above process.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Note: Have to join Meet and Zoom meetings from browser only&lt;/b&gt;&lt;/p&gt;</description><link>https://sssurii.blogspot.com/2022/07/solution-for-screen-sharing-not-working.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-3577155617661461003</guid><pubDate>Sun, 10 Jul 2022 08:22:00 +0000</pubDate><atom:updated>2022-10-28T15:29:29.409+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">block IPs</category><category domain="http://www.blogger.com/atom/ns#">laravel</category><category domain="http://www.blogger.com/atom/ns#">laravel security</category><category domain="http://www.blogger.com/atom/ns#">middleware</category><title>Laravel Middleware - Block IPs using Middleware class</title><description>&lt;p&gt;When talking about securing the Laravel application, we might also want to restrict IP address to access our application, especially when we have Laravel&amp;nbsp;setup as a Backend server providing data through APIs or web services.&lt;br /&gt;&lt;br /&gt;As of today, you might find no. of Laravel&amp;nbsp;package providing IP address restriction functionality but I found it does not make any sense to install a package when it is achieved through only One class.&amp;nbsp;&lt;br /&gt;Yes! we can just do this with a simple middleware class.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Let me explain to you little details on how we can achieve it using the Middleware class.&lt;br /&gt;&lt;br /&gt;First, let&#39;s create a middleware class using the Laravel artisan command:&lt;/p&gt;
&lt;pre&gt;php artisan make:middleware RestrictIPAddress&lt;/pre&gt;
&lt;p&gt;It will create a new class in your Laravel project under the `&lt;span style=&quot;font-family: courier;&quot;&gt;app/Http/Middleware&lt;/span&gt;` directory.&lt;br /&gt;It will have a default empty method handle(), where you have to write your logic.&lt;br /&gt;&lt;br /&gt;Logic is simple, you just have to get the IP address from where the request is coming. here is the method to get IP from the incoming requests.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;pre&gt;private function getRequestingIp(): string
{
    $server = request()-&amp;gt;server-&amp;gt;all();
    if (isset($server[&#39;HTTP_X_FORWARDED_FOR&#39;])) {
        $ip_addresses = explode(&#39;,&#39;, $server[&#39;HTTP_X_FORWARDED_FOR&#39;]);
        return trim(end($ip_addresses));
    }
    return $server[&#39;REMOTE_ADDR&#39;];
}
&lt;/pre&gt;

&lt;p&gt;Once we got the request source IP, we compare this IP to our list of given IPs and will allow OR restrict the request ahead to application.&lt;br /&gt;&lt;br /&gt;Here is one point to note, Restrict IPs can work in both ways, either you Block some IPs or you Allow only some IPs i.e. as per the requirements. So you can use the same middleware class to restrict IPs either by blocking the given list of IPs or Allowing only the given list of IPs.&lt;br /&gt;&lt;br /&gt;Here I want to block the given list of IPs, I will check if the requesting IP matches in the given list of IPs, and the request will be blocked and will show the suitable message as a response.&lt;br /&gt;If the requesting IP is not in the given Block IPs list, it will simply be forwarded to the application.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here is the content of the handle method which is the main method of our middleware class:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;pre&gt;public function handle(Request $request, Closure $next)
{
    $this-&amp;gt;restrictedIp = explode(&#39;,&#39;, env(&#39;BLOCK_IPs&#39;));
    if (in_array($this-&amp;gt;getRequestingIp(), $this-&amp;gt;restrictedIp)) {
        return response()-&amp;gt;json([&#39;message&#39; =&amp;gt; &quot;You are not allowed to access this site.&quot;], 403);
    }
    return $next($request);
}
&lt;/pre&gt;

&lt;p&gt;Here I am getting list IPs to block from ENV variables, you can also put them in any config file or in the Middleware class property itself. I preferred ENV to avoid unnecessary deployment just to update the block IPs list.&lt;br /&gt;&lt;br /&gt;So our complete Middleware class will look like this:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;pre&gt;namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class RestrictIpAddressMiddleware
{
    private $restrictedIp = [];

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
        $this-&amp;gt;restrictedIp = explode(&#39;,&#39;, env(&#39;BLOCK_IPs&#39;));
        if (in_array($this-&amp;gt;getRequestingIp(), $this-&amp;gt;restrictedIp)) {
            return response()-&amp;gt;json([&#39;message&#39; =&amp;gt; &quot;You are not allowed to access this site.&quot;], 403);
        }
        return $next($request);
    }

    private function getRequestingIp(): string
    {
        $server = request()-&amp;gt;server-&amp;gt;all();
        if (isset($server[&#39;HTTP_X_FORWARDED_FOR&#39;])) {
            $ip_addresses = explode(&#39;,&#39;, $server[&#39;HTTP_X_FORWARDED_FOR&#39;]);
            return trim(end($ip_addresses));
        }
        return $server[&#39;REMOTE_ADDR&#39;];
    }
}
&lt;/pre&gt;


&lt;p&gt;&lt;br /&gt;In getRequestingIp() method, i consider $server[&#39;HTTP_X_FORWARDED_FOR&#39;] incase the incoming request to forwarded request from inmiddle server or proxy server. otherwise we can get requesting IP simply from $server[&#39;REMOTE_ADDR&#39;].&lt;br /&gt;&lt;br /&gt;Now you can test this by adding your local machine IP in comma separate Block IPs list stored in ENV variable.&lt;/p&gt;</description><link>https://sssurii.blogspot.com/2022/07/laravel-block-ips-using-middleware-class.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total><georss:featurename>Chandigarh, India</georss:featurename><georss:point>30.7333148 76.7794179</georss:point><georss:box>2.4230809638211532 41.6231679 59.043548636178841 111.9356679</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-3557061130830441881</guid><pubDate>Tue, 19 Apr 2022 06:05:00 +0000</pubDate><atom:updated>2022-04-19T11:35:25.147+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">life experience</category><title>4 Essential of relationships - Trust, Honesty, Loyalty, Forgiveness</title><description>&lt;p&gt;This is something I experienced and observed in my life till that time.&lt;/p&gt;&lt;p&gt;I strongly believe -&amp;nbsp;Trust, Honesty, Loyalty and Forgiveness are essential 4 elements that strengthen the relationship.&lt;br /&gt;&lt;br /&gt;How? let me explain.&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Trust&lt;/h3&gt;&lt;div&gt;Trust is a very essential element of any relationship we build. A relationship can&#39;t go long without trust.&amp;nbsp;&lt;/div&gt;&lt;p&gt;When you trust your partner or one you are in relation with, it makes you overlook or avoid the things that others used to say about them.&amp;nbsp; You never fall into distrust easily by listening to others.&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Honesty&lt;/h3&gt;&lt;p&gt;If you are honest with your partner or someone you are in a relationship with, you must always tell truth about whatever happens in the relationship. Even if something wrong happens un-intentionally and we speak upon truth honestly, most of the time front person forgives us for knowing the truth and our honesty about the relationship.&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Loyalty&lt;/h3&gt;&lt;p&gt;If you are loyal to your partner or someone you are in a relationship with, you must not do anything wrong intentionally that harm or hurt them. Being loyal you always do your best to make them happy and do what is best for them.&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Forgiveness&lt;/h3&gt;&lt;p&gt;They say Forgiveness is the biggest asset to set up peace. So in a relationship, you must forgive your partner&#39;s mistakes. Instead of getting angry, you must try to help your partner not to repeat those mistakes.&lt;br /&gt;Forgiving gives another chance for the relationship to survive or even strengthen.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>https://sssurii.blogspot.com/2022/04/4-essential-of-relationships-trust.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-2405321657824244259</guid><pubDate>Thu, 14 Apr 2022 11:21:00 +0000</pubDate><atom:updated>2022-08-02T09:48:01.425+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">life experience</category><title>Parents - They Learnt to adopt their-self better than us</title><description>&lt;p&gt;Our Parents in old age learn to adopt changes in life faster than us.&amp;nbsp;Still, we thought they are rigid and old thoughts people. &lt;br /&gt;&lt;br /&gt;In modern times we are more intelligent to understand the situation and time changes. But actually, we are not. It&#39;s a kind of myth.&amp;nbsp;Our old parents are more intelligent to understand the changes in life.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Most of the time I saw our parent silently accepts the change even if it doesn&#39;t suit them, because they have seen the world evolving, and new thing happenings more than we have seen in our life.&amp;nbsp; And they know either way they have to accept it (change) to keep going on with the world. On other hand, we found difficult to adopt a change most of the time and we keep ourselves to be the same as we are.&lt;/p&gt;</description><link>https://sssurii.blogspot.com/2022/04/they-learnt-to-adopt-their-self-better.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-2925702419753252000</guid><pubDate>Wed, 28 Jul 2021 03:40:00 +0000</pubDate><atom:updated>2021-07-28T09:17:29.774+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">heroku adon</category><category domain="http://www.blogger.com/atom/ns#">heroku papertrail</category><category domain="http://www.blogger.com/atom/ns#">papertrail</category><category domain="http://www.blogger.com/atom/ns#">system logs</category><category domain="http://www.blogger.com/atom/ns#">tool</category><title>What is Papertrail? Uses and Advantages</title><description>&lt;p&gt;Papertrail is basically a log management tool used for catching Heroku systems and build but not limited to. It has been useful because on Heroku we can check live logs and can&#39;t check logs for the previous requests except for logs for the deployment process. So below are some of the key features which paper trail providing us:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Recording the system logs live and we can also look into the logs of the past (from n no. of days up to a year) based on the plan we choose.&lt;/li&gt;&lt;li&gt;It allows searching past logs by date-time, string or regex.&lt;/li&gt;&lt;li&gt;It also allows us to configure alerts (emails, Slack) for a specific type of request failure response like time-out, system error or even request taking time more than a particular limit.&lt;/li&gt;&lt;li&gt;It allows us to set filters for logs to save or not to save.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Some advantages we seek from Papertrail are:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Heroku adon is available with one-click installation like other adon.&lt;/li&gt;&lt;li&gt;Fast and easy search interface.&lt;/li&gt;&lt;li&gt;Able to store long time period logs history (up to 1 year)&lt;/li&gt;&lt;li&gt;Custom alert configuration available&lt;/li&gt;&lt;li&gt;Can reduce log size by ignoring the regular assets (or not that important requests) like loading fonts, js, css files etc.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;I tried to cover it in simple points. One can visit&amp;nbsp;&lt;a href=&quot;https://www.papertrail.com/solution/heroku-logging/&quot; target=&quot;_blank&quot;&gt;Papertrail Heroku logging&lt;/a&gt;&amp;nbsp;for more information.&lt;/div&gt;&lt;p&gt;&lt;/p&gt;</description><link>https://sssurii.blogspot.com/2021/07/what-is-papertrail-uses-and-advantages.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-1259886735631453084</guid><pubDate>Sun, 27 Jun 2021 16:41:00 +0000</pubDate><atom:updated>2021-06-28T09:54:01.364+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">database</category><category domain="http://www.blogger.com/atom/ns#">heroku</category><category domain="http://www.blogger.com/atom/ns#">heroku postgres adon</category><category domain="http://www.blogger.com/atom/ns#">postgres</category><category domain="http://www.blogger.com/atom/ns#">postgresql</category><title>How to Upgrade or Downgrade Heroku Postgres adon plan</title><description>&lt;div&gt;If you are using Heroku and Postgres adon in your project, by the time you may want to upgrade or downgrade Heroku Postgres adon plan based upon your project&#39;s database size decrease or increase with time.&lt;br /&gt;Although you can follow Heroku documentation for the purpose:&lt;br /&gt;&lt;a href=&quot;https://www.blogger.com/#&quot;&gt;Changing the Plan or Infrastructure of a Heroku Postgres Database&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But I wish to introduce you to another way to upgrade or downgrade the Heroku PostgreSQL Database adon plan.&lt;br /&gt;&lt;br /&gt;In this process we have 3 steps to follow:&lt;br /&gt;1. Add additional Heroku Postgres adon with the desired plan (you want to switch) using the below command:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;color: #444444;&quot;&gt;heroku addons:create heroku-postgresql:adon-plan --app your-appname&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Slack-Lato, appleLogo, sans-serif&quot; style=&quot;background-color: white; color: #1d1c1d; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Where `adon-plan` can be replaced with the desired plan from the &lt;a href=&quot;https://www.blogger.com/#&quot;&gt;plan list&lt;/a&gt; and `your-appname` with your application name.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;2. Now copy your database from the old Postgres adon to the newly added Postgres adon.&lt;div&gt;&lt;span face=&quot;Slack-Lato, appleLogo, sans-serif&quot; style=&quot;background-color: white; color: #1d1c1d; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Slack-Lato, appleLogo, sans-serif&quot; style=&quot;background-color: white; color: #1d1c1d; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;color: #444444;&quot;&gt;heroku pg:copy HEROKU_POSTGRESQL_MAUVE_URL HEROKU_POSTGRESQL_PINK_URL -a your-appname&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Slack-Lato, appleLogo, sans-serif&quot; style=&quot;background-color: white; color: #1d1c1d; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Here `HEROKU_POSTGRESQL_MAUVE_URL` and `HEROKU_POSTGRESQL_PINK_URL` are system URL names of source and destination databases respectively.&lt;br /&gt;If you want to know where you should find these database URL names? you can open the resources tab in your app. Here when you click on `Attached as DATABASE` (or attachments) dropdown. Here you will see the system name of your database and add the suffix `URL` to it.&lt;span face=&quot;Slack-Lato, appleLogo, sans-serif&quot; style=&quot;color: #1d1c1d;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: white; clear: both; font-size: 15px; font-variant-ligatures: common-ligatures; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHkvNKYjfq0pNchxAcxbBAxN-kT301o9b8gU9-HEOKkzJOf1wgtHsTsHcmB9iW6bki_kVv2tlKOuwqyKz9CWiJC-rFrZ5rJSq9fVk_slviO0WCqA2XyDSnbppaVVu592u-Itp6enFL30rh/&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;295&quot; data-original-width=&quot;1219&quot; height=&quot;160&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHkvNKYjfq0pNchxAcxbBAxN-kT301o9b8gU9-HEOKkzJOf1wgtHsTsHcmB9iW6bki_kVv2tlKOuwqyKz9CWiJC-rFrZ5rJSq9fVk_slviO0WCqA2XyDSnbppaVVu592u-Itp6enFL30rh/w663-h160/image.png&quot; width=&quot;663&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;Here for first for the top database name is `DATABASE_URL` and for the bottom one, it is `HEROKU_POSTGRESQL_PINK_URL`.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;3. After your database is completely copied to the new Postgres adon, you can change the default database i.e. promote the new Postgres adon database as the default database using the command:&lt;div&gt;&lt;span face=&quot;Slack-Lato, appleLogo, sans-serif&quot; style=&quot;background-color: white; color: #1d1c1d; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;Slack-Lato, appleLogo, sans-serif&quot; style=&quot;background-color: white; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: #1d1c1d;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;color: #444444;&quot;&gt;heroku pg:promote HEROKU_POSTGRESQL_PINK_URL -a your-appname&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Now you are using your desired Heroku adon plan for your database project. You can now delete old Postgres adon to avoid additional billing charges.&lt;br /&gt;&lt;br /&gt;So using the above 3 steps you can upgrade or downgrade the Heroku Postgres adon pricing plan.&lt;/div&gt;</description><link>https://sssurii.blogspot.com/2021/06/how-to-upgrade-or-downgrade-heroku.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHkvNKYjfq0pNchxAcxbBAxN-kT301o9b8gU9-HEOKkzJOf1wgtHsTsHcmB9iW6bki_kVv2tlKOuwqyKz9CWiJC-rFrZ5rJSq9fVk_slviO0WCqA2XyDSnbppaVVu592u-Itp6enFL30rh/s72-w663-h160-c/image.png" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Chandigarh, India</georss:featurename><georss:point>30.7333148 76.7794179</georss:point><georss:box>2.4230809638211532 41.6231679 59.043548636178841 111.9356679</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-8417169391003978018</guid><pubDate>Tue, 13 Apr 2021 12:58:00 +0000</pubDate><atom:updated>2021-04-28T13:58:40.624+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">database</category><category domain="http://www.blogger.com/atom/ns#">json</category><category domain="http://www.blogger.com/atom/ns#">json vs jsonb</category><category domain="http://www.blogger.com/atom/ns#">jsonb</category><category domain="http://www.blogger.com/atom/ns#">postgresql</category><title>Differences between json and jsonb - JSON data type in PostgreSQL</title><description>&lt;p&gt;You may have read differences between PostgreSQL datatypes JSON and JSONB. If not, let see the difference between both theoretically and practically.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Although, both json and jsonb are types of PostgreSQL JSON&amp;nbsp;datatypes and accepts almost same format as input values i.e. json. But still there are some difference which one must know to efficiently use or can choose from both json and jsonb.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The main different is how they actually store data; the json data type stores input value as it is but&amp;nbsp; jsonb stores value in a decomposed binary format which lead to difference in&amp;nbsp;&lt;span face=&quot;&amp;quot;Open Sans&amp;quot;, sans-serif&quot; style=&quot;background-color: white; color: #0d0a0b; font-size: 14.4px;&quot;&gt;efficiency&lt;/span&gt;.&amp;nbsp;&lt;br /&gt;Jsonb is slower as compare to json while saving the input values because of converting json values to binary format before saving. &lt;br /&gt;Jsonb fast in processing the data because no re-parsing needed as compare to json datatype which needs processing function to re-parsing on every execution.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Few other differences between json and jsonb are:&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Jsonb supports indexing which is advantage over json data type.&lt;/li&gt;&lt;li&gt;As json stores the value as it is, it keeps un-neccessary white space between tokens while jsonb convert json data to binary format it doesn&#39;t preserve the white-space.&lt;/li&gt;&lt;li&gt;Json keeps the order of keys in json object, Jsonb doesn&#39;t keeps order same as we pass the value.&lt;/li&gt;&lt;li&gt;As json store value as it is, so it keep duplicate keys too if input value have same key multiple times, But jsonb keeps last key-value pair in-case input have repeating key (because of conversion).&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;So from above, you got the idea which is better to use json or jsonb? I believe your answer will be jsonb. Of course! it has few more advantages over jsonb.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;How you decide practically, which one should use from json or jsonb?&lt;/h3&gt;From practical point of view, I have observed one should you JSON data type when:&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;You have do mostly read column as it is, no where clause e.g. saving data in for event logs&lt;/li&gt;&lt;li&gt;You have 1 dimensional associative Array or object and have to apply operations while reading column data&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;One should you JSONB data type when:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;You have 2-dimensional associative array or object and have to apply operation while reading column data&lt;/li&gt;&lt;li&gt;You have array of associative arrays or objects and have to apply operation while reading column data&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;</description><link>https://sssurii.blogspot.com/2021/04/differences-between-json-and-jsonb-json.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-5391387886510460186</guid><pubDate>Sun, 23 Aug 2020 13:04:00 +0000</pubDate><atom:updated>2020-10-16T12:03:55.213+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">laravel</category><category domain="http://www.blogger.com/atom/ns#">laravel validation</category><category domain="http://www.blogger.com/atom/ns#">unique rule</category><category domain="http://www.blogger.com/atom/ns#">validation</category><category domain="http://www.blogger.com/atom/ns#">web security</category><title>Laravel Validation - Unique rule with multiple column and condition.</title><description>&lt;p&gt;Today I am going to share, How we can use Laravel validation rule `unique`.&lt;/p&gt;
&lt;p&gt;If you have worked with laravel and familiar with laravel validation, you must know what does &#39;unique&#39; rule checks.&lt;/p&gt;
&lt;p&gt;If not let me give here a brief about this. In simple words, It is similar to a unique key constraint applied to a column in the database table.&lt;/p&gt;
&lt;p&gt;
    &lt;i&gt;&#39;Unique&#39; rule check there is no similar value exists in the
        given database table column, to value matching with the provided input
        value.
    &lt;/i&gt;
&lt;/p&gt;
&lt;p&gt;The general format of the rule is:&lt;/p&gt;
&lt;p&gt;
    &lt;/p&gt;&lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;unique:table //when input name is similar to column name&lt;/pre&gt;
    OR
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;unique:table,column&lt;/pre&gt;
    OR
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;unique:Model,attribute&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
    Examples:&lt;br /&gt;
    &lt;/p&gt;&lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&#39;email&#39; =&amp;gt; &#39;unique:users&#39; //here users is table name&lt;/pre&gt;
    OR
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&#39;email&#39; =&amp;gt; &#39;unique:c,email_address&#39; //can give custom column name.&lt;/pre&gt;
    OR
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&#39;email&#39; =&amp;gt; &#39;unique:User,email&#39;&amp;nbsp; //here User is a model class&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is a very simple usage of the Unique validation rule.&lt;/p&gt;
&lt;h4&gt;Updating the record&lt;/h4&gt;
&lt;p&gt;One of the common situation or problem faced by developers while using the
    unique validation rule occurs while updating a record.&lt;br /&gt;Let&#39;s
    understand why it happens:&lt;/p&gt;
&lt;p&gt;
    As per rule statement it checks, there shouldn&#39;t exist any similar value
    to the inserting value in the column.&lt;br /&gt;But in-case of updating a
    record, consider the situation when you are updating the record without any
    change in the unique column value. In this case &#39;Unique&#39; check there is
    already a value similar to the inserting value in the column for same
    record (which should be fine) and raise a validation fail.&lt;br /&gt;In this case, we need to inform the rule to skip that particular record while
    checking for duplicate records.
&lt;/p&gt;
&lt;p&gt;
    How we can do that?&lt;br /&gt;By, passing the Id column(primary key) - value
    combination in reverse order.i.e. value,column.&lt;br /&gt;See below
    syntax:&lt;br /&gt;
    &lt;/p&gt;&lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;unique:table,column,except,idColumn&lt;/pre&gt;

&lt;p&gt;Examples:&lt;br /&gt;
    &lt;/p&gt;&lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&#39;email&#39; =&amp;gt; &#39;unique:users,email,&#39;.$input[&#39;id&#39;]. &#39;,id&#39; //provide dynamic value of Id column&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;
    In case creating a new record, the value id will be NULL.&lt;br /&gt;
    &lt;/p&gt;&lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&#39;email&#39; =&amp;gt; &#39;unique:users,email,NULL,id&#39;&lt;/pre&gt;
    which is similar to:&lt;br /&gt;
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&#39;email&#39; =&amp;gt; &#39;unique:users&#39;&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h4&gt;Unique on Multiple Column&lt;/h4&gt;
&lt;p&gt;Sometimes the situation comes:&lt;br /&gt;
    When you have to apply unique on multiple columns.&lt;br /&gt;
    When you want to ignore all soft-deleted records while validating for unique values
&lt;/p&gt;
&lt;p&gt;
    In this kind of situation you just need to append the column, value combination to the rule. Like: &lt;br /&gt;
    &lt;/p&gt;&lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&#39;email&#39; =&amp;gt; &#39;unique:users,email,&#39; .$input[&#39;id&#39;]. &#39;,id,deleted_at,NULL&#39;&lt;/pre&gt;
</description><link>https://sssurii.blogspot.com/2020/08/laravel-validation-unique-rule-with.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-3210369347768025444</guid><pubDate>Sun, 05 Jul 2020 17:25:00 +0000</pubDate><atom:updated>2020-07-05T22:55:31.864+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">apache</category><category domain="http://www.blogger.com/atom/ns#">certbot</category><category domain="http://www.blogger.com/atom/ns#">heroku</category><category domain="http://www.blogger.com/atom/ns#">https</category><category domain="http://www.blogger.com/atom/ns#">let&#39;s encrypt</category><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">ssl</category><category domain="http://www.blogger.com/atom/ns#">ssl certificate</category><title>Get Free SSL Certificate from Let’s Encrypt for your website - Linux, Apache, EC2, Heroku.</title><description>&lt;div&gt;To enable HTTPS on your website, you need a certificate from a Certificate Authority (CA). &lt;a href=&quot;https://letsencrypt.org/&quot; target=&quot;_blank&quot;&gt;Let’s Encrypt&lt;/a&gt; is a nonprofit Certificate Authority providing Free SSL certificates to 225 million websites.&amp;nbsp;&lt;br /&gt;You can also get a (absolutely) free SSL certificate using Certbot. &lt;a href=&quot;https://certbot.eff.org/&quot; target=&quot;_blank&quot;&gt;Certbot&lt;/a&gt; is open-source software tool recommended by Let&#39;s Encrypt to for automatically deploy SSL certificate.&lt;br /&gt;&lt;i&gt;This certificate is as valid as a paid certificate.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;There are two ways to get and install certificate on your server.&lt;br /&gt;1. When you have SSH access to your server. Then you have option to Generate and Deploy SSL certificate automatically by installing Certbot on your server.&lt;br /&gt;2. When you are using a platform like &lt;a href=&quot;https://www.heroku.com/&quot; rel=&quot;&quot; target=&quot;_blank&quot;&gt;Heroku&lt;/a&gt; (Paas) where you don&#39;t have SSH access to your server directly and can&#39;t install any package on it. In this case you can install Certbot at your local system (Linux) using below commands and use it only to generate certificate files. Later you can Deploy them manually.&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Install Certbot and Generate Certificate&lt;/h2&gt;&lt;div&gt;Install Certbot following below commands:&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;sudo apt-get update&lt;br /&gt;sudo add-apt-repository universe&lt;br /&gt;sudo apt-get update&lt;br /&gt;sudo apt-get install certbot python3-certbot-apache
sudo apt-get install software-properties-common&lt;/pre&gt;&lt;div&gt;when generating certificate on same server, it deploy automatically&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;sudo certbot --apache&lt;/pre&gt;&lt;div&gt;when want to generate certificate only, and to be deployed on other server.&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;sudo certbot certonly --manual [--apache --preferred-challenges dns]&lt;/pre&gt;&lt;div&gt;Following the prompts by Certbot provide your domain name (when asked) for which you want to generate SSL i.e. yourdomain.com. In case you want to generate wildcard SSL, you can provide : &lt;i&gt;*.yourdomain.com, yourdomain.com&lt;/i&gt;&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn_2ZmzqUOb80xUuqJ1vQDVuap2v2f0tD3kCEviTnKazEVhFcpHhw16RvQjW9RHX8H63m6AVG2A6YVDRb_OSo0baX7GyUEGJPYUW_7Ii2kYm2mBEHkIRXjnl3NMIZZYDky7IXB_bouxzAf/s741/certbot-ssl-certificate.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;terminal&quot; border=&quot;0&quot; data-original-height=&quot;285&quot; data-original-width=&quot;741&quot; height=&quot;228&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn_2ZmzqUOb80xUuqJ1vQDVuap2v2f0tD3kCEviTnKazEVhFcpHhw16RvQjW9RHX8H63m6AVG2A6YVDRb_OSo0baX7GyUEGJPYUW_7Ii2kYm2mBEHkIRXjnl3NMIZZYDky7IXB_bouxzAf/w593-h228/certbot-ssl-certificate.jpg&quot; title=&quot;Certbot prompts and imput example&quot; width=&quot;593&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/pre&gt;&lt;div&gt;Give your agreement by pressing Y when asked for Are you OK with your IP being logged?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now it will provide you a TXT DNS record to add on your DNS provider (PointDNS in case of Heroku) like as below:&lt;/div&gt;&lt;div&gt;Please deploy a DNS TXT record under the name &lt;i&gt;&lt;b&gt;_acme-challenge.yourdomain.com&lt;/b&gt;&lt;/i&gt; with the following value something like below:&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;I4RsG_YWzJQOAbuthWXu9GiQcvzu1ppcWNDScS3Ypl4&lt;/pre&gt;&lt;div&gt;(Add TTL as 1 or as minimum possible so that it reflect As soon as possible.)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now get back to the terminal and press enter to proceed. It may give multiple DNS TXT records to add, then simple repeat above process to add DNS.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;At end it will show you like :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrm0kAoIQoESlc-i0bl30XCpUUf89xoZnNmx0yDz3XIQjY2f4TLLyo0ZqiPxje82jP2rNLSePF33ZtSVH9LhZ0Zf4Mz-Q83kvps8xAhMU4mVNPHvPws84Y8u-T4ov-lCkrK11ifXauG3nk/s737/certbot-free-ssl-certificate.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;ssl certificate&quot; border=&quot;0&quot; data-original-height=&quot;342&quot; data-original-width=&quot;737&quot; height=&quot;274&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrm0kAoIQoESlc-i0bl30XCpUUf89xoZnNmx0yDz3XIQjY2f4TLLyo0ZqiPxje82jP2rNLSePF33ZtSVH9LhZ0Zf4Mz-Q83kvps8xAhMU4mVNPHvPws84Y8u-T4ov-lCkrK11ifXauG3nk/w590-h274/certbot-free-ssl-certificate.jpg&quot; title=&quot;SSL certificate files generated sucessfully&quot; width=&quot;590&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once certificate is generated successfully it will show you success message and the path where the certificates are kept as shown in above image.&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Deploy on Heroku&lt;/h2&gt;&lt;div&gt;Let&#39;s Deploy/Update SSL certificate to Heroku app using Apache server. First Login to heroku CLI:&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;heroku login&lt;/pre&gt;&lt;div&gt;Once login successfully, run command to Add/Update SSL certificate:&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;sudo heroku certs:add /etc/letsencrypt/live/yourdomain.com/fullchain.pem /etc/letsencrypt/live/yourdomain.com/privkey.pem --app=yourappname&lt;/pre&gt;&lt;div&gt;Incase you renew or update SSL certificate after expiring old one.&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;sudo heroku certs:update /etc/letsencrypt/live/yourdomain.com/fullchain.pem /etc/letsencrypt/live/yourdomain.com/privkey.pem --app=yourappname&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>https://sssurii.blogspot.com/2020/07/get-free-ssl-certificate-using-certbot-apache-linux-heroku.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn_2ZmzqUOb80xUuqJ1vQDVuap2v2f0tD3kCEviTnKazEVhFcpHhw16RvQjW9RHX8H63m6AVG2A6YVDRb_OSo0baX7GyUEGJPYUW_7Ii2kYm2mBEHkIRXjnl3NMIZZYDky7IXB_bouxzAf/s72-w593-h228-c/certbot-ssl-certificate.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-5676522480565837305</guid><pubDate>Sat, 27 Jun 2020 06:33:00 +0000</pubDate><atom:updated>2020-06-27T12:08:51.420+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">database</category><category domain="http://www.blogger.com/atom/ns#">database functions</category><category domain="http://www.blogger.com/atom/ns#">greatest</category><category domain="http://www.blogger.com/atom/ns#">least</category><category domain="http://www.blogger.com/atom/ns#">maximum</category><category domain="http://www.blogger.com/atom/ns#">postgresql</category><category domain="http://www.blogger.com/atom/ns#">rational database</category><title>LEAST() and GREATEST() - Postgres SQL Amazing But Rarely Known Functions .</title><description>PostgresSQL is very powerful and one of the world&#39;s most advanced open-source relational databases. It gives much more flexibility and customization on query level when you want to perform a complex operation or complex queries on the database. Postgresql provides multiple operators and functions which make even complex operations and complex queries pretty easy and simple. Similarly LEAST() and GREATEST() are functions that make your work very easy and simple.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;LEAST()&lt;/b&gt; and &lt;b&gt;GREATEST()&lt;/b&gt; functions are very useful when you want to operate on different columns within the same row (a record) in a table. LEAST() and GREATEST()&amp;nbsp;compare and find the minimum and maximum value respectively among given columns values in the same row. It&#39;s similar to finding a minimum or maximum value from an array of given values.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are a few simple examples you can try:&lt;br /&gt;&lt;font color=&quot;#555555&quot; face=&quot;courier&quot;&gt;&lt;font size=&quot;2&quot;&gt;select LEAST(5, 3, 9, 2, 8, 1) and GREATEST(5, 3, 9, 2, 8, 1);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=&quot;#555555&quot; size=&quot;2&quot;&gt;//should give 1 and 9 respectively&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In-case of String or Varchar, it gives you results by sorting values alphanumerically:&lt;/div&gt;&lt;div&gt;&lt;font color=&quot;#555555&quot; size=&quot;2&quot;&gt;select LEAST(ball, hockey, football, cricket) and GREATEST(ball, hockey, football, cricket);&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=&quot;#555555&quot; size=&quot;2&quot;&gt;//should give ball and hockey respectively.&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are few conditions MUST be satisfied when you are using LEAST() or GREATEST() functions in your query:&lt;/div&gt;&lt;div&gt;1. Columns on which you want to apply function MUST be of same data type OR values MUST of the same type i.e. numeric or string or decimal etc.&lt;/div&gt;&lt;div&gt;2. If there is any column which is having different types of data types among others, you can use casting to convert values to the common data type. like: CAST(column name as datatype)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Use:&lt;/h3&gt;&lt;div&gt;There are many use-cases of using LEAST() and GREATEST() in your query when you have to filter records comparing values within a row itself.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;br /&gt;Consider a case, when you have a car subscription system in which a car can have multiple prices offers base on the subscription term or period. But when you list your cars on the landing page and you have to show the minimum price only among all given offer prices for a car. Given all prices, variation is saved in the same row with other car details.&lt;/div&gt;&lt;div&gt;You can have a query to do that :&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #555555; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #555555; font-size: small;&quot;&gt;select car_name, LEAST(month_price, six_month_price, nine_month_price, one_year_price) from cars;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=&quot;#555555&quot; size=&quot;2&quot;&gt;//given all price having per month value.&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In another case, consider database table student_marks in which each subject represented by column i.e. maths, science, history, english, hindi, student_id (foriegn_key).&lt;/div&gt;&lt;div&gt;Now when you have to find student list with their least and maximum marks in any subject, you can write your query like:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=&quot;#555555&quot; size=&quot;2&quot;&gt;select student_id, LEAST(maths, science, history, english, hindi) as least_marks, GREATEST(maths, science, history, english, hindi) as maximum_marks from student_marks;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Similarly can find student having merit in all subject.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;font color=&quot;#555555&quot; size=&quot;2&quot;&gt;select student_id from student_marks where LEAST(maths, science, history, english, hindi) &amp;gt; 60;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I hope when you come across any similar situation like this, these functions LEAST() and GREATEST() will help you a lot to keep code clean and simple.&lt;br /&gt;&lt;br /&gt;Feel free to leave your comments as feedback or in case you have any queries.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>https://sssurii.blogspot.com/2020/06/least-and-greatest-postgres-sql-amazing.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-8747970511287624932</guid><pubDate>Fri, 03 Apr 2020 13:18:00 +0000</pubDate><atom:updated>2020-10-16T12:07:14.276+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">apache</category><category domain="http://www.blogger.com/atom/ns#">aws</category><category domain="http://www.blogger.com/atom/ns#">certbot</category><category domain="http://www.blogger.com/atom/ns#">ec2</category><category domain="http://www.blogger.com/atom/ns#">free</category><category domain="http://www.blogger.com/atom/ns#">heroku</category><category domain="http://www.blogger.com/atom/ns#">https</category><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">ssl certificate</category><category domain="http://www.blogger.com/atom/ns#">wildcard</category><title>How to Apply SSL Certificate (non-self) on EC2 with Linux/Ubuntu having Apache Server.</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Assuming you are well aware of What is an SSL certificate? Why we need it? here I am going to guide you for How you can apply an SSL certificate for your website hosted on Linux or Ubuntu Server using Apache 2 server.&lt;br /&gt;
You can either purchase a new SSL certificate or can generate it for free on&amp;nbsp;&lt;a href=&quot;https://www.sslforfree.com/&quot; target=&quot;_blank&quot;&gt;sslforfree.com&lt;/a&gt;&amp;nbsp;which authorized by&amp;nbsp;&lt;a href=&quot;http://letsencrypt.org/&quot; target=&quot;_blank&quot;&gt;Letsencrypt&lt;/a&gt;&amp;nbsp;the first non-profit CA.&lt;br /&gt;
&lt;br /&gt;
After Purchasing or getting your SSL certificate you have actually 2 SSL files, Certificate and Private Key.&lt;br /&gt;
You can upload both SSL files (certificate.crt and private.key) on the server:&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create a new folder in Directory `/home/user-name/.ssh`.&lt;/li&gt;
&lt;li&gt;Create or upload files certificate (.cert) file as certificate.crt and Private key (.key) as private.key in the folder created earlier.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Now edit Virtual Host configuration for the website for which you want to apply the SSL certificate.&lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;sudo nano /etc/apache2/sites-enabled/{yourwebsitedomain.com}.conf&lt;/pre&gt;
&lt;br /&gt;
&lt;div&gt;
Add the following code to website vhost config file:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&amp;lt;VirtualHost *:443&amp;gt;
    ServerName yourwebsitedomain.com
    ServerAlias yourwebsitedomain.com
    ServerAdmin admin@yourwebsitedomain.com
    DocumentRoot /var/www/html/yourwebsite/public/
    SSLEngine on
    SSLCertificateFile &quot;/home/user-name/.ssh/ssl/certificate.crt&quot; //path of SSL certificate file
    SSLCertificateKeyFile &quot;/home/user-name/.ssh/ssl/private.key&quot; //path of SSL private key file
&amp;lt;/VirtualHost&amp;gt;
&lt;/pre&gt;
&lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&lt;/pre&gt;
&lt;div&gt;
Enable SSL module on apache server:
    &lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;sudo a2enmod SSL
 &lt;/pre&gt;
Now restart apache server
 &lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;sudo service apache2 restart&lt;/pre&gt;
&lt;br /&gt;
All Done! Now browse your website over HTTPS. Feel free to comment below if you are facing any issue.&lt;/div&gt;
</description><link>https://sssurii.blogspot.com/2020/04/how-to-apply-ssl-certificate-non-self.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-4573749104660446940</guid><pubDate>Thu, 27 Feb 2020 18:06:00 +0000</pubDate><atom:updated>2020-04-03T18:17:36.895+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">block</category><category domain="http://www.blogger.com/atom/ns#">context menu</category><category domain="http://www.blogger.com/atom/ns#">inspect element</category><category domain="http://www.blogger.com/atom/ns#">javascirpt</category><category domain="http://www.blogger.com/atom/ns#">javascript snippet</category><category domain="http://www.blogger.com/atom/ns#">right click</category><category domain="http://www.blogger.com/atom/ns#">security</category><category domain="http://www.blogger.com/atom/ns#">web security</category><title>How to Block Inspect Element and Right Click on Your Website using Simple JavaScript</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
    Assuming you are well aware of What is an SSL certificate? Why we need it? here I am going to guide you for How you can apply an SSL certificate for your website hosted on Linux or Ubuntu Server using Apache 2 server.&lt;br /&gt;
    You can either purchase a new SSL certificate or can generate it for free on&amp;nbsp;&lt;a href=&quot;https://www.sslforfree.com/&quot; target=&quot;_blank&quot;&gt;sslforfree.com&lt;/a&gt;&amp;nbsp;which authorized by&amp;nbsp;&lt;a href=&quot;http://letsencrypt.org/&quot; target=&quot;_blank&quot;&gt;Letsencrypt&lt;/a&gt;&amp;nbsp;the first non-profit CA.&lt;br /&gt;
    &lt;br /&gt;
    After Purchasing or getting your SSL certificate you have actually 2 SSL files, Certificate and Private Key.&lt;br /&gt;
    You can upload both SSL files (certificate.crt and private.key) on the server:&lt;br /&gt;
    &lt;ul style=&quot;text-align: left;&quot;&gt;
        &lt;li&gt;Create a new folder in Directory `/home/user-name/.ssh`.&lt;/li&gt;
        &lt;li&gt;Create or upload files certificate (.cert) file as certificate.crt and Private key (.key) as private.key in the folder created earlier.&lt;/li&gt;
    &lt;/ul&gt;
    &lt;div&gt;
        Now edit Virtual Host configuration for the website for which you want to apply the SSL certificate.&lt;/div&gt;
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;sudo nano /etc/apache2/sites-enabled/{yourwebsitedomain.com}&lt;/pre&gt;
    &lt;div&gt;
        Add the following code to website vhost config file:&lt;/div&gt;
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;
		&lt;VirtualHost *:443&gt;
		ServerName laravel-tdd.tk
		ServerAlias www.laravel-tdd.tk
		ServerAdmin admin@laravel-tdd.tk
		DocumentRoot /var/www/html/laravel-tdd/public/
		SSLEngine on
		SSLCertificateFile &quot;/home/user-name/.ssh/ssl/certificate.crt&quot; //path of SSL certificate file
		SSLCertificateKeyFile &quot;/home/user-name/.ssh/ssl/private.key&quot; //path of SSL private key file
		&lt;/VirtualHost&gt;
	&lt;/pre&gt;
    &lt;div&gt;
        Enable SSL module on apache server:&amp;nbsp;&lt;/div&gt;
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;
		sudo a2enmod SSL
	&lt;/pre&gt;
    Now restart apache server
	&lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;
	sudo service apache2 restart&lt;/pre&gt;
&lt;/div&gt;</description><link>https://sssurii.blogspot.com/2020/02/how-to-block-inspect-element-and-right-click.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-40081561315771423</guid><pubDate>Fri, 29 Nov 2019 03:01:00 +0000</pubDate><atom:updated>2019-11-30T12:34:44.324+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">how to lead</category><category domain="http://www.blogger.com/atom/ns#">leadership</category><category domain="http://www.blogger.com/atom/ns#">successful leader.</category><title>How to Lead - All You Need to Know to be A Good Leader</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkAH-CejOYSwBWCjEYoY5e7MaRE-lciUdtHyaWFBpBGByWY6NAnV0fyjI8s_emDGNOtq0DRFIevITkCL9ai5XR-FqZnmSahpjXlVunCJa99lMNcWaCYZSvqDy5XGISRL8Z4IzEnwJE2E3x/s1600/leadership.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;355&quot; data-original-width=&quot;712&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkAH-CejOYSwBWCjEYoY5e7MaRE-lciUdtHyaWFBpBGByWY6NAnV0fyjI8s_emDGNOtq0DRFIevITkCL9ai5XR-FqZnmSahpjXlVunCJa99lMNcWaCYZSvqDy5XGISRL8Z4IzEnwJE2E3x/s1600/leadership.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;There is no specific field/domain (development, marketing, management, etc.) to become a leader and you don&#39;t need to wait for an opportunity for the same. Leadership can be observed in any field/domain in any small or big tasks. But there are few observations of a good leader.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b data-stringify-type=&quot;bold&quot; style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;Observations on Leadership&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b data-stringify-type=&quot;bold&quot; style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;1. No Single type of personality for leadership :&lt;/b&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;The is not any particular type of person who is only able to lead. Anyone can become a good leader no matter what kind of personality you have. You do not need to look like or copy anyone great leader, just be yourself.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b data-stringify-type=&quot;bold&quot; style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;2. Three Fundamental Attributes :&lt;/b&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;-&amp;nbsp;&lt;/span&gt;&lt;i data-stringify-type=&quot;italic&quot; style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;code class=&quot;c-mrkdwn__code&quot; data-stringify-type=&quot;code&quot; style=&quot;--saf-0: rgba(var(--sk_foreground_low,29,28,29),0.13); border-radius: 3px; border: 1px solid var(--saf-0); box-sizing: inherit; color: #e01e5a; font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace !important; font-size: 12px; font-variant-ligatures: none; line-height: 1.50001; overflow-wrap: break-word; padding: 2px 3px 1px; tab-size: 4; white-space: pre-wrap; word-break: normal;&quot;&gt;Great leader thinks and communicate clearly&lt;/code&gt;&lt;/i&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;: Simple and clear communication actually needs your thought process and time. Take some spare time, write down your thoughts then think about how to make them more simple and clear to communicate.&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;It always pays you back to communicate clearly.&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;-&amp;nbsp;&lt;/span&gt;&lt;i data-stringify-type=&quot;italic&quot; style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;code class=&quot;c-mrkdwn__code&quot; data-stringify-type=&quot;code&quot; style=&quot;--saf-0: rgba(var(--sk_foreground_low,29,28,29),0.13); border-radius: 3px; border: 1px solid var(--saf-0); box-sizing: inherit; color: #e01e5a; font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace !important; font-size: 12px; font-variant-ligatures: none; line-height: 1.50001; overflow-wrap: break-word; padding: 2px 3px 1px; tab-size: 4; white-space: pre-wrap; word-break: normal;&quot;&gt;Good Judgement about people&lt;/code&gt;&lt;/i&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;: Great leaders must have good judgment about people. When you choose/decide someone to hire/promote for any job/task, your decision impact on the result. If you choose the right person then it gives a good result, else bad and it also impacts people&#39;s interest in you.&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;Though no one perfect to always makes the right decisions one can improve judgment about people by:&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;- Meet as many people as possible, talk and know about them more about their:&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;- Jobs, responsibilities, what they have done, what they want to do? How they make decisions? It gives you a more clear idea about people to be hired.&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;- Learn from your previous decision what goes bad, what goes well.&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;Give it the time when deciding/recruiting/hiring people, it is not a waste of time as it payback you if you make the right decision.&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;wbr style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;/wbr&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;-&amp;nbsp;&lt;/span&gt;&lt;i data-stringify-type=&quot;italic&quot; style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;&lt;code class=&quot;c-mrkdwn__code&quot; data-stringify-type=&quot;code&quot; style=&quot;--saf-0: rgba(var(--sk_foreground_low,29,28,29),0.13); border-radius: 3px; border: 1px solid var(--saf-0); box-sizing: inherit; color: #e01e5a; font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace !important; font-size: 12px; font-variant-ligatures: none; line-height: 1.50001; overflow-wrap: break-word; padding: 2px 3px 1px; tab-size: 4; white-space: pre-wrap; word-break: normal;&quot;&gt;Strong Integrity and Commitment&lt;/code&gt;&lt;/i&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;nbsp;: Here Integrity means Doing the right decisions/things beyond your personal interest. Avoid the acts: favoritism, conflicts, un-appropriate wordings, un-appropriate work relationships, prioritizing own-self, etc. which make people lose trust in you.&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;Commitment means doing your work full of interest and dedication (giving your 100%) and people saw it get motivated to do their work with the same zeal.&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;To improve this make yourself transparent without any regret i.e. if your all communication, decisions, acts (even private) made public, there should be nothing to make you feel embarrassed.&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;Though we all make mistakes but try to accept them, learn from them and never repeat them (can damage your integrity and trust of people in you.)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b data-stringify-type=&quot;bold&quot; style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;3. Amount of Trust of People :&lt;/b&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;Trust is the most important factor of Leadership OR Leadership is all about building trust in yourself among people around you.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;To improve the Trust of people in you, you have to make more good decisions than bad. I.e. You can not make consistently wrong decisions (Must learn from mistakes, never repeat it).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;
You should have empathy with people, not having any selfishness. Sometimes you have to make hard decisions for the right (business) i.e. hiring or firing people, accepting mistakes, saying no to people or their ideas, etc. See every forward step or decision as an opportunity to optimize the trust level. Evaluate your decisions/choices like which path will build more trust among people.&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;c-mrkdwn__br&quot; data-stringify-type=&quot;paragraph-break&quot; style=&quot;box-sizing: inherit; color: #1d1c1d; display: block; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px; height: 8px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;So In-Short, To become a great leader all you have to do is :&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;- Be yourself&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;- Communicate Simple and Clear.&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;- Have good judgment about people&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;- Have Strong integrity and commitment&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;- Build Trust among people&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit; color: #1d1c1d; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; /&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;So Let’s introspect yourself and wake-up a Leader inside you&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;Reference video:&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;c-link&quot; href=&quot;https://slack-redir.net/link?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D7HDO1p3VdYg&quot; rel=&quot;noopener noreferrer&quot; style=&quot;box-sizing: inherit; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures; text-decoration-line: none;&quot; target=&quot;_blank&quot;&gt;https://www.youtube.com/watch?v=7HDO1p3VdYg&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
</description><link>https://sssurii.blogspot.com/2019/11/how-to-lead-all-you-need-to-know-to-be.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkAH-CejOYSwBWCjEYoY5e7MaRE-lciUdtHyaWFBpBGByWY6NAnV0fyjI8s_emDGNOtq0DRFIevITkCL9ai5XR-FqZnmSahpjXlVunCJa99lMNcWaCYZSvqDy5XGISRL8Z4IzEnwJE2E3x/s72-c/leadership.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-1728932981262358939</guid><pubDate>Tue, 08 Oct 2019 05:51:00 +0000</pubDate><atom:updated>2019-10-08T11:21:02.878+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">cookie</category><category domain="http://www.blogger.com/atom/ns#">cookie consent</category><category domain="http://www.blogger.com/atom/ns#">cookie in laravel</category><category domain="http://www.blogger.com/atom/ns#">cookie policy</category><category domain="http://www.blogger.com/atom/ns#">cookie popup</category><category domain="http://www.blogger.com/atom/ns#">gdpr</category><category domain="http://www.blogger.com/atom/ns#">laravel</category><title>How to Show Cookie Policy Consent or GDPR Popup in Laravel using Cookie.</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Cookie in Laravel&lt;/h3&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
You can use the cookie in Laravel using the Helper method `&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;cookie()&lt;/b&gt;&lt;/span&gt;` or method available with Request/Response Object or `Cookie` facade.&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;$request-&amp;gt;cookie(&#39;name&#39;);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
OR&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;use Illuminate\Support\Facades\Cookie;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;Cookie::get(&#39;name&#39;);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
To get more clarity on how to use the cookie in Laravel with an example to show cookie consent popup on your Laravel website and hide/remove it once you accept the policy.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/h3&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Cookie Policy Consent Popup in Laravel&lt;/h3&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;div&gt;
First, create and a Cookie Consent&amp;nbsp;popup as notification to the footer section of your Laravel main blade template file.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&amp;lt;div class=&quot;cookies-block&quot;&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;h5&amp;gt;This website uses cookies&amp;lt;/h5&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;p&amp;gt;We use cookies to improve your experience and deliver personalised content. By using this website, you agree to our &amp;lt;a href=&quot;javascript:void()&quot;&amp;gt;Cookie Policy&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;button class=&quot;okay-btn&quot;&amp;gt;ACCEPT&amp;lt;/button&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&amp;lt;/div&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
First, Now, Javascript snippet to capture click on the `ACCEPT` button, send ajax request to the server to create a cookie.&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;$(document).on(&#39;click&#39;,&#39;#footer .cookies-block button&#39;, function(e) {&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; e.preventDefault();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; $.ajax({&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; method: &#39;GET&#39;,&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url: &#39;/cookie&#39;,&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data : {&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;name&#39; : &#39;accept-cookie&#39;,&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;value&#39; : true&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; success: function (response) {&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&#39;#footer&#39;).find(&#39;.cookies-block&#39;).hide();&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; error: function (error) {&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert(&#39;Error: Please refresh the page&#39;);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; });&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;});&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;div&gt;
Now you have to create a POST route with the public permission that maps to a method in the controller which returns the response with the cookie.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;//in route/web.php&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;Route::post(&#39;/cookie&#39;, &#39;PagesController@setCookie&#39;);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #999999;&quot;&gt;//in app/Http/Controllers/PagesController.php&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;public function setCookie(Request $request)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; return response(&#39;success&#39;)-&amp;gt;cookie(&#39;accept-cookie&#39;, true, config(&#39;constants.COOKIE_ACCEPT_LIFETIME&#39;));&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400;&quot;&gt;
&lt;br /&gt;
Once Ajax request got success response, it creates a cookie, like as above with name `accept-cookie`.&lt;br /&gt;
you can check it in your browser&#39;s debug panel (press F12).&lt;br /&gt;
As now cookie stored in your browser now you make a check for the user who has already accepted the policy i.e. accept-cookie is stored or not. hence the consent&amp;nbsp;popup can be wrap in check:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;//in the main layout template&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;@if (!request()-&amp;gt;cookie(&#39;accept-cookie&#39;))&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//check if cookie not stored&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;lt;div class=&quot;cookeies-block&quot;&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;h5&amp;gt;This website uses cookies&amp;lt;/h5&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;p&amp;gt;We use cookies to improve your experience and deliver personalised content. By using this website, you agree to our &amp;lt;a href=&quot;javascript:void()&quot;&amp;gt;Cookie Policy&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;button class=&quot;okay-btn&quot;&amp;gt;OK&amp;lt;/button&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/div&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;@endif&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Hope you got an idea. If still having any query or feedback for improvement, feel free to ask.&lt;/div&gt;
&lt;/h3&gt;
&lt;/div&gt;
</description><link>https://sssurii.blogspot.com/2019/10/show-cookie-consent-or-gdpr-in-laravel.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-8628331540841226523</guid><pubDate>Sun, 06 Oct 2019 06:21:00 +0000</pubDate><atom:updated>2019-10-07T12:18:14.644+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">apache</category><category domain="http://www.blogger.com/atom/ns#">http</category><category domain="http://www.blogger.com/atom/ns#">http to https</category><category domain="http://www.blogger.com/atom/ns#">https</category><category domain="http://www.blogger.com/atom/ns#">redirect</category><category domain="http://www.blogger.com/atom/ns#">rewrite rules</category><category domain="http://www.blogger.com/atom/ns#">server</category><title>How to Write Redirect Rules for HTTP to HTTPS in Apache using .htacess</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;HTTP vs HTTPS&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;HTTP (HyperText Transfer Protocol) is the most basic and known protocol (a standard set of rules)&amp;nbsp;used to transfer data from a web server to a browser.&amp;nbsp;It allows communication between different systems.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;HTTPS is&amp;nbsp;HTTP with encryption i.e it uses encryption (TLS/SSL) to make HTTP requests more secure while transferring the data from a web server to a browser or vice-versa.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;So there are benefits of using HTTPS for your website:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;1. It makes your website more secure against data theft.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;2. It also improves your SEO rank.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;So now let&#39;s learn how we can direct a website from HTTP to HTTPS.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;First, make sure you have generated and integrated SSL certificate for your website and the Rewrite module is enabled on your hosting server. so that your website can work on HTTPS without any trouble.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white;&quot;&gt;After applying the SSL certificate our website can be accessed via HTTP or HTTPS. But per above after knowing the benefits of HTTPS we need redirect HTTP to HTTPS.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Re-write Rules&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Here is I assume that you are a bit aware of setting basic apache settings via .htaccess file, like - rewrite rules, updating memory size, etc.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Here we will only talk about re-write rules for apache. Basically, re-write rules have 2 parts -&amp;nbsp;&lt;span style=&quot;color: #1d1c1d; font-size: 15px;&quot;&gt;RewriteCond i.e.&amp;nbsp;&lt;/span&gt;condition for action to be in-effect and&amp;nbsp;&lt;span style=&quot;color: #1d1c1d; font-size: 15px;&quot;&gt;RewriteRule&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-size: 15px;&quot;&gt;&amp;nbsp;i.e.&amp;nbsp;&lt;/span&gt;the action itself.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;The condition can be simple (only one&amp;nbsp;&lt;span style=&quot;color: #1d1c1d; font-size: 15px;&quot;&gt;RewriteCond&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;) or can be complex (having multiple&amp;nbsp;&lt;span style=&quot;color: #1d1c1d; font-size: 15px;&quot;&gt;RewriteCond&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-size: 15px;&quot;&gt;&amp;nbsp;&lt;/span&gt;) combined with logical operator `AND`(default and option to write) and `OR`.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Redirect HTTP to HTTPS for Domain&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;To redirect from HTTP to HTTPS we simply need to have 2 conditions and 1 Rule as below:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 15px;&quot;&gt;&lt;b&gt;RewriteCond %{HTTPS} off&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white; color: #444444;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;RewriteCond %{HTTP_HOST} ^&lt;/span&gt;yourdomain.com&lt;span style=&quot;font-size: 15px;&quot;&gt;$&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 15px;&quot;&gt;&lt;b&gt;RewriteRule ^(.*)$ https://yourdomain.com/$1 [QSA,L,R=301]&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;First condition checks if HTTPS is off i.e. if the incoming request is over HTTP only.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Second condition checks if the request for your HOST domain.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
If both the conditions result in TRUE the rule will be in action and it redirects all the requests over HTTPS.&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;


&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Redirect HTTP to HTTPS for Domain with Sub-Domains&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;To redirect from HTTP to HTTPS for a domain with Sub-Domain you have added 1 additional Condition and little update in Rule which we have done in case of simple domain. i.e.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;RewriteCond %{HTTP_HOST} ^((.+)\.)?&lt;/b&gt;&lt;b style=&quot;font-family: &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 15px;&quot;&gt;yourdomain&lt;/b&gt;&lt;b&gt;.com$&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;The above condition checks if the incoming request is for any sub-domain of your domain of any character(using regex ``).&lt;br /&gt;Now update your Rewrite Rule to include subdomain part by adding `%1`(which will take regex matching part i.e. subdomain) while redirecting to HTTPS as:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;RewriteRule ^(.*) https://%1.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 15px;&quot;&gt;yourdomain&lt;/b&gt;&lt;/span&gt;.com/$1 [QSA,L,R=301]&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;So complete Rewrite Rule block will look like:&lt;br /&gt;&amp;nbsp;&lt;span style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 15px;&quot;&gt;&lt;b&gt;RewriteCond %{HTTPS} off&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white; color: #444444;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;RewriteCond %{HTTP_HOST} ^&lt;/span&gt;yourdomain.com&lt;span style=&quot;font-size: 15px;&quot;&gt;$&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b&gt;RewriteCond %{HTTP_HOST} ^((.+)\.)?&lt;/b&gt;&lt;b style=&quot;font-size: 15px;&quot;&gt;yourdomain&lt;/b&gt;&lt;b&gt;.com&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;color: #444444; font-family: &amp;quot;courier new&amp;quot;, courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;$&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: white; color: #444444; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;RewriteRule ^(.*) https://%1.&lt;/b&gt;&lt;b style=&quot;background-color: white; color: #444444; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 15px;&quot;&gt;yourdomain&lt;/b&gt;&lt;/span&gt;.com/$1 [QSA,L,R=301]&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: white; color: #444444; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b style=&quot;background-color: white; color: #444444; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;times new roman&amp;quot;; font-weight: 400;&quot;&gt;Here one thing to note here, in .htacess we can access any server global variable like - HTTP_HOST, REQUEST_URI, HTTP, etc.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
</description><link>https://sssurii.blogspot.com/2019/10/redirect-http-to-https-apache.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total><georss:featurename>Chandigarh, India</georss:featurename><georss:point>30.7333148 76.7794179</georss:point><georss:box>30.5149413 76.4566944 30.951688299999997 77.1021414</georss:box></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-6610120959871488714</guid><pubDate>Tue, 17 Sep 2019 17:29:00 +0000</pubDate><atom:updated>2020-09-21T11:49:55.691+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">events</category><category domain="http://www.blogger.com/atom/ns#">jobs</category><category domain="http://www.blogger.com/atom/ns#">laravel</category><title>Ways to Pass Parameters to Laravel job.</title><description>&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
    There are 2 ways to pass parameters to a dispatching job in Laravel.
    &lt;br /&gt;First is simply call
    &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;dispatch()&lt;/span&gt;
    or
    &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;dispatchNow()&lt;/span&gt;
    as per requirement on your Job class like calling a static method on a
    class:&lt;br /&gt;
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;YourJob::dispatch(argument1, argument2, argument3);&lt;/span&gt;&lt;/pre&gt;
  	Second is simply pass arguments while creating an instance/object of Job class then pass the object
    to dispatch method(always available in the controller) like:&lt;br /&gt;
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$this-&amp;gt;dispatchNow(new YourJob(argument1, argument2, argument3));&lt;/span&gt;&lt;/pre&gt;
  &lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
  &lt;ins class=&quot;adsbygoogle&quot;
       style=&quot;display:block; text-align:center;&quot;
       data-ad-layout=&quot;in-article&quot;
       data-ad-format=&quot;fluid&quot;
       data-ad-client=&quot;ca-pub-8847749654915891&quot;
       data-ad-slot=&quot;2610755587&quot;&gt;&lt;/ins&gt;
  &lt;script&gt;
       (adsbygoogle = window.adsbygoogle || []).push({});
  &lt;/script&gt;
    The arguments will be available in the constructor, can you assign them to
    class local variable properties and use anywhere in Job class.&lt;br /&gt;&lt;br /&gt;Let
    consider below example job:&lt;br /&gt;
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;lt;?php
    namespace App\Jobs;

    use Illuminate\Bus\Queueable;
    use Illuminate\Queue\SerializesModels;
    use Illuminate\Queue\InteractsWithQueue;
    use Illuminate\Contracts\Queue\ShouldQueue;
    use Illuminate\Foundation\Bus\Dispatchable;

    class Testjob implements ShouldQueue
    {
        use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

        private $a;
        private $b;
        private $c;

        /**
         * Create a new job instance.
         *
         * @return void
         */
        public function __construct(string $a, int $b, int $c)
        {
            $this-&amp;gt;a = $a;
            $this-&amp;gt;b = $b;
            $this-&amp;gt;c = $c;
        }

        /**
         * Execute the job.
         *
         * @return array
         */
        public function handle()
        {
            return [$this-&amp;gt;a,
                    $this-&amp;gt;b,
                    $this-&amp;gt;c
                    ];
        }
    }&lt;/span&gt;
  	&lt;/pre&gt;
    &lt;span style=&quot;font-family: inherit;&quot;&gt;Then parameters can be passed to this job as below:&lt;/span&gt;
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Testjob::dispatch(&#39;hello&#39;, 5, 2);&lt;/span&gt;&lt;/pre&gt;
  	&lt;span style=&quot;font-family: inherit;&quot;&gt;OR&lt;/span&gt;
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$this-&amp;gt;dispatchNow(new Testjob(&#39;hello&#39;, 5, 2));&lt;/span&gt;&lt;/pre&gt;
	&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;This will give output like :&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
    &lt;pre class=&quot;c-mrkdwn__pre&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;array:3 [
        0 =&amp;gt; &quot;hello&quot;
        1 =&amp;gt; 5
        2 =&amp;gt; 7
    ]&lt;/span&gt;
    &lt;/pre&gt;
	&lt;span style=&quot;font-family: inherit;&quot;&gt;Feel free to leave a comment in case any query related to this.&lt;/span&gt;
&lt;/div&gt;</description><link>https://sssurii.blogspot.com/2019/09/ways-to-pass-parameters-to-laravel-job.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-877888251631454942.post-6719097231509921205</guid><pubDate>Sat, 14 Sep 2019 12:57:00 +0000</pubDate><atom:updated>2019-09-16T10:59:05.749+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">database</category><category domain="http://www.blogger.com/atom/ns#">index</category><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">postgres</category><category domain="http://www.blogger.com/atom/ns#">query explain</category><category domain="http://www.blogger.com/atom/ns#">query optimization</category><category domain="http://www.blogger.com/atom/ns#">sql</category><title>Important things every developer need to know about Database Indexing</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Assuming you know the basics of Database and know the definition of indexes used in DB, here are some important things about Database indexes about which every good developer must aware of:&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;DB Indexing is used to read data faster, but it makes writing slower.&lt;/li&gt;
&lt;li&gt;Indexes use in-memory data structures.&lt;/li&gt;
&lt;li&gt;Indexes use B-Tree (Balanced Tree) data structure to store data and use Binary search for reading/searching.&lt;/li&gt;
&lt;li&gt;It always saves corresponding DB internal row-id (not table PK) with every indexed node in the B-tree&lt;/li&gt;
&lt;li&gt;It is not good to add an index to each column of a table.&lt;/li&gt;
&lt;li&gt;If you have applied index on certain column but in query use any function on an indexed column, the index will not help at all.&lt;/li&gt;
&lt;li&gt;You can create a combined index on multiple columns. Order matters as per query need.&lt;/li&gt;
&lt;li&gt;To understand the use of indexes or to know if the query is actually taking the benefit of your index on your column use Explain.&lt;/li&gt;
&lt;li&gt;Explain give you the execution plan of the query. &lt;/li&gt;
&lt;li&gt;Explain give you info about what type of scan it uses while using indexes. It can be&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp; &amp;nbsp;&lt;b&gt;Conts/EQ_Ref (Fastest)&lt;/b&gt; - use Binary search(on B-Tree) given the where is used on a unique column.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.g. &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;where id = 127&lt;/span&gt; (given id is a primary key or unique).&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;
&amp;nbsp; &amp;nbsp;&lt;b&gt;Ref / Range&lt;/b&gt; - use B-tree doubly-linked leaf scan after finding the start limit record till the end limit record in the index.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.g. &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;where created_at between &#39;2018-09-01 00:00:00&#39; and &#39;2019-09-01 00:00:00&#39;.&amp;nbsp;&lt;/span&gt; (given index applied on created_at)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;
&amp;nbsp; &amp;nbsp;&lt;b&gt;Index &lt;/b&gt;- scan all index records&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.g. &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;where created_at between &#39;2018-09-01 00:00:00&#39; and &#39;2019-09-01 00:00:00&#39; and user_id = 127;&lt;/span&gt; (given combine index applied on created_at and user_id - here order columns index matters)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;
&amp;nbsp; &lt;b&gt;&amp;nbsp;ALL&lt;/b&gt; - scan every column in every row. worst case. It happens when the given index is not useful for the query.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.g. &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;where user_id = 127;&lt;/span&gt; (given index is on created_at).&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
So indexing should be always used as per the query need.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Indexing on a specific column does not always make the query faster having that specific column in where clause.&lt;/li&gt;
&lt;li&gt;The column in select clause also impacts the performance if it differs from the indexes column it is using in where clause. That is because each time it read a record from the index it read corresponding select column value from memory disk which results more no.of io reads to disks hence execution time.&lt;/li&gt;
&lt;li&gt;Indexing is always applied as per developer need.&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;background-color: #f8f8f8; color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;Reference video from&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; font-variant-ligatures: common-ligatures;&quot;&gt;Laracon EU. URL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f8f8f8; color: #1d1c1d; font-family: , &amp;quot;applelogo&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;:&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;c-link&quot; href=&quot;https://youtu.be/HubezKbFL7E&quot; rel=&quot;noopener noreferrer&quot; style=&quot;background-color: #f8f8f8; box-sizing: inherit; font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;&quot; target=&quot;_blank&quot;&gt;https://youtu.be/HubezKbFL7E&lt;/a&gt;&lt;/div&gt;
</description><link>https://sssurii.blogspot.com/2019/09/some-important-things-about-databse-indexing.html</link><author>noreply@blogger.com (Surinder Singh INSAN)</author><thr:total>0</thr:total></item></channel></rss>