Tuesday, November 6, 2018

Auto switching of audio output to headphones when connected on freebsd

It has been a lot of fun over a couple of months. I could have just written "fun" but it was really lot of fun. I have successfully installed and been using both freebsd and Openbsd on my laptop. Running operating systems with such long lineage on a modern 4K laptop is a dream come true. It is also testament to the amount of hard work hobby developers and users have put in keeping the BSD's usable to the next generation of users. I would like to write at length regarding my experiences in doing so. But, this post will only be related to configure auto switching of audio output to headphones when they are plugged in and vice-versa.

Let us start with enabling verbose boot from the boot menu. That is the screen u see the beastie once you boot freebsd from your favorite boot loader. The verbose boot option is not available in the first screen. Go to the next screen and choose it. Allow the OS to boot. Lots and lots of boot messages would scroll down on your screen. Dont worry this is a one time config. The next time you boot you will get back your non-verbose boot.

Get the dmesg output into a text file
$sudo dmesg | grep hda > boot.txt

The above command will save all the lines with "hda" which
Open the boot.txt with your favorite editor. Let us concentrate on the part

hdaa0: nid   0x    as seq device       conn  jack  
hdaa0: 18 b7a60130 3  0  Mic           Fixed Digital
hdaa0: 19 40000000 0  0  Line-out      None  Unknown
hdaa0: 20 411111f0 15 0  Speaker       None  1/8   
hdaa0: 22 411111f0 15 0  Speaker       None  1/8   
hdaa0: 23 90170110 1  0  Speaker       Fixed Analog
hdaa0: 24 411111f0 15 0  Speaker       None  1/8   
hdaa0: 25 03a11040 4  0  Mic           Jack  1/8   
hdaa0: 26 411111f0 15 0  Speaker       None  1/8   
hdaa0: 27 411111f0 15 0  Speaker       None  1/8   
hdaa0: 29 40600001 0  1  Modem-line    None  Unknown
hdaa0: 30 411111f0 15 0  Speaker       None  1/8   
hdaa0: 33 03211020 2  0  Headphones    Jack  1/8   
hdaa0: nid   0x    as seq device       conn  jack  
hdaa0: 18 b7a60130 3  0  Mic           Fixed Digital
hdaa0: 19 40000000 0  0  Line-out      None  Unknown
hdaa0: 20 411111f0 15 0  Speaker       None  1/8   
hdaa0: 22 411111f0 15 0  Speaker       None  1/8   
hdaa0: 23 90170110 1  0  Speaker       Fixed Analog
hdaa0: 25 03a11040 4  0  Mic           Jack  1/8   
hdaa0: 26 411111f0 15 0  Speaker       None  1/8   
hdaa0: 27 411111f0 15 0  Speaker       None  1/8   
hdaa0: 30 411111f0 15 0  Speaker       None  1/8   
hdaa0: 33 03211020 2  0  Headphones    Jack  1/8   
Now let us formulate a line which goes in /boot/device.hints

hint.hdaa.0.nid33.config="as=1 seq=15"

Let us go one by one

hint -> syntax
hdaa.0 -> is from the first column of all lines "hdaa0"
nid33 -> is from the second column and the number on the line of device column which has "Headphones"
config -> syntax
as=1 -> is from the column "as" corresponding to "Fixed analog" on column jack
seq=15 -> is from column "seq" and will be the most repeated number in that column

Dont forget to add
snd_driver_load="YES"   in your /boot/loader.conf

hw.snd.default_auto=1      in your /etc/sysctl.conf

Reboot. Profit.

Sunday, September 16, 2018

Should people work to live

There is one common thread in all of the world's religion. Work. Every living being has its purpose. This purpose is nothing but something to be done, work, again. All theologians talk about a super being and all the rules to worship that deity. They just differ in minor ways but the intent is to direct you towards an all encompassing entity. But, religion cannot exist out in thin air. It requires people, alive. How do you keep people alive. How do you provide for this. You make them work. Include passages/writings/rules in the framework which somehow tells this is one way to reach the one. In fact you can afford the path to the one only if you work. It is like a minimum requirement to be part of the religion. In fact work has created rifts among the people over the entire human history and continue to do so. With written knowledge now available to all the human beings, The classification is going to be different in the near future. We are going to have a world wherein everybody will be educated. There will no more be a situation where a select few can read the written knowledge being passed on from previous generations. Suddenly this generation can read all the knowledge generated over all the 20 centuries and is available to everybody with minimum effort. With this it will be difficult to get people to work based on old rules of caste/color/region etc. There have to be other means where you have to create dependency which in turn will force people to work willfully without knowing it. It will be more efficient compared to the older models where you forced them to work.

