Posts
Good Object Modelling
OOP is all about Encapsulation Yes, that’s right. Object Oriented Programming aims to encapsulate properties and methods into a consolidated object so that’s operations can be carried out on the object. The whole aim was to move from procedural functions which were not easy to reason about and prove correctness. But this principle often gets violated and people write procedural code using objects. Classic Example is:
class Rectangle { private Long length; private Long breadth; //gettters //setters //constructors } And caller calculates area by:
read morePosts
Slack WebHook, A use case
Linux Terminal Controlled Slack WebHook This is a simple use case of slack webhooks. Slack webhooks can be configured to send messages when some events occur, i.e. we trigger the hook and the hook sends the message to slack channel configured.
I have set up a workspace (for my own personal experimentations) and created a webhook which is a fairly simple process. Web Hook can be called via HTTP POST call with required message.
read morePosts
21 Lessons (Book Review)
21 lessons for the 21st Century (Book Review) 21 Lessons for the 21st Century by Yuval Noah Harari My rating: 5 of 5 stars We live in an extremely complicated world. It’s so difficult to make sense even of the tiniest realm of our lives. Religious dogma, political gambles, economic disparity, an ever-increasing gap between poor and rich, promises and dangers of new technologies like Machine learning and artificial intelligence form the most confusing crossroad in all of the recorded human histories so far.
read morePosts
HTTPS vs SSH end points in github/bitbucket
Read Sudip Bhandari's answer to What should I do such that Git doesn't ask for username and password while pushing and pulling the code? on Quora
read morePosts
Linux aliases
Read Sudip Bhandari's answer to How can I create aliases in Linux command? on Quora
read morePosts
Quick & Simple screencasts using Peek
Read Sudip Bhandari's answer to Can you surprise me with a Linux software so good I didn't know I need it until now? on Quora
read morePosts
Setting up local postfix to send mails via Google's SMTP
Postfix Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail. This is required in order to be able to send mails from the local machine (without using any vendor’s client)
Installation sudo apt-get install postfix Postfix has be configured. The suggested way to do is via: sudo dpkg-reconfigure postfix. You can also directly edit /etc/postfix/main.cf file and make changes to the configuration. For most of the purposes dpkg-reconfigure should suffice.
read morePosts
Some Useful SSH tips
Executing commands remotely and returning results One of the common usage is to log into remote machine and check some process stat to see if some program is running or not. Instead of logging in, executing command and then returning back, we can do it in a single shot by providing the command to be executed as an argument.
ssh loguser@$x.x.x "ps -ef | grep kafka" loguser 12214 12213 0 23:47 ?
read morePosts
A tiny Springboot app
This miniblog is adpated from this linkedin course
The tweet that started it all Install springboot cli Easiest way is via sdkman.
sdk install springboot Groovy classFile:
ThisClassWillActuallyRun.groovy
@Controller class ThisWillActuallyRun { @RequestMapping("/") @ResponseBody String home() { "Hello World!" } } Running the app:
spring ThisWillActuallyRun Output:
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .
read morePosts
Experimenting With Local Kafka cluster
Kafka is the platform for stream processing. The real power of Kafka comes in the scenario of distributed computing where Kafka logs can be considered as a single source of ordered-truths. Those logs can be consumed by all the relevant consumers in their own pace and own time. (within the retention period, of course). Here is a great LinkedIn blog on log, which is the core of Kafka platform.
In summary, Kafka has a number of clustered broker nodes (which actually store message inside various topics which can be partitioned (default is 3)).
read more