Thursday, January 22, 2015

Tip to self: Check if a process is slowing my mac's internet connectivity

For intermittently slow internet connectivity, use nettop(1) in OS X to figure out if a process is choking the internet bandwidth. It is pre-installed.

$ nettop
Then hit 'd' and look for entries with consistently large values in the 'bytes in' or 'bytes out' column. The 'd' instructs nettop to only show differences in each screen refresh.

Practical usage notes:
If you don't recognize the process name, Google it.

If you don't want the process around, get the pid (the number next to the process name in nettop), and kill it with kill -9 <pid>. If that doesn't solve it, find out if you can politely tell the process to stop (for e.g. I logged out of AppStore, iBooks, iTunes and killed storeagent again).

If you're interested in what the process is doing over the network, use the client port number for a particular connection (e.g. '53133' from 10.0.0.1:53133->74.125.68.100:80) to run a tcpdump(1) on to see what packets are being exchanged: sudo tcpdump -nnvvXSs 1514 port 53133

If you're interested in who the process is talking to, but the destination IP address doesn't have a reverse DNS hostname (like in the previous example), then try visiting that IP address in a web browser as https://IP, click the broken lock icon in the address bar, and view the certificate details to find out which domain is served there (*.google.com in this case). This won't work if SSL port 443 isn't open on the destination.

Wednesday, December 03, 2014

On Hobby Startups and such..

You know, an odd thing has been happening to me recently. I've been drifting away from hobby programming, and drifting into hobby startups. For folks who've known me long, most projects I do (outside of work) are hobby projects. Programming and tinkering around has been a dominant theme.

But this is different, it feels different, and I'm suddenly getting yanked back to the unsureness I had back when I was a teenage programmer. I'm now a total newbie and beginner in a world of suits and businessmen, and wondering what I'm doing here. For starters, I'm currently totally immersed in this - I've taken a break from Amazon and am learning how to start a company. It sounds quite loopy (probably is), but in the university of life that's the learning I'm seeking. And as usual, I prefer the practical approach of doing it and make up/learn theory along the way, and iterate.

A good number of people start companies to promote their vision of the world, which I've heard is the right way to start a company. But the hobbyist/tinkerer itch I've had for a while is to actually learn how to start a company, just for the sake of that. And learning to do so much like how I learnt how to program - by just programming a lot (really, a lot). It was through lots of fun projects, painful hours of debugging and figuring things out, years of constantly realizing what I was doing wrong and in the process learning better things. It was fun, it led to a brief career as a programmer solving somewhat interesting challenges, and a countless series of hobby projects I loved.

Now this new branch of learning - of building a company to "program" your vision is turning out to be quite fascinating. This involves newer aspects of learning, where I'm learning (through repeated reality checks) the simple yet complex interplay between a customer, his/her problem, his/her solution to the problem through the purchase of your product, which in turn is your solution to how you understood the customer's problem, and improving the overlap in the two. There are other equally interesting aspects like keeping the company afloat, and dealing with the new, unexpected reactions from the people you interact with. If you aren't confused yet, good, because you either got it or your eyes glazed over.

But yeah, it does feel at a fundamental level like programming, except you're dealing with an extremely complicated analog system, and I've never programmed analog systems. Like my post above, logical contradictions are part of the whole deal. And you need patience, tonnes of it. There's no point getting frustrated with a computer, and there's no point getting frustrated with humans.

I'll try to post more on this as it goes, but I'm usually quite lazy in matters of posting :)

Cheers
~Shashank
PS: The thumbnail pic is the Antikythera mechanism, the world's oldest analog computer dating back to ~150 BC.

Sunday, June 15, 2014

Oculus Rift at the Makerfaire 2014 in Seattle

I had good fun demoing the Oculus Rift Virtual Reality glasses to visitors at the Makerfaire 2014 held at the Amazon campus on Sat, 14th June. I walked into the Makerfaire at 9am in the morning with my demo gear, and can only describe the feeling as a kid walking into a candy store :) All around me were 3D printers, space elevators, robotic arms, quadcopters, a WallE prototype that mowed your lawn, a theremin, and other fun hobby projects. Yes, these were all DIY hobby projects made by the presenters.

