One of the golden rule of programming is :
Welcome to my Technology Hotspot
Featured
TechBytes on Linux
This is a growing list of Linux commands which might come handy for the of Linux users. 1. Found out i had to set the date like this: ...
Thursday, January 4, 2024
Sunday, September 10, 2023
Sony WH-1000XM4 Headphones ಸೋನಿ WH-1000XM4: ಸೌಂಡ್ ಮೇಷ್ಟ್ರುಗಳ ಆತ್ಮಶಾಂತಿ
Sunday, July 30, 2023
how to setup password for an AWS EC2 running instance
The AWS EC2 Linux instance uses a .pem private key file to authenticate the default ubuntu user account.
Let us learn about how to set up a password on your running EC2 instance,
Prerequisites
- You have ec2 instance running
- You have root access to ec2 instance
Step 1
Connect to your Linux ec2 instance via putty (/ssh).
Step 2
Login to your running instance
Step 3
Execute below command:
sudo passwd ec2-user
And write the password
Step 4
Now it’s time to go to the directory
/etc/ssh
and follow below command
sudo vim sshd_config
Step 5
After you apply the command,
Press “i” and
Now go to the “passwordauthentication” and write “yes”
After change, it please save it
Perfect
Step 6
Last command is
sudo service sshd restart
Friday, April 28, 2023
How to debug Python code in VS Code with arguments passed from command line
Debugging Python code in VS Code with arguments passed from the command line is a straightforward process. Here are the steps you can follow:
1. Open the Python file that you want to debug in VS Code.
2. Set breakpoints in the code where you want to pause and inspect variables.
3. Open the Debug panel in VS Code by clicking on the Debug icon in the Activity Bar or by pressing `Ctrl+Shift+D` on Windows or `Cmd+Shift+D` on Mac.
4. Click on the "create a launch.json file" button and select "Python" as the environment.
5. In the launch.json file that opens, modify the "args" attribute to include the command-line arguments you want to pass to the Python script. For example:
```
"args": ["arg1", "arg2"]
```
Replace "arg1" and "arg2" with the actual arguments you want to pass.
NOTE: Add the below property in the launch.json file.
"purpose": ["debug-in-terminal"]
6. Save the launch.json file.
7. Start the debugging process by clicking on the "Start Debugging" button in the Debug panel or by pressing `F5`.
8. The code execution will pause at the first breakpoint. Use the Debug Console to inspect variables, and use the Debug toolbar to step through the code and continue the execution.
That's it! You can now debug your Python code with arguments passed from the command line in VS Code.
Thursday, March 30, 2023
Regular Expressions
Regular Expressions
List of meta characters:
. ---> Any one character
? ---> Zero or one
+ ---> One or more
* ---> zero or more
^ ---> at the beginning of the string
$ ---> at the end of the string
[abc] ---> any one of a b c
{m} ---> 'm' times
{m,n} ---> at least m times, at most n times
| ---> or
\ ---> escape sequence character
\s ---> a space
\d ---> a digit
\w ---> a word
\b ---> a word boundary
\d ---> a single digit number (0 to 9)
\d\d ---> a two digit number (0 to 99)
\d\d\d ---> a three digit number (000 to 999)
NOTE: ?, +, *, {} are used as Quantifiers (to represent quantity)
\d{3,5} ---> either 3 digit or 5 digit number
hell?o ---> helo | hello
hell+o ---> hello | helllo | helllllo | ...
hrll*o ---> helo | hello | helllo | helllllo | ...
he(ll)+o ---> hello | hellllo | hellllllo | ...
S = "hi hello how are hello"
hello ---> Yes
^hello ---> No
hello$ ---> Yes
\d+ ---> a number
[0123456789]+ ---> a number
[0-9]+ ---> a number
\d{3} ---> a 4 digit ODD number
\d+\s\w+ ---> a number then a space then a word
\d+\s[a-z]+ ---> a number then a space then lowercase word
\d+\s[A-K764]{5,10} ---> a number then a space then min 5 max 10 char uppercase word between A - K 764
\d{3}:\d{2}:\d{4} --->
(ABC)?\d{3}:\d{4}[XYZ]? --->
Sunday, March 26, 2023
Go error: go : go.mod file not found in current directory or any parent directory; (working on GOPATH/src)
As of Go 1.16, the GO111MODULE environment variable is treated as "on" by default, meaning Go expects to find a go.mod file, and no longer falls back to pre-module GOPATH behavior.
If you want to go back to the pre-1.16 behavior, you now have to explicitly specify GO111MODULE=auto, but you're far better off creating a go.mod file.
See https://golang.org/doc/go1.16#go-command and https://golang.org/ref/mod
Source - https://stackoverflow.com/questions/67929883/go-error-go-go-mod-file-not-found-in-current-directory-or-any-parent-director
Friday, March 10, 2023
𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐐𝐮𝐞𝐬𝐭𝐢𝐨𝐧𝐬 | Amazon 2022
Amidst the massive layoffs in Tech industry in these tough times, there are many of us preparing right now for interviews.
LeetCode is a good source to look at the current level of questions.
Below is the list of questions currently being asked by Amazon in the last 3 to 4 months.
-- 𝐆𝐫𝐚𝐩𝐡𝐬
1) Process Ordering - https://lnkd.in/dN4ErKyE
2) Number of Islands - https://lnkd.in/dHQJGhPJ
3) k Jumps on Grid - https://lnkd.in/dKM_ETsM)
-- 𝐓𝐫𝐢𝐞
1) Finding Prefix in Dictionary - https://lnkd.in/dpRvFDq5
-- 𝐓𝐫𝐞𝐞
1) Binary Tree Top Down View - https://lnkd.in/dmun-Pn3
2) Traversing binary tree in an outward manner.
3) Diameter of a binary tree [Path is needed] - https://lnkd.in/dH-w_DQV
-- 𝐒𝐥𝐢𝐝𝐢𝐧𝐠 𝐰𝐢𝐧𝐝𝐨𝐰
1) Contains Duplicates III - https://lnkd.in/djcWHTaX
2) Minimum Window Substring [Variation of this question] - https://lnkd.in/dPfnQZmr
-- 𝐋𝐢𝐧𝐤𝐞𝐝 𝐋𝐢𝐬𝐭
1) Reverse a Linked List II - https://lnkd.in/diHAJZUJ
2) Remove Loop From Linked List - https://lnkd.in/d-zVawwX
3) Reverse a Linked List in k-groups - https://lnkd.in/de99T3hQ
-- 𝐁𝐢𝐧𝐚𝐫𝐲 𝐒𝐞𝐚𝐫𝐜𝐡
1) Search In rotate sorted Array - https://lnkd.in/djxEpFxF
-- 𝐀𝐫𝐫𝐚𝐲𝐬
1) Max bandWidth [Priority Queue, Sorting] - https://lnkd.in/d6JE2xpz
2) Next permutation - https://lnkd.in/dk9cHQbw
3) Largest Rectangle in Histogram - https://lnkd.in/dQHQcF-5
Credits - Sandeep Kumar
Follow Aman Barnwal for more. ❤️️
Join my Telegram group for 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐏𝐫𝐞𝐩𝐚𝐫𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐨𝐮𝐫𝐜𝐞𝐬 👉https://lnkd.in/gDBqRNBw
Wednesday, March 8, 2023
How to access WSL2 Linux files from Windows file explorer?
File Management
- Open File Explorer
- Type \\wsl$ on address bar
- Press Enter
Sunday, March 5, 2023
𝐒𝐲𝐬𝐭𝐞𝐦 𝐃𝐞𝐬𝐢𝐠𝐧 𝐆𝐨𝐥𝐝𝐦𝐢𝐧𝐞 ❤️️
System Design rounds are an important part of the Software Engineering interview process because they test a candidate's ability to design and implement large-scale systems.
Here is the list of some amazing resource on System Design -
✅ Things you must know in System Design
👉System design basics: https://bit.ly/3SuUR0Y
👉Horizontal and vertical scaling: https://bit.ly/3slq5xh
👉 Load balancing and Message queues: https://bit.ly/3sp0FP4
👉High-level design and low-level design, Consistent Hashing, Monolithic and Microservices architecture: https://bit.ly/3DnEfEm
👉 Caching, Indexing, Proxies: https://bit.ly/3SvyVDc
👉 Networking, How Browsers work, Content Network Delivery ( CDN): https://bit.ly/3TOHQRb
👉 Database Sharding, CAP Theorem, Database schema Design: https://bit.ly/3CZtfLN
👉 Concurrency, API, Components + OOP + Abstraction : https://bit.ly/3sqQrhj
👉 Estimation and Planning, Performance: https://bit.ly/3z9dSPN
👉 Map Reduce, Patterns, and Microservices: https://bit.ly/3zcsfmv
👉 SQL vs NoSQL and Cloud: https://bit.ly/3z8Aa49
👉 Most Popular System Design Questions: https://bit.ly/3Dp40Ux
✅ System Design Case Studies
👉 Design Netflix: https://bit.ly/3GrAUG1
👉 Design Reddit: https://bit.ly/3OgGJrL
👉 Design Messenger App : https://bit.ly/3DoAAXi
👉 Design Instagram: https://bit.ly/3BFeHlh
👉 Design Dropbox: https://bit.ly/3SnhncU
👉 Design Youtube: https://bit.ly/3dFyvvy
👉 Design Tinder: https://bit.ly/3Mcyj3X
👉 Design Yelp: https://bit.ly/3E7IgO5
👉 Design Whatsapp: https://bit.ly/3M2GOhP
👉 Design URL shortener : https://bit.ly/3xP078x
👉 Design Amazon Prime Video: https://bit.ly/3hVpWP4
👉 Design Twitter: https://bit.ly/3qIG9Ih
👉 Design Uber: https://bit.ly/3fyvnlT
👉 Design TikTok : https://bit.ly/3UUlKxP
👉 Design Facebook's Newsfeed: https://bit.ly/3RldaW7
👉 Design Web Crawler: https://bit.ly/3DPZTBB
👉 Design API Rate Limiter: https://bit.ly/3BIVuh7
✅ All solved case studies: https://bit.ly/3dCG1rc
👉 System Design Important terms - https://bit.ly/3Om9d3H
👉 Most Popular System Design Questions: https://bit.ly/3E9oH7K
👉 Complete System Design Basics Series: https://bit.ly/3rG1cfr
Save this post for later.
Follow Aman Barnwal for more. ❤️️
Join my Telegram group for 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐏𝐫𝐞𝐩𝐚𝐫𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐨𝐮𝐫𝐜𝐞𝐬 👉https://lnkd.in/gDBqRNBw
Tuesday, February 28, 2023
API architectural styles
The following image displays the most common architectural styles for APIs.
🔹 1. REST REST, which was proposed in 2000, is the most widely used style for APIs. It is often utilized between front-end clients and back-end services, and it adheres to six architectural constraints. The payload format may be JSON, XML, HTML, or plain text.
🔹 2. GraphQL Meta proposed GraphQL in 2015. It provides a schema and type system that is ideal for complicated systems where entities' relationships are graph-like. In the diagram below, GraphQL can retrieve user and order information in one call, while REST necessitates multiple calls.
GraphQL does not replace REST but can be built upon existing REST services.
🔹 3. Web socket Web socket is a protocol that enables full-duplex communications over TCP. Clients create web sockets to receive real-time updates from back-end services. Unlike REST, which always "pulls" data, web socket allows data to be "pushed".
🔹 4. Webhook Webhooks are frequently used for third-party asynchronous API calls. In the diagram below, Stripe or Paypal is used for payment channels, and a webhook for payment results is registered. When a third-party payment service is completed, it notifies the payment service if the payment was successful or failed. Webhook calls are usually part of the system's state machine.
🔹 5. gRPC gRPC, which was released in 2016, is used for communications among microservices. The gRPC library handles encoding/decoding and data transmission.
🔹 6. SOAP SOAP stands for Simple Object Access Protocol, and its payload is only XML, making it suitable for internal system communications.
Popular Posts
-
This is a growing list of Linux commands which might come handy for the of Linux users. 1. Found out i had to set the date like this: ...
-
To set a PDF viewer as the default on Mac OS X: Select any PDF file from Finder. Control-click to open the menu. ... Choose Get...
-
ಮ್ಯಾಕ್ ಬುಕ್ ನಲ್ಲಿ ಕನ್ನಡ ದಲ್ಲಿ ಟೈಪ್ ಮಾಡಲು ಲಿಪಿಕ ಎನ್ನುವ ಈ ಕೆಳಗಿನ ಲಿಂಕ್ ಅನ್ನು ಕ್ಲಿಕ್ ಮಾಡಿ .pkg ಫೈಲ್ ಅನ್ನು ಡೌನ್ ಲೋಡ್ ಮಾಡಿ ಅದನ್ನು ಇನ್ಸ್ತಾಲ್ ಮಾಡಿ...