All the economic theories/political theories are not alien to it. In fact these ideologies talk about work in a direct sense. Working people is the basis of all the present economic/political frameworks. Even Marx's thoery starts and ends with work and workers. In fact it starts to quantify work in the best possible way. Ok...ok, I got it. You are telling me that there have been recent experiments where a minimum amount is paid as a "wage" and the individual is not required to work in the traditional sense. Why are the people in these experiments being paid. This is an ideology wherein the system is expecting contributions from the individual on his own. It is pressurizing the individual to contribute out of commitment by paying advance salary. It is a proven fact that actions/efforts happening unconsciously/willfully takes minimum effort of the brain. This arrangement of work can be utilized to increase the throughput of the effort required to complete a job.

Are we born to work. Should we work to survive. Are we not entitled to live on this planet without doing any work. Is minimum wage the answer for the 1% to keep the 99% working. Should the 99% work.

Wednesday, September 12, 2018

All oppressions start with an idea and dont die

We have all come across news regarding multinationals/individuals/corporations being sensitive/insensitive to human existence/development/status quo etc... Yes, that sentence was a mouthful. I couldn't write it any other way. All those terms are so tightly tied that you can add way more to the same sentence. Why do people do what they do. It all starts with an Idea. Th idea of existence/persistence/growth/identity. now, when people talk about idea, they normally associate it with a huge business/science/technological idea. But these ideas are based on smaller ideas and also the other way. There have been smaller ideas coming out as branches from bigger ideas. The ideas i am talking about here are the destructive ones. The ideas are about taking inputs which are un-ethical. The output will definitely be something valuable in the real world for the oppressor. For the oppressed(input) the result would be devastation. The oppressor will never know and want to know that this devastation will hit him in the immediate future or a little ahead. The idea is so damn shortsighted

Well, what are we exactly talking about here. We are talking everything which is labelled under non-sustainable development. The problem here is two fold. One is the team carrying out the devastation with the core general idea.The other is the devastation surrounding the group trying to correct the whole non-sustainable thing. The thing concerning the core idea is that even if the idea generator gives the whole plan up, the idea is still up for use. The other complication is the branching from this core idea, the subsidiaries. In fact these subsidiaries have more at stake compared to the bigger ones. The bigger ones bail out once the hurdles for returns increase. The smaller ones continue and in fact all the smaller ones can coalesce and form one big juggernaut. These smaller ones never give up. This gives an impression that the problem is bigger and there is only one big oppressor

These smaller ones are like the hydra. You get one another takes his place. This is known by all the stake holders. So, they just continue. The more educated these are the more clean and polished the oppression. What are the roles of the oppressed, the government, the general public, the press and the international community at large to stop this. Who are responsible for stopping this. Who is responsible for the situation in the first place. What are the roles of these people in resolving this. Cant we live without technology which is at the core of this oppressor/oppressed scenario. Can the world be stable without this. Is the world not stable because of this. Is the world stable. Why are the majority oppressed and the minority the oppressor. Are humans such. Are all the animals such. Why is it that equality so difficult to incorporate in living beings. Marx who started with equality had to adjust to the superiority of a few. Wont the superior ones be constrained if they have to maintain equality with the mundane.

If this has to continue, then why question it in the first place. Why show it as something wrong. Why show people who do it as if they are wrong. Does anybody become right by just telling that this is wrong. What is actually "wrong". Do we understand the right and wrong. Are we programmed with points to clearly spell out right and wrong. If we are clear on this why is everybody bearing the wrongs. Why are people doing the wrongs. If a rule is beneficial to the majority is it any excuse for the minority to bear the brunt of it. Both the groups will have their own right and wrong which are totally incompatible.

Until a time every action of all living beings happen for general good without changing the status quo or improvement chances of all living beings.........

Wednesday, August 22, 2018

The full and the whole web

In the beginning days of the public internet people only talked about the web. The other definitions and classifications of the web was not existing. You access and search all the information available through gopher, ftp or the http protocol. All the computers connected shared whatever needs to be shared on the public network. The users also accessed the full content which the content creator wanted to share. Later on blogs simplified hosting content on the public network. But this content was still searchable, thought the before creating the content you had to login to access the blogging provider services. Once you  create a blog it was available to public consumption. One to one chats between users were normally not available to the general public and should be so.

Now there have been pretty various classifications and depths of the web. We all know the web which is searchable by the present search engines. Now people wanted to monetize the public network infrastructure. The ISP was always making money. Some content providers also wanted to make money. More than all these people there were people who provided infrastructure to use the public network in many other number of comfortable ways. This started the walled gardens of intermediaries who eased the use of the public network so that the number of content creators increased. For other people to access this content they should be a member of this walled garden otherwise the content here is not available to any user on the public network. Now this part of the web, i believe is larger than the visible web. What do you call this web which is behind closed doors? The term used here is the deep web. Now a banking website has to be hidden behind passwords, not content created by the general public. For the past few years majority of the content created on the internet is behind walled gardens which will not be available to the general public without keys to the locked doors.

Ok, now let us get on to one more classification of the web. The dark web. This is the most sinister compared to the other two classifications. In fact i would include the dark web as a subset of the deep web. Why, because both are not accessible by normal browsers which are used to access the visible portion of the public network. Anonymity and privacy are the corner stones of the internet. The visible network does not ensure either of it. So, is it a requirement for the visible network. Yes and No. Yes, it is requirement for people wanting to share knowledge and thereby getting the identification required. No, because the public network infra is also used for private communications among individuals and groups. There are applications which are trying to bring anonymity and privacy on the visible area of the internet. These again are resulting in walled gardens. The same application cannot be used to create content which is searchable on the visible internet. Though the content might be marked as public, it is public to all people inside the walled garden. It is solving only one issue that of ensuring anonymity and privacy for private communications. These technologies are not providing anonymity and privacy for content creators and consumers when required. This is solved by the portion of the public network called the dark web.

The technologies used to produce and access the dark web ensures anonymity and privacy for both the content creator and the consumer. The search engines doing searches on the dark web also have to ensure the same. Is there a requirement for such a setup? Am I the right person to comment on this? Have I got the right to write and talk about it? Should any general public talk about it? Should the general public know about it? Is anonymity and privacy a requirement only for pirates and terrorists? Should such setup be used only to buy and sell drugs, guns etc? This is the right platform for illegal porn, Should it be allowed? Is this portion of the web also to be policed? So many questions. What are the answers? Who will give the answers? Should the internet be modeled on the dark web technologies?

Wednesday, August 8, 2018

Centralized social networks ending as de-centrailized

There are plenty of articles written on the social network and what plagues them and definitely they will fail as is evident from the recent activities of these behemoths. I have seen people enter their most private information while creating a f*&$book profile as though they are filling up and admission form for college, as though they were to be awarded a lottery without winning. Humans want to belong but at the same time want individuality which I will not try to dwell into since I cannot and leave it to the philosophers. The public network is all about discovering content. The content as envisaged by the pioneers of the public network are linked files. Now to get to that particular linked file the search engines did the homework continuously day and night to have a dictionary of all the links on the public network. Tools were created so that people with minimum computer language added on the links and create sub links and so on.... Now the question is to monetize this situation. Since the Public network was designed to be open and not to be controlled by any single individual/corporation it was difficult. Thus was born the concept of advertisements. This was to put a layer on top of the basic web so as to lock the user out and provide a virtual screen between the content the user wants and the user in front of the computer screen. The user sees the advertisement or the popup and then he is allowed access to the content.

The public did work around this problem by making ad blockers/pop up blockers so that the user gets direct to the content. Now here again we are into two kinds of content creation strategies. Content creation on the public network for the fun of it/use of others and the other is for monetizing every glance a user throws on the content. The second group had no option but to lock the user out completely until he removes all the tools used for blocking ads/pop ups or request the use to allow ads and also consume the content. The second group of content creators were not happy with the situation. Enter social networks. In the beginning stage of the social network boom, users were mostly sharing links to their friends. This was still a healthy situation since these links were still available to the general public without any virtual walls. Trouble started brewing when the people who were sharing links they had created or others had created started creating content on the social network itself. Now this content got locked up within the social network. You cannot share these links with the general public and goes out of scope of search engines. This yielded itself to all sorts of monetization. This also created an artificial beehive where people swarmed to taste the new content created and shared.

Complete wedding albums, Family photographs, Friends photographs, photographs of houses, offices all uploaded with gay abandon to the social network. The network grew in al directions to hoard all this precious content. The content which people were not ready to put up for public consumption and for selective sharing. The same was now available to the social network. The social network is not in vaccum. It is a machine. It has to be maintained. It has to be checked for faulty components. It has to be updated/upgraded. Where does money for all this come from. It has to come from the users. But the users definitely will not pay. They would move to an alternate option or some individual/group might have created a free alternative. Think email.

So how would the user pay. He will pay in ways and means he will not know. The social network will make money from the content created without telling the content creator about these ideas. Why because the content creator is still a human being for whom sharing is at his heart.The thing with content creators is they want to reach the maximum number of consumers. They thought that the social network was the best way they can have this reach. The second level is the metadata of the members which has been collected over the years. The metadata, first and foremost includes the content and then all the other personal aspects of the creator. This combined with the personal aspects of the consumer can be extrapolated to target further creators and consumers. it is all about connecting the creators and consumers and keep them within this walled garden. Then start monetizing. The problem here is corporations also become content creators and the content can be created as though it has been created  by and individual which in turn carries more following. There is always content created to satisfy the need of the consumers rather than the urge of the creator. This is the most dangerous content.

The content, the creators and the consumers create such vast amount of data, the uses of which are impossible to gauge. It is difficult to tell what would be the uses of this data. It is limited only by the capabilities of the researcher. With the amount of computation power at our finger tips, the limits are endless. The trouble with this walled garden is that the monetizer is himself within the walled garden. He is already having an insider view and the holistic view would be provided by the social network data centers. This give a 360 degree view of any individual in this walled garden. You can throw ads at him, You can control his timeline. You can control the reach of his content and what not. Censoring content is most easy here. Since the user don't have any control over the working of this social networking machine. Censoring can happen influenced by big corporations, wealthy individuals, chauvinistic nations etc.

At a time where we have to decide the meaning of privacy, these walled gardens are not helping the cause. People don't know the value of privacy which is similar to the concept of freedom. The main issue is that this is too much of data in the hand of one corporation. How about the content creator owning his content and provide documented ways to access it. Welcome to the de-centralized social network. Think mastodon, Pleroma, peertube etc..

Monday, December 12, 2016

First 500 Kms on a Royal Enfield Classic chrome 500

1. The weight is well balanced with a very low CG
2. The seat height is OK. Can be reduced, if  possible with foot rests placed a little ahead, Might be a design disaster but can be tried?
3. The handle bar should be rotated a bit towards the driver's side to allow a little slack in the arms. On sitting at the sweet position on the front seat, the arms are fully stretched out.
4. Vehicle steering lock on the side adds to the retro feel of the bike. I remember the same setup on my old bicycle.
5. The look of the tires is good and road grip is good on asphalted roads(Not yet driven on any muddy roads)
6. The cables positioning and routing can be looked into. They are too naked to my liking. Yes it does add to the retro look, but this is one aspect which can be given a modern touch
7. The front brakes are good. The rear brake's travel is too high(To be reduce by adjusting). The seat height, the front foot rest pedal and the brake lever travel and positioning do not match. The sitting posture is totally disturbed when I try to brake hard as I have to move forward on my seat.
8. Waiting for fuel pump to start, on every ignition switch off and start, is a negative in heavy traffic. Be ready for a lot of honking if you wait for the last second before turning on the ignition key.
9. The feel you get the moment you turn the throttle to put the traffic behind you is in-expressible.
10. The sound of he horn is appropriate though I have used it only once in the first 500 Kms.
11. Mileage is approx 30 Km/litre driven only in city conditions(smooth rides in the morning with heavy traffic driving in the evening)
12. Have a good watch with vibration resistance. Be careful with your smart watches.
13. Nothing can beat the comfort of an open face helmet on a bullet. Yes lots of dust attack your face, but, a pair of aviators can be the ultimate style statement, which will also protect your eyes(Go for glasses which can be used both in the day and night). Couple these two accessories with a good cotton jacket(Not the ones they sell at RE with all the nylon nets and all, you are not a formula 1 racer, well if you are then you are on the wrong blog...he he...) and of course good pair of boots(Again don't overdo it), Liberation.........
14. The petrol reserve indicator is finicky. It gets switched on at occasional intervals when you brake all of a sudden which makes all the fuel in the tank to move to one side. It is a good indicator when your bike is exactly on a horizontal surface. Whatever be careful with the quantity of fuel and the distance you have travelled. Better to keep a record.
15. The default lengthy muffler is good, but, I am a fan of the swept back silencer(Which is still the photo of the classic 500 on the official website)
16. The rear view mirrors, my God, are a tragedy. They vibrate like crazy. In the night, a two wheeler behind you will appear like a four wheeler.
17. The engine and the muffler heats up quite quick. Be careful with your leg wear.
18. PLEASE dont change the default mufflers. The city is already polluted with sound and exhaust, please don't add to it. RIDE the bullet, don't SHOW it.
19. No grip bar on the right. Very bad design considering Indian women's pillion etiquette.
20. No hook for hanging a cover or a bag. It is criminal to not provide one. All the bikes have one.
21. Remember the tires are not tubeless ones.
22. Don't give it for a wash to your local cleaning fellow, There is a great possibility that you might damage few wires.

Monday, November 28, 2016

First drive on a Royal enfield Bullet classic 500 chrome graphite

The odometer reading on my bike was 8.3Km when the bike was handed over to me at the warehouse. The distance to my home was approximately 5 Km and it had to be done in thick traffic. I still had to get to the petrol bunk to fill up. Sonny was in the pillion seat. I had not driven a bike in the last 8-10 years. That too, now, I get to ride a bike so heavy, I was afraid I would be mocked all over the road. Anyhow, maintaining composure, started the bike with sonny on the pillion and made my way towards the petrol bunk. Reached the bunk and gave the 2 litres coupon received from the showroom and then told the boy to fill another 10 litres. Knowing that the fuel capacity was 12.5 litres. It has been my style that I would top up my vehicle well before reserve situation. But better sense prevailed and then asked him to top up with only 5 litres.

The drive home was very tiresome. Plenty of traffic. Reached home did the quintessential ode to God and asking his best wishes for a safe journey the entire life of the vehicle for the rider, pillion and all the other people and living things on the road. Here the priest was about to apply vermilion on the engine casing. I stopped him on time. The crank case and the cylinder were already so hot, one touch and the priest would have summoned the worst demons on to me and to my bike. While taking a turn, I really struggled to get the bike moving to turn 180 degrees. It was now time to rest the heavy slugger and its driver.

Woke up the next day and was still in two minds as to whether take the bike to work or not. Lot of work had to be done. The car had to be moved from its original position. There is one more bike which also had to be moved which unfortunately will be locked. At the last moment decided to bite the bullet and did all the above things to bring out the 500cc. Pulled up the choke lever and hit the electric start button. The engine chugged to life immediately. Waited for a minute or so and then off I went on my first real drive of the 500cc. The morning drive was awesome. The cold breeze, a rare vehicle here and there. Maintained a consistent 40-50 Kmph to maintain the ride in. The bike vibrates like crazy. The mirrors only tell you that you have a vehicle at your back. It is difficult to find out which vehicle is it.

The seating position is awesome. Sitting upright gives a princely air about the bike. It is difficult to drive at 60 Kmph in the 5th gear. The vehicle Will be nudging you to rev the engine but I remembered the limitations of the ride in and maintained the designated speed. The handle could have been bent a little towards the rider. The front disc brakes are excellent. The suspension is good enough. I did not feel the potholes much. It handles bad roads with aplomb. The major problem I faced is the rear brake lever. The foot has to go a long way down to use the brake. I think I should have raised the lever a notch and also reduced the total throw of the foot lever. This I will take up when I am free in the day. But, the rear brake pedal is a pain in the A*&. The driving position is completely destroyed when using the rear brake. I despise the total rear brake package.

The drive, is unique, one of a kind. The torque is available to you in all the gears. Perfect city bike once you get the hang of the bike and optimized the location and travel of the rear brake, of course. Reaching the neutral gear is something to be practised. Just in one day's drive my accuracy is nearly 60%. That is good going(patting myself). Don't change the gears when the bike is in stationary condition. hold on the clutch lever or switch of the engine in the same condition. Don't worry, you cannot move the bike that easily to change the gears all by yourself and also in the busy traffic where there will not be any place to do so. The thump, the vibration, I never knew that shortcomings in technology also could be used as USP and this bike is a mirror to this. I thoroughly enjoyed the drive in the mornings as well as traffic in the evening. The glances you get as you rev your engine, priceless and add to it the chrome. Now I know why people are so keen in going to Valhalla. Now I know the relation between chrome Valhalla. Now I know why chrome is sprayed on half lifes. Now I know why George miller is so adamant that he will not feature an electric car in his Mad Max series. Now...... I ............Know.........