Having failed to get my demo virtual reality game running in time for the fair, I decided to just show the visitors the amazing device the Oculus Rift is. Most of them had never experienced immersive Virtual Reality before, so they were definitely in for a visual and sensory treat :) There are a few good demo programs around - I used the standard Tuscany demo, a hungry Giganotosaurus dinosaur looming over you, Eden River: an ethereal glide over a river, the infamous Malfunction, and a video of a roller coaster ride. My hardware setup was a MacBook Pro connected to the Oculus Rift Dev Kit 1. Many visitors wore glasses, so I was glad I was well-practiced at changing the lens in the Rift quickly (the kit comes with 3 pairs of lenses of increasing power).

I was blown away by the sheer number of people eager to try the Oculus Rift, everybody it seems had heard of it but had never tried one. Most had never even tried a Virtual Reality glass before, so I wasn't kidding when I told them they were going to experience a new dimension soon, technologically and philosophically. My rough guess is that about 300 people tried a few minutes of demo each, most with their family and kids. The fair lasted about 6.5 hours, and it was fun to see people try to physically run back when a gigantic dinosaur tried to bite their heads off, or pensively stare at distant mountains off a balcony in a sunny Italian villa. Many parents lined up particularly to request the dinosaur demo for their kids :)

I was very happy to see many kids not older than 13 asking me detailed technical questions about how the
device hardware worked, the programming involved, the math behind the code etc. And they got it, way more than most adults did. It was also interesting that kids were immediately comfortable with using the headset and roaming the virtual world freely, while most adults looked around very hesitantly until I told them they could actually turn their heads and body around.

I really wish I could talk more about the other prototypes at the fair, but my booth kept me busy all through and I couldn't see most other demos, which sucked. I did manage to make a quick round to nearby demos, and was particularly impressed by a homebuilt hexacopter with a clever contraption to keep the onboard camera always looking straight ahead regardless of the turning of the 'copter. The gyroscope wasn't the interesting bit, it was how he had hooked together his feedback-correction motors. We also chatted about how he could attach a stereoscopic camera to his 'copter and look-through-the-eyes using the Oculus Rift while flying, similar to this guy. That's really trippy.

All in all, I'm really glad I attended the fair, and I'm excited about new interesting uses of the Oculus Rift, and hope the Virtual Reality party continues worldwide.

Until next time

Wednesday, April 16, 2014

I'm back

It's been a while since I last wrote about what I'm working on. My work at Amazon has been taking most of my time, especially over the past year. Other than that, I branched out into mind-hacking for a while which was fun, albeit a bit dangerous at times if you don't "mark the trees" to retrace your path back.

I've been really getting back into programming in C and server-side Javascript, which happen to be my two favorite languages, so I'm happy to get back the focus of being able to sit for, say, 6 straight hours and just write code and design things. You lose that a bit working at big companies where there's a lot of randomization, and less opportunities to write multiple versions of the same thing to pick the best approach, due to shipping dates committed to by a much larger group of people. But you accomplish way more because you can move faster without necessarily sacrificing quality. My biggest learning from Amazon as a developer I'd say would be the use of libraries for not writing everything from scratch. BTW on the topic of server-side Javascript - NodeJS, npm and CommonJS have really matured a great deal since I last lurked in the CommonJS mailing lists in 2009, and that's a great step ahead for Javascript becoming a language of preferred choice.

In terms of personal projects, I've been playing around with writing a neural network (to use the term loosely) that spans multiple EC2 instances, where nodes run as individual processes that can probabilistically fork and communicate with each other. I stumbled upon the Oculus Rift while working on that, since I needed a set of VR glasses to visualize the neural network in 3D, and it was insane! I haven't used VR glasses before, but if you look past the lens-magnified pixels and blur, the feeling of being present elsewhere was very very good. At $300 for the developer kit, I think it is well worth the money. I don't care too much for the Facebook acquisition, since I highly doubt Mark Zuckerberg sees Facebook as just a social network and would be surprised if the social aspects get kludged into a VR headset. The raw number of possibilities with the Rift is so immense that there is interesting stuff for everyone, beyond just repurposing a social network to work in 3D with head-tracking. Good protection against Sony's muscle, is my best guess.

I've restarted my study of Physics, and I hope to research alternatives to rocket propulsion this year in my spare time. I still don't have the money required to make this more than a hobby, but I'm an optimist and hope I can fund this interest at some point in my life. I'm currently taking classes for Muay Thai and Boxing, which is the hardest I've pushed my body and is really fun. I think I should learn driving at some point too, which is ironic for a guy with dreams of traveling to space. I spent many months last year teaching myself improvisational guitar playing, especially with scales and modes for playing solos, and combining different influences from a really wide range of bands from the world. It's a really good way to relax, and I continue to believe that everyone in the world should learn an instrument to play music on.

I hope to post more frequently in the coming months with what I'm working on.

Until next time

Saturday, March 07, 2009

Sun TechDay at VIT University


Sun Microsystems recently came to our college to conduct a TechDay (also called: "SunDay", which co-incidentally was held in our college on a sunday too!) on March 1st, 2009. The event comprised of four workshops - on J2ME, Solaris, and JavaFX. We had to conduct two parallel sessions of J2ME instead of one (so J2ME counts for 2) because the response was so great -- we got double the no. of registrations we had expected! The expected nos. for each session was 70 which works out to 210 in total for the three sessions, but we registered 162 for J2ME, 85 for Solaris and 124 for JavaFX = 371 registrations!

The engineers who conducted the sessions were excellent, the sessions were really informative, and we're already receiving requests for another TechDay from those folks who missed out on the registrations as well as those who attended (for sessions on advanced topics). We're planning another version of this somewhere at the start of the next semester.

The task of organizing the entire show fell upon the Sun Open Source Community that me and Aditya had kicked off in December last year, and the team of 9 core members and 23 associates that was selected did an exceptional job! Frankly I gave a pretty conservative estimate to the Sun folks when asked initially about the participation, keeping in mind the previous events, and other issues like 1st being a sunday and the SEDS India National Conference happening at the same time. But the members of the Sun Core and the Sun Associates did a fabulous job in getting so many registrations, ensuring that all the ground-operations on 1st went smoothly and basically that everyone had a good time. Kudos to them!

Cheers

Monday, February 23, 2009

Google v2

Been a long time since I wrote, and as comments to my last post prove that I have a fan following of critics now, waiting for new posts, here it is:

The previous month has been really hectic, as we're working very hard (and at great speed) to complete our project for the finals of Google Product Prodigy '09. BTW, I should first inform you that we guys got selected to the finals of the Google Product Prodigy contest (again, for me) from the entire Asia-Pacific region! People who've read my previous blog (at awardspace.com, which seems to be dead now) would recall the post I made describing the fantastic experience I had at GooglePlex Bangalore last year. We're pretty excited at being able to go through that again!

The other interesting project me and my friends are working on presently are an Adaptive Web Search engine, that adapts to a user's search-usage pattern over a period of time, so that after a while, the search engine starts delivering results tailored to the trends the person has set over weeks.

We're also about less than a month now to the launch of Flare (our Google project), which will be launched as a web service! It will initially be invite-only. :-)

Cheers!
Shashank

Monday, December 29, 2008

LSJ: The Blue Screen of Megadeath


Shudder. For those of you who have used Microsoft Windows XP, be afraid, be very afraid. Because the British Navy has just upgraded its nuclear (powered and deterrent) submarines to the state-of-the-art control technology -- Microsoft Windows XP. A stripped down version of it, if that be any consolation, which it is not.

Check out the Linux Journal article: Blue Screen of Megadeath

"We can't speak for anyone else, but the thought that somewhere floating out there are two hundred nuclear warheads under the control of Windows XP scares the living daylights out of us. If anyone needs us, we'll be building a bunker in the back yard before one of the boom-boom boats throws a blue screen of death and blows us all to kingdom come."

Boo!
~Shashank