Sunday, August 9, 2026

How Did Kurukshetra Begin? Well… It’s Complicated

 

The king of Hastinapur, Vichitravirya, died rather prematurely, leaving behind his two wives, Ambika and Ambalika. His mother, Satyavati, suddenly found herself in one hell of a family crisis.

She would have asked Bhishma to step in, had he not been bound by his own vows and circumstances. So instead, she turned to her other son, Vyasa, and asked him to take responsibility for Ambika and Ambalika.

And thus began the next generation.

From Ambika was born Dhritarashtra — blind from birth. From Ambalika came Pandu.

Since Dhritarashtra was born blind, the throne of Hastinapur passed him by. The royal jackpot therefore landed in Pandu’s lap.

Pandu then married Kunti, Krishna’s aunt. Apparently one wife wasn’t enough for royal administration, so he married a second time as well — this time to Madri.

Now Pandu had a serious hunting addiction. The man would see something moving in the bushes and basically think:

“Whatever. Shoot first, identify species later.”

One day, Pandu went hunting in the forest.

Living in that forest was a sage named Kindama. On that particular day, Sage Kindama and his wife had transformed themselves into a stag and a doe and were, shall we say, extremely busy with some very private husband-and-wife business.

Pandu saw the two deer.

And despite seeing exactly what they were doing, he fired his arrows and killed them.

 


 

Wednesday, May 1, 2024

Travelling Morocco - Part 2

 

So, we awake!!  And the first thing after awake, breakfast. Well this time for kids, only. It was Ramadan, therefore for me breaking fast needs a little while. 

 Anyway we went out, opting for familiar choices, and stopped at a Carrefour supermarket to pick up some bakery items. Curious about local food prices, I explored the back of the supermarket to experience the country's protein consumption capacity. The prices appeared similar to those in Europe, with lamb costing around €14 per kilo and beef ranging from €8 to €14. These prices seemed quite high to me, and the same was true for cheese.


Later, while speaking with our driver in Fes, he confirmed that there has been a 40-50% price inflation for groceries post-Covid.

Then we visited the Medina. In Arabic, "Medina" means "city." As seeing here that,  the whole city is enclosed by the wall, seems to me this is the protection wall for the city. 

Sunday, April 21, 2024

Travelling morocco - Part 1

It's been quite some time since I last wrote a blog post. Between work, family commitments, stress, various issues, life changes, illnesses, and the usual unpredictabilities of life, I just couldn't find the time to pen even a few lines. However, a few months ago, I realized that I still had the ability to write. I engaged in chat-style writing and received feedback that I was quite talkative—or should I say, 'chattative'? This both boosted my confidence and piqued my curiosity. So I said myself, .. lets try. 

 

So, here we are. My current plan is to create a photo blog post. Generally, taking photos is one of my least favorite tasks when traveling. I tend to be lazy; my brain doesn't work quickly, and the process of taking out my phone, activating it, focusing, and capturing the moment seemed quite tedious to me. But this time, I tried—I had my reasons, but let's not get into that. After all, this is a travel blog, (not digging behind ha ha) i mean, not an excavation of motives. 

 

Traveling with my two sons requires meticulous planning well in advance to ensure things are affordable, "things to do" are available, and safe both in-control(law and order) and beyond-control(weather etc) meaning and so on. 

 

April is an ideal time to travel from Germany. Schools are closed for Osterferien, the days are longer with more sunlight, and it's comfortably warm—plus, it's much cheaper compared to the summer holidays. 

 

Unlike last time(Turkey), this year we choose Morocco. Why? Its near to Europe (within 3 hours for flight), weather is good, secure, Muslim country, with ancient sights to see, lots of activities, and a chance to experience a rich, medieval culture. However, for my sons, the real draws were the aqua parks, jet skiing, and swimming in the Atlantic—oh, and the abundance of sweets. Although it seems attractive and we encounter many German tourists in Morocco, found very few flights travel directly from Northern Germany to Morocco. Those that do are priced at two to three times more than we were willing to spend. Somewhere, I've read while traveling, either you consider time or consider money. You all, who is reading this, get it clearly what I considered. :-D 

 

Saturday, November 26, 2016