💡 Don’t code today what you can’t debug tomorrow.
Below some advices to improve yourself every day :
👉Master Your Tools: Become proficient in the programming languages, frameworks, and tools relevant to your field.
👉Problem-Solving Skills: Develop strong problem-solving skills to efficiently tackle coding challenges.
👉Debugging Proficiency: Sharpen your debugging skills to identify and fix issues quickly.
👉Algorithmic Understanding: Develop a strong understanding of algorithms and data structures for efficient problem-solving.
👉Code Readability: Write clean and readable code; it helps you and others understand and maintain it.
👉Time Management: Prioritize tasks, set deadlines, and manage your time effectively to stay productive.
👉Continuous Learning: Stay updated with industry trends, new technologies, and best practices to enhance your skills.
👉Testing: Embrace testing methodologies to ensure the reliability and correctness of your code.
👉Communication Skills: Effectively communicate with team members, stakeholders, and document technical decisions.
👉Collaboration: Foster a collaborative mindset, sharing knowledge and learning from your peers.
👉Stay Organized: Keep your codebase organized, use consistent naming conventions, and structure your projects logically.
👉Attention to Detail: Pay attention to details to avoid introducing errors and to produce high-quality code.
Efficiency comes from a combination of technical expertise, good practices, and effective collaboration.