Posts
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 morePosts
Shebang (what does "#!/bin/bash" do at the start of bash scripts?)
Demonstration by Example This was originally answered by me at Quora
#!/bin/sh sleep 50 let’s save it as a.sh and make it executable
sudo chmod +x a.sh Let’s run it in the background and stat the process.
./a.sh& [1] 11660 On looking at the process details:
ps -fp 11660 UID PID PPID C STIME TTY TIME CMD sudipbh+ 11660 11330 0 15:30 pts/7 00:00:00 /bin/sh ./a.sh We can see that the content of the file is passed as an argument to the program /bin/sh.
read morePosts
Some notes on gradle
Java plugin for gradle Add build.gradle at root of the project
apply plugin: 'java' This links the gradle. Makes gradle aware of java.
build.gradle is written in groovy Intellij comes with an inbuilt groovy console (interpreter for the language)
Groovy console can also be used as ‘java interpreter’ to quickly evaluate java code and api (akin to jshell)
groovy closures:
class Myclass{ void doSomething(Closure closure){ closure.call() } } obj = new Myclass() obj.
read morePosts
Thoughts on Kindle
Experience So far I have been using kindle paperwhite for a while and it’s been great.
Does carrying kindle look outlandish? Quora Question I have a cover/pouch for my kindle which I can fold like a leatherback diary. Even when I am reading I can hold it like a normal diary/book.
It doesn’t look outlandish at all.
Why do I prefer ebook readers quora answer I find it more convenient to read from e-ink based ebooks readers (have used kindle) over physical books for most of the cases.
read morePosts
An Essay On Technical Sophistication
Building Technical Sophistication As A Developer Idea and concept wise it’s something we all developers are quite aware of. I first came through this exact term, “technical sophistication” in Michael Hartl’s article in Learn Enough Society. The basic idea is as developer one requires a certain set of skills which can elevate their overall vision and can see things in a broad sight. One need not be technically proficient at everything but having good understanding of fundamentals enables us to debug and reach the solution faster.
read morePosts
Some notes on HTTP
Learning from the udacity course on client server communication
course link: https://classroom.udacity.com/courses/ud897
Using netcat:
nc google.com 80 <head/get/post/put> headers: OPTIONS: get a list of methods supported by the URL end point HEAD: just the header and not the body.. validate if the incoming data will fit the memory, cache validation xml-http-request: xhr, traditional way of doing ajax, new way is javascript promises which are chainable callbacks and are asynchronous
How head is used for cache checking.
read morePosts
I completed Unix Workbench Course by John Hopkins University in Coursera
I recently completed UNIX workbench course by John Hopkins University in coursera. So, I thought I would write something about UNIX, GNU/Linux.
Love for UNIX There is a documentary by AT&T on Unix on youtube which I regularly rewatch now and again which shows the early story of UNIX and has Brian Kernighan talk about the power, simplicity and elegance of UNIX design.
We know the story of how linux came to be.
read morePosts
Learnings from Redis Meetup at Razorpay
Personally I haven’t extensively used redis. My limited understanding of redis would be summarized as:
redis is in-memory database, stored in RAM (making use of underutilized RAM space in servers) being stored in primary RAM it’s very fast being stored in volatile storage (RAM) it vanished as system goes off, however there are ways to persist it in the file system redis uses key value storage and supports quite a few datatypes including list, hashmaps, geocodes, etc how companies like twitter have made an extensive use of redis in caching for faster retrieval (low latency when the throughput demand is high) it can be used as pub-sub model (message broker) Trivia: Redis is an acronym for “Remote Dictionary Server”
read more