Mentoring Eudyptula Challenge - 3 & 4

It is a long delay of writing this part of Eudyptula challenge of 3 and 4.

But I would like to continue this series till the end (upto 20th of challenge).

Today, I'll project two challenge together, as they ain't long or big and not really a part of programming or really working with kernel space. As it is task of 3 & 4, the task number 1 & 2, specially 2 is a pre-requisite. So, my assumption is, you have already finished the task 1 & 2 and now pursuing this task number 3 & 4.
As you've done the task 2, i.e., you've just build the custom kernel, you've sent your work, and received this line -  Congratulations on passing this task!

Tuesday, November 1, 2016

Gold as Money with some scientific chatter


It was a medium quality evening, and as usual we were killing kings and lords* {all queens ain't Eli-II }(common task of every rendezvous).

Well, one of them - in zufall (accidentally!!!) got some good amount of money,
and worried (as we equally poor always do) whether will these money stay or even grow with its same buying capacity as now.
Usually due to read some of "conspiracy" theory and bit of a fan of anti-establishment, however also likes of bit of these and that - I'm for gold by far, and argue that nothing can replace gold against its buying power.

But one of us not agreeing and he put the stuff in scientific manner, as gold can be collected from everywhere, even it is possible to convert some other metal to gold through fusion technology. He put the example of ITER, where they are doing something like this. His example was, you can take a nearer metal of gold from periodic table and convert it with enough heat, pressure and some other stuff that you need to change the atomic form of that matter to gold.

Tuesday, August 23, 2016

Adding customer code/module in Kernel source tree


For an embedded system, there's actually little or almost no reason to use loadable Kernel modules. On the other hand, it may turn insecure, if the system is a protected one, using encrypted data & key while live. Then a custom loadable module can dump the memory to grab the secret data/key from runtime environment.

Other than all these, probably, you wish to see something while booting your own custom Kernel. For example, you want - that well known hello_world program should print something on console while kernel is booting.

A simple google search for "hello_world kernel space program" will point you a lot of examples to preparation, write, linking, compiling, loading, checking and unloading that hello_world program as a module for Kernel.

Monday, June 27, 2016

An interesting scanf() skipping behavior



It is very interesting and quite important to notice scanf() behavior in C programming,

While you are writing a code for example,

 int x; char y;  
 scanf ("%d", &x);  
 scanf ("%c", &y);  

    -- the second scanf() will not hit while you run the program. But if you reverse,

 scanf ("%c", &y);  
 scanf ("%d", &x);  

                -- it will work. But WHY ???
               
Because scanf() function reads new line character from Return key, so while something Integer has been read into a variable and then pressed Return, a New Line created due to Return key is staying in buffer and the next scanf(), which is ready to take a character variable took that New Line as character value and as it filled with a character, it automatically skip.

But on other case, as the second scanf is as integer, it does not effect with above cause.

Because, scanf() function removes whitespace automatically before trying to parse, except - again EXCEPT,

 %c, %n, %[] these three cases.  

Tuesday, April 26, 2016

A MQTT application with QR code and OpenCV


Once a cake sent to us, bought back to package-center and next 2 days, as we were not able to pick it.
However at the same day we were rounding near by package-center for few times.

While get back home, it was late and 2 days later we'd a cake with feet-smell.

It often happen with us, delivery package from DHL/Post or others arrive, while nobody is at home. So at the evening, while back home, found the note from postman - either collect it from neighbour or report to postoffice / collection center.

However, it would be nice to know, as well saves time and effort, that a package was at my door. So, I can pick it while coming back home, if time allows.

For such scenario let me to grab the idea of building an automated system, so absent of recipient, postman will scan a QR code, with the camera attached with doorbell and bring the packet back to package collection center.

So how does it will work ?

Tuesday, March 22, 2016

Mentoring Eudyptula Challenge - 2

Eudyptula Challenge is started in end of 2014 and getting very popular among linux enthusiast. A lot of people registered, or by mean of join-in with Little Penguin, but about half of them didn't submit the first task.

Some important notes and comments you can find about eduptula in this link https://events.linuxfoundation.org/sites/events/files/slides/ec.pdf.

This time, I'm going to discuss about Task-02. This one is a very little task about building customer kernel.

Your task will start from downloading the kernel source, you can download it as .zip, but best and most recommended option is using git. Figure out how you can get link for latest version of kernel. One of the example could be -

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

Mentoring Eudyptula Challenge - 1


This post and coming is intended to help of getting things easier on Kernel challenges, The Eudyptula Challenge.

But it will not give you the total solution, [however, you can find those by googling] but will try to help you how you can understand the problems and get the things easier.

Well now - the Eudyptula challenge is a list of tasks to learn linux kernel, its structure and development processes. Mainly its a bot, supplying and evaluating your tasks.

The first requirement to participate the challenge is to learn emailing as plain-text. Those who are well known of using sendmail from command line do know it by heart. But for modern young guys - you better use thunderbird, and set its settings as unchecked Compose message as HTML format.

On other hand, if you are using gmail on web by selecting Plain Text Mode while composing your email would give you same benefit.

Friday, February 19, 2016

Infrared Transmitter Sensor Driver for Raspbery pi


37 sensor kit box is shipped with a Infrared Transmitter sensor. Alike Line Tracking Sensor, this one also a single pin sensor, turned on infrared while got ON / High on Signal port.

Hardware Description :
The IRT sensor circuit is very simple, just consist of a Infrared LED. The sensor got 3 physical PIN, and only Signal marked as S. Well, the middle on is for Volt [5v], and last one is for GND.
S is connected to GPIO – 2.


Thursday, February 18, 2016

Line Tracking Sensor Driver for Raspberry Pi


KY-033 is a line tracking sensor. This project is to develop a dynamically loadable device driver for sensor KY-033 to enabled in RaspberryPi -1.
KY-033 is a single pin line tracking sensor. 

Raspberry Pi -1, a very popular SBC running with Debian linux (code name Wheezy for raspberry pi) with default kernel version 3.18. 


As it required to develop a kernel module, same version of running kernel header should be installed and configured for the system.


Description of Hardware:

The traget sensor KY-033 is a Line Tracking Sensor consist of one Infrared light and one LED. It also consist of a Si photosensor. The basic principle of Line Tracking Sensor is to detect if any white light component reflect from opposite surface.

Wednesday, February 17, 2016

Precision Time Measurement to read Remote Sensor


A scenario is like this --

You got a task to figure precise round trip time of a remote device or perhaps, need to measure how much time it required to receive the sensor data at requested side.

To measure accurate round trip time from client to sensor, two different technique is mainly popular. 

First, used timespec struct (sec & nano-sec) with CLOCK_MONOTONIC marco of kernel to measure time between sending client request and receive of result from server. 

Second, fill timespec struct (sec and nano-sec) variable with network driver packet timestamp macro SIOCGSTAMPNS for sending socket and receiving socket and calculate the difference.


Example Output =>

 SHELL>$ ./pngclnt_v2 192.168.178.100  
 0.000000s : 0.019165 sec  
 Output 1  
 0.000000s : 0.020459sec  
 Output 0  
 0.000000s : 0.019314sec  
 Output 1  

The idea is client -- server scenario, which means a server will run on sensor side and wait for client will request. Once receive the request, server script will perform the task and respond back to client.


Sunday, November 29, 2015

Raspberry pi - prepare for Kernel Space Programming



Raspberry pi is one of the most popular SBC in market with ARM processor. It is very popular among students for playing as embedded stuff.

There are few points, need to noted down, while working or playing with Raspberry pi.

1. SDCard shows 56 MB, while I've 4 / 8 / 16 GB etc.

The reason, windows cannot read the actual size of SDCard is, its reading only the boot partition. To get rid of this problem, its advised to use SDFormatter.

2. Which image to Install ?

Default Raspberry pi gives two type of installation image.
        1. NOOB -- completely for beginner. I'd say for those who have no / less knowledge about linux.

        2. Raspbian -- A good place to start learning with Raspberry pi. Usually WHEEZY image is popular as starting. If you've smaller SDCard, and no requirement of Desktop, you may choose Jessie Lite minimum version.

Sunday, November 22, 2015

ERROR - vSphere Client could not connect.



if you are running ESXi 5 / 5.5 [ I've experience only these two], you probably experience error as below image, with error message -

" vSphere Client could not connect to "XX.XX.XX.XX". An unknown connection error occurred. (The client could not send a complete request to the server. (The underlying connection was closed: An unexpected error occurred on a send.)) "





Saturday, November 7, 2015

Hadoop changes on Single-Node Cluster Installations


There are many notes about HADOOP single node cluster installation, mostly in Ubuntu machine. All of them I've seen worked. But as time passed by, hadoop developer also made some structural and logical changes to fit the application better.

Here I wish to sum-up those changes (e.g. change of conf, file structure etc.) so newer user would get required commands or files easily while doing HADOOP signe node installation.


first to download hadoop =>
---------------------------------------------------
Best option is to search for nearest repository for hadoop from -

http://www.apache.org/dyn/closer.cgi/hadoop/common/

for me, below is the nearest

$ wget http://apache.lauf-forum.at/hadoop/common/hadoop-2.6.2/hadoop-2.6.2.tar.gz

Tuesday, October 27, 2015

XML or .osm special character issue and solution in C


You probably have experience while parsing openstreetmap .osm file - some name [TAG-NAME] appear as

C&C - which is in clear text "C&C". So while you are coding for a .osm or XML parser, it is important to consider such special character at XML specification.

If it need to present such value at literal form, it is important to replace those characters with some other clear text format.

For example, if it need to replace the above "&" a below C program can make an idea.

 char *special_ch_replace   
 (char *s, char ser, char rep)   
 {  
  char *p1;  
  for (p1=s; *p1; p1++)   
  {  
   if (*p1 == ser)  
      {  
    *p1 = rep;  
   }  
  }  
  return s;  
 }  

Saturday, October 3, 2015

C program to generate .osm[XML] with efficient memory management


It was a requirement to generate new .osm file with selectively extracted openstreetmap's data from a big file [e.g. a country / state .osm file].

Equally the requirement extended as no use of any pre-programmed library, only simple C programming and very importantly, the program should avoid -

1. memory leaking
2. buffer overflow
3. change of pointer address
4. extra memory allocation, and
5. efficient.

End output has to be something like this -

     <node id="73900462" lat="54.3884" lon="10.38285">  
         <tag k="name" v="Lidl"/>  
         <tag k="shop" v="supermarket"/>  
         <tag k="addr:city" v="Schönberg"/>  
         <tag k="addr:street" v="Große Mühlenstraße"/>  
         <tag k="addr:housenumber" v="51"/>  
     </node>  

The output will write to a file. Where, node_id, lat, lon, tag_value/s etc. will be dynamic.

Saturday, September 19, 2015

Parsing and splitting openstreetmap file [ C ]


Its quite bizarre to me, more I'm trying to friendly with string / character processing with C programming, they are showing their envy to me.

I was/am need to split a / any big osm file to three parts, NODE, WAY and RELATION. You can do that by giving line number range to program. But I want to get the line number automatically.

This was seems very easy, just counting the new line till getting required string, i.e. <way id=

So I wrote,

 char way_compare[] = "<way id=";  
 FILE *fp = fopen("Kiel.osm", "r");  
 char ckchr[10];  
 int count_line=1;  
 char chr = getc(fp);  
 while(chr != EOF)  
   {  
   if(chr == '\n')  
     {  count_line++;  
       fgets(ckchr, 10, fp);  
       if(!strcmp(way_compare,ckchr))  
         { break; }  
     }  
     chr = getc(fp);  
   }  
   printf("Searched: %s found at %d\n",way_compare,count_line);  

Wednesday, September 2, 2015

Reading between two given line number of a File


 It is sometimes very important, to let program to read a big file only some specific part/s.

For example, I was and still trying with Openstreetmap with readosm library. Which really need such option.

As .OSM file is quite a large and readosm does read every single bit of the file, on other hand my projected implementation hardware is quite low in resources, badly needed to optimize readosm reading style.

I'd and still have a plan of doing indexing for .OSM file and apply program to read according it.

To do so, here comes the first part of virtually slicing the .OSM file and apply to program to read by given lines between.

My program is an extension of
http://rosettacode.org/wiki/Read_a_specific_line_from_a_file