Posts

How do I find the number of CPUs in C++11?

Below is the code snippet that helps to get the number CPUs in C++11: ------------------------------------------------------------------------------------------------------- // Get the number of parallel threads possible. Just an hint to create number of threads unsigned int n = std::thread::hardware_concurrency(); std::cout << n << " concurrent threads are supported.\n"; -------------------------------------------------------------------------------------------------------

Graylog - an easy solution for log management

Image
Recently, I was researching for opensource log management tools. I had only two requirements. Log Search and Log analytics. A lot of posts in the internet suggested me to use an ELK stack. But, I wanted to do something different. I found graylog as an alternative to ELK. One can setup and run it in minutes. It uses mongodb, elastic search and graylog server. Here is the login page: grylog provides different options to stream logs into graylog server. I used the simple UDP listener and forwarded logs from multiple devices into this listener. Next step is to create dashboards using the search. Here is the search page: Once search is done, you can add the widgets to a dashboard. The dashboard will help you to get the summary of your devices at one shot. It is also possible to generate alerts on different conditions. More here: https://www.graylog.org/

Comparing C and Go Lang - My first impression

Of late we are hearing a lot about go lang (https://golang.org/). I was also curious about this. I wanted to run some experiments with go and C. As expected, the experiment was started with "hello world". Here is the C code that I have used: ------------------------------------------------ #include "stdio.h" int main(int argc, char** argv) {    printf("hello, world\n");    return 0; } ------------------------------------------------ Corresponding go code is: ------------------------------------------------ package main import "fmt" func main() {     fmt.Printf("hello, world\n") } ------------------------------------------------ Well, both of them look simple. But I was astonished after creating the exe file. Below are the sizes of exe files created by C ( 51k ) and Go( 2MB ) 06/03/2016  03:41 PM            51,712 hello_c.exe 06/03/2016  03:37 PM         2,434,560 hello...

A roadmap to Software Defined Data Center (SDDC) m... - HP Enterprise Business Community

A roadmap to Software Defined Data Center (SDDC) m... - HP Enterprise Business Community

How to know your prepaid BSNL mobile number

I was informed to dial"*888#" to know my BSNL prepaid number last week in Bangalore for my new SIM. I tried it multiple times for 2-3 days but in vain. After searching in Google, I figured out that it is: " *1# "

New-Relic T-shirt real or gimmick?

I installed and used one of the New Relic products in beginning of 2013. I was promised that a T-Shirt would be shipped to me for trying their product. They asked my size and I  provided them  the same. I waited it for 3 months but the shirt never reached me. I pinged them again to mention that the shirt has not reached me. They promised a delivery again, but it never reached me even after an year. Now I a m really wondering if it is a real gimmick from their side. Note: I live outside U.S.

C++11 Feature Series: 1. Lambdas

Image
Lambdas are simple but powerful anonymous functions in C++11.You can use lambdas wherever a function object or a functor or a std::function is expected. A simple example to explain Lambda functions in C++11. Attached is a sample to demonstrate Lambda.