Friday, May 26, 2017

Some Linux performance tweaks

If a linux machine needs to be scrutinized for performance from a networking perspective,  here are some 'sysctl' variables worth looking at.

1. rmem_max:
2. wmem_max
3. tcp_wmem
4. tcp_rmem
5. somaxconn
6. netdev_max_backlog
7. tcp_max_syn_backlog
8. tcp_fin_timeout
9. tcp_slow_start_after_idle
10. ip_local_port_range
11. tcp_tw_reuse
12. tcp_tw_recycle
13. file_max


And then, there is /etc/security/limits.conf

References:

RH Enterprise Performance Tuning Guide

And miles to go before I sleep

I had to quit the startup recently, thanks to the work I was automating which effectively made my position redundant. Not that it was much fun anyways after the crux of the automation. Thereafter, pursued ideas of visitor management and smart home automation. The drawdown for both ideas seems like:
1. It doesn't solve any pain point bad enough to open wallets.
2. Both ideas have a low entry barrier.

So back to the job cart, until I found something worth hitting the road again.
Attended a a slew of interviews, I realize a few things:
1. Most interviews are online on hackerrank and I seem to run out of time.
2. I can't code as fast as I used to.
3. No matter how many languages you know, never forget C.

This means I need to more practice and I intend to get as proficient as I can be.

 

Tuesday, May 2, 2017

The genesis of a visitor tracking solution using open source



In 2014, the need for such a software was felt when I became in charge of apartment security as a committee volunteer and was riddled with 2-3 security complaints of petty theft on a daily basis, that remained unsolved and caused angst amongst residents.

Although our guards at the time got less than 10,000 INR /month(156USD/mo) and were nowhere like the G4S like guards, I wondered if it was they lacked the ability, the motivation or maybe the means and the data or were involved themselves. There was a loud call from residents at that time to fire and replace this agency with another security agency by forking more money and it seemed to drown any semblance of reason.

Putting ourselves in the shoes of the security guard, we understood that the guards needed more info to solve the thefts. The apartment saw about 600-700 visitors on any given weekend and its a herculean task to do the guards job with his current set of tools, aka the barely legible register and CCTVs.

The existing SaaS based solution in the market at that time introduced an unacceptable delay in the impatient visitor queues and were also unaffordable in mock usability tests for the scale of our complex.

 After installation, with just basic features in place, to my surprise, after we solved the first couple of incidents quickly and easily. Aided by this tracking solution and CCTVs, which most importantly helped us map faces to names and phone numbers and lookup their frequency and timing of visits, major security incidents trailed down to barely double digit through the course of the year. I reckon word-of-mouth through domestic staff and vendors about the new security measures played its part as well in acting as a deterrent.

The first case we solved was of a malicious Water Treatment Plant technician who irreparably damaged a motor to implicate another. The second case, a case of a voyeur peeping tom, who had become a regular nuisance and apartments having exhaust windows near the staircase shuttered as a precaution. Records and timings of incidents were tallied, including the first few reports that were initially deemed to be hearsay, faces were matched and the offender turned out to be an newspaper boy, who was identified and handed over to the authorities. When these cases were solved quickly, word spread. Thereafter, all of a sudden, thefts of shoes and shoeboxes trailed off, and battery thefts from bikes became folklore.

 After sharing the data with other members, we also realized that visitor patterns could be used to determine how many vacant units we had when we had to procure Waste segregation units. It was also used to determine the noisy flat hosting a wee hours midnight party over which neighbors were losing sleep over the weekday. Long story short, it ensures sound sleep and peace of mind for the management and the residents alike. For a repeat visitor, it ensures a quick hassle free checkin as we already know where they've been before and the same
info is not requested again, leading to an express check-in.

 

Oh yes, and we still have the same security agency working here today, and residents have blissfully forgotten why they were so hostile to having them deployed earlier.

As to the skeptics who doubted the learning capabilities of security staff, we learnt that if a young security guard can do Facebook and Whatsapp on his mobile, he for sure can do this.

2017 June:
Its now been up and running for 3 years now, having processed 4L+ visits from close to 45000 unique visitors.

Wednesday, September 9, 2009

Getting an International Driving Permit at Indiranagar RTO, Bangalore

As i intend to drive during my vacation in the US, i decided to get an IDP. Contrary to whatever google search might say you need(Rs 400 only) , in my experience this is what you would need. If you ever need an Int'l Driving Permit, reading this may help you save Rs 700 that paid to an "agent" who supplied me with this information.

1. passport + visa
2. flight tickets
3. driving license
4. 5 passport photographs
5. NSC certificate for Rs 1000 from the post office at the RTO.
6. Medical certificate from doctor just outside the RTO(he took Rs 50 and asked you whether you have any disability / wear specs. i don't wear glasses, so that was it)
7. challan for Rs 400 from the RTO

Note: 1-5 require 2 xerox copies in addion to the original when submitting docs to the RTO.
In addition, since we enlisted the help of a local guy, he charged Rs 700, to tell us that we needed these documents! And then he told me to go to the RTO on the top floor who took a detailed look, asked me questions like where i was going and then initialled it.

Thereafter, i took the document to a clerk (and i only knew i had to take it there because the agent told me so) who took the document and told me to come after a few days. Luckily for me, Dad was there and he asked the guy whether they gavce any proof and whether my presence would be needed again. Then the clerk made a fuss, to which my dad presented his i-card and then the clerk made me sign on the receiving register and then asked my dad to collect the document the next day.

Total cost:
Rs 1000 (NSC, its an investment, but who's going to remember!) +
Rs 700 (to the "agent" who told me about these documents) +
Rs 400 (RTO) +
Rs 50 (medical) +
Rs 50 (xerox/misc)
------------------
Rs 2200
------------------

All this for an IDP that's valid for a year! Not sure if it was worth the the effort!

Some Linux performance tweaks

If a linux machine needs to be scrutinized for performance from a networking perspective,  here are some 'sysctl' variables worth l...