GAURAV KUMAR

Thursday, October 1, 2020

Basics of capitalism in less than 2 minutes


what is it  ?

It's an economic system where someone owns(privately) the raw materials and tools for production of goods and services and their operations for profit. Its primary goal is to generate profit and use it to invest back to generate more profits. 

what's good about it ?

Incentives - Providing better goods and services will result into more profit. 

Innovation - It's based on the idea of level playing field which simply means everyone has a fair and equal chance of succeeding. This brings competition which brings innovation because without it you won't be able to provide better/cheaper products.

What is NOT capitalism

People at all times have tried to amass capital(land, resources, money), that's not capitalism.

Contrary to what some people believe, It does not only create either winners or losers. First of all, it creates more winners in the system. second, everyone might have a fixed portion of the pie but the size of the pie is increasing. In other words, it's not a zero sum game, it's a positive sum game.

why someone opposes it ? where it fails ?

When capitalists becomes extremely successful and create monopoly, they might have influence over government because they control significant chunk of economy. This gives birth to the possibility of killing the competition via unfair means e.g. the competition does not get the tax benefits or the contracts even after being more innovative. Monopoly also affects innovation due to lack of competition, which further affects pricing which further affects affordability of common man in the society.

When capitalists become so consumed in short term profits that they ignore the things that are negatively impacting the society in the long term e.g. pollution, climate change etc.  

Children of capitalists inherit huge amount of wealth and ownership sometimes without deserving it, they do not have the incentive to work hard as they already have enough wealth which impacts meritocracy.


In the end, I want to leave you with some food for thought. Try to think which one would you choose, given you have a choice.

1. Government owns the oil, gas and the big businesses and collects direct profit instead of taxes on the  profit, uses this money to make societies better through various government programs.

Vs

2. Individual citizen owns the business and controls how to spend the profit( You may choose to invest in making society better if you like, it's a freedom you get being a capitalist)

Leave a comment if you like. Thanks for reading it. 

Friday, August 28, 2020

Notes : The hard thing about hard things

  • Darwin project - all the employees coming together working 12 hours a day for 6 months. It sounds so intense and makes me remember the marathon(42 days of non stop work with almost impossible targets to achieve) we used to do in our office of GreyOrange. 
  • Ask your employees - what are we not doing that we should be doing
  • People, Product and Profit - in that order
  • Make the company a good place to work, In worse times(and every company goes through it) people stick to a company mostly because it's a good place to work.
  • Top 2 reasons why employees quit - 1) They hate their manager 2) There is no learning for them anymore
  • No startup has so much time to do optional training for employee. Make it mandatory if your goal is to train people in something important
  • Interviewing high level executive in a small startup - think really hard and know what you really want from this position
  • Sometimes an organization does not need a solution, it needs clarity
  • Minimize politics. If the conflict between 2 people is behavioral, then bring the complaining person and targeted person in the same room to discuss, it increases transparency. If the conflict between 2 people is competency related, fire the less competent if necessary 
  • Organization design - It should be for the people. Change from monolithic design as it scales.
  • Most difficult skill as a CEO is to keep your own psychology in check.
  • Focus on where you are going than what you have to avoid.
  • Peacetime CEO vs Wartime CEO - Peacetime CEO knows that proper protocol leads to winning. Wartime CEO violates protocol in order to win.

Friday, February 13, 2015

Software Culture

Hi all,
Lately I have been thinking a lot about it. A lot of poeple in my company are talking about how should we define company culture and why we need to define a culture essentially. Altough I paid attention to what was being said but a thought triggered in my mind that if company culture is so important and software team is a big of part of the company, shouldn't we also talk about software culture. What I have observed so far is mostly people follow what's being followed in the system for long. Now, if no one sets it right in the beginning, then very soon you have so many employees following the same trend and it will be disaster.

A very simple example, let's say if people don't have the habit of testing the whole code with all the test cases before pushing it to production, then it might not be big deal now. It works until it doesn't and then one day it destroys what you have been building so far. A real example, Knight capital lost 440 million dollars because a bad code was pushed to production. The company was near bankruptcy.

Learning from other's mistakes, we can take a few things in our accounts. Writing cleaner codes, writing test cases of each feature no matter how small it is, continous backup are a few things that often people miss and it comes from practice. Automating small repetitive tasks is another thing that reduces operation time and free up the engineer to work more on actual product. Using git flow is another good practice.

Making a flow diagram before starting to write code has significant effects on code quality and code iterations.

If a feature is requested from business side, tell the developer why that decision was made. It helps them understand it from business side and there is possibility that they can give some input which will be useful for both business and software.

At last, Respect your engineers. If they want a little more time, give them.

Sunday, February 16, 2014

People and Startups

Hi,
I have been wanting to write about startups for a very long time. Since I am working in one for almost 2 years, I have seen multiple phases of a startup. I read stories about so many startups in hacker news and it amazes me how an idea develops into a product/service and how an initial product/prototype matures into a deliverable product. How people manange the money to get as much as they can. How they push the limits and work all night to add a feature and still look fresh in the morning for the demo to invenstors/clients. It's exciting to do all this. it's an art to do all this and survive till next runway.

The thing that comes to my mind is how do they start. Whenever I do background check on any founder/co-founder, I see they have created something earlier too or have been interested in doing such things for a long time. Basically people prepare themselves to get into startup business. My question is 'what about those who are new in this'. Those who don't have much background in running a business or technology for a long time. Those who are very interested in doing/creating new stuff becuase they have been in such system for a short time. Should they wait a little more to know if their passion is real or jump into this directly. As far as I have seen success rate of startups are increasing and people are taking it seriously. It can be risky but at the same time you can miss something life changing if you don't go for it.

I would like to share some of the things I have experienced so far working in a startup. You have better control over your life. The sense that you own something gives you more satisfaction than money. It may be the product you built or the company you own. You get to build new things which you are passionate about. It leads to a better life when you create something. People will always be there to assess you. To tell you what you are building might not be very useful. To tell you it's not a good product-market fit. To tell you that your revenue model is not sustainable. But I think you should build something first and then worry about those things. If you succeed you will prove them wrong. If you fail, you will have expereince for lifetime. So, I say go for it.

Friday, July 26, 2013

Communicate with an unknown usb serial device in linux

Hi all,
Recently I was trying to work with a 2D barcode scanner which was told to work as serial data device. When I inserted it in my linux system, there was nothing like a serial port or something in my "/dev" list. When I searched with the model number, I found nothing relevant to make it work. Usually it is suspected that the driver is not present in the system. I was really frustrated at that time since there was no lead and it had to be done soon. The material came with no driver. When I saw the syslog, it showed some path related to the device inserted. There I found information about the manufacturer and googled it which led me to a website where I found windows7 driver of this device. It felt like I was halfway there. I quickly downloaded the driver, installed and run it. And yes, I was able to view serial data after scanning 2D barcodes. But this wasn't it. It had to work on a linux system too.

As I tried to know more about the problem, I learned that there is a way. Writing a udev rule to control the usb device sounded like a cool thing to do. But the thing is, I had never written a udev rule and I was anxious to make the device work. So I kept searching around a bit and found something that said an unknown usb serial device can be recognized by the system if we load the kernel device driver with the product id and vendor id of the device. Finding product id and vendor id was easy. It is printed by "lsusb" command. So I gave it a try.

modprobe usbserial vendor=0x1eab product=0x0d02

I saw "dmesg" and there it was. the device was recognized as a serial device and found as /dev/ttyUSB0 .

Lesson: An unknown serial usb device doesn't need any extra driver but the usual usbserial driver can be used to register it in the linux kernel.

Saturday, February 16, 2013

multicast in lwip using LM3S6965 micro-controller


Hi all,

recently I was working on sending multicast packets to multiple LM3S6965 micro-controllers. I was using lwip library and my experience with lwip is not much.
So, naturally I googled for some examples to get the start. But unfortunately I could not find any complete working example. So, I did a bit of trial and error.
After struggling a while, I was able to send and receive multicast packets. So, I thought I would write a working example for this. I did this using raw sockets and without RTOS.

A few things to do first:-
1. enable igmp in lwipopts.h file by adding this line :-
#define LWIP_IGMP 1
2. enable udp options and disable NETCONN and SOCKET options from lwipopts.h file
#define LWIP_UDP 1
#define LWIP_NETCONN 0
#define LWIP_SOCKET 0

3.if you are using DHCP options then set netif flags in dhcp.c file.
Replace line: netif->flags |= NETIF_FLAG_DHCP;
With line: netif->flags = NETIF_FLAG_DHCP | NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP | NETIF_FLAG_IGMP;

Now you are all set. Write the code to start receiving and send a sample packet.


void UDP_Multicast_init(void)
{
struct ip_addr ipgroup,test_ip;
struct udp_pcb *g_udppcb;
char msg[] = "gaurav";
struct pbuf* p;
p = pbuf_alloc(PBUF_TRANSPORT,sizeof(msg),PBUF_RAM);
memcpy (p->payload, msg, sizeof(msg));

IP4_ADDR(&ipgroup, 238, 0, 0, 3 ); //MultiCasting Ipaddress.
#if LWIP_IGMP
iret = igmp_joingroup(IP_ADDR_ANY,(struct ip_addr *)(&ipgroup));
UARTprintf("ret of igmp_joingroup: %d \n\r",iret);
#endif
g_udppcb =( struct udp_pcb*) udp_new();
udp_bind(g_udppcb, IP_ADDR_ANY, LOCAL_PORT); //to receive multicast
udp_recv(g_udppcb, NET_UDP_rec,NULL);// (void *)0); //NET_UDP_rec is the callback function that will be called every time you receive multicast
udp_sendto(g_udppcb,p,&ipgroup,LOCAL_PORT); //send a multicast packet
}

Note that you don't need udp_connect to send or receive multicast.

It worked for me. I use lwip 1.3.2

Sunday, April 24, 2011

Rename multiple files with bash script

Hi there,
Recently I came up with a problem related to filename of downloaded files.In my college I use DC(Direct Connect) client to download files from other peers.Recently I downloaded a large number of music videos which remained in temporary directory and did not move to music directory.Although It downloaded completely, It remained in temporary directory and hence name of files was in the format "filename.(avi/mpg/flv etc.).(some chars).dctmp". So I had to rename them.Definitely, I couldn't do it manually as there were more than 1000 files.Hence I tried to write a bash script for renaming all of them at once.
Initially I tried to store the filename as "*.*.dctmp" in which I would trim the "*.dctmp" part.Hence the remaining part would the desired filename(with proper externsion).But storing the filename like that did not work out.
Then I saw that in temp files, there is a common pattern that before "dctmp" extension, there are exactly 39 chars. Then I tried a different method of trimming filename which is explained below with code.


code :

for i in *.dctmp
do
len="${#i}" ;
let len-=46
#echo "$len";
name="${i:0:len}" ;
#echo "$name"
mv "$i" "$name" ;
done

save it with name.sh and run "bash name.sh" on terminal.The script should be run in the same directory in which temp files are present.

e.g. Guns N' Roses - Welcome To The
jungle.mpg.47IMRQGAGFWOA7GMLZTK3X6QFIGR4P4EKHDRHKI.dctmp
became Guns N' Roses - Welcome To The Jungle.mpg

Worked on ubuntu 10.10