VSCode + Python on a mac

As my experimentation continues, I wanted to get Visual Studio Code installed on a mac, and wanted to use python as the language of choice - main reason for the mac is to understand and explore the #ML libraries, runtimes, and their support on a mac (both natively and in containers - docker). Now, Microsoft has a very nice tutorial to get VSCode setup and running on a mac, including some basic configuration (e.g. touchbar support). But when it comes to getting python setup , and running, that is a different matter. Whilst the tutorial is good, it doesn’t actually work and errors out. ...

January 19, 2019 · Amit Bahree

Update on Tesla .ssq files

Sometime back, I noticed the car downloaded a large file (5.1 GB) which was a .ssq file. I hadn’t heard of a ssq file, and was curious on what this was. I researched a little and as it turns out, a .ssq file is a compressed file system which is often used in an embedded Linux system, where storage size might be a area of concern. This file-system is called SquashFS, and is usually used on a read-only mode. ...

October 9, 2018 · Amit Bahree

Tesla v9 API endpoints

In case you haven’t been following the news, Tesla is in the process of releasing the new firmware beta. I think many folks online are super interested in new autopilot upgrades. I reverse engineered the associated app and there are certainly a few new end points exposed, as outlined below. Need time to now figure out more details on this and what they entail. Also need time to see what changes in the existing code and json (data structure). ...

October 2, 2018 · Amit Bahree

Setting up your own Model 3 "keyfob" - using a IoT Button

Some time ago, I talked about my Tesla Model 3 “keyfob” which essentially uses a Amazon IoT button to call some of Tesla API’s and “talk” to the car. This for me, is cool as it allows my daughter to unlock, and lock the car at home. And of course it is a bit geeky, and allowing one to play with more things. :) ...

September 16, 2018 · Amit Bahree

Generating Tesla authentication token - cURL script

UPDATE: This cURL script doesn’t work anymore. This was originally published back in 2018 when it was the best way to do this. Over the last few years however Tesla has deprecated this endpoint (/oauth/token) and moved to a SSO service (auth.tesla.com) which is a completely different approach. I’ll have a look and if there is a simple way to do it, then will share it here. I did write a simple Windows (desktop) app called TeslaTokenGenerator, for those who wanted to create authentication tokens for their Tesla, and use with 3rd party apps/data loggers. ...

August 10, 2018 · Amit Bahree

Windows Tesla Auth Token Generator

If you have a Tesla, and are using (or wanting to use) 3rd party tools or data loggers, the one think they of course need is to authenticate your details with Tesla. A simple, but insecure way is to use your Tesla credentials - and surprisingly many people just happily share and use this. I wasn’t comfortable doing this - after-all, they have access to your account where you can control a lot of things. Also, there are a few online tools that can generate the auth token, but again I wasn’t comfortable, as I did not know what they saved, or what they did not. :) ...

August 6, 2018 · Amit Bahree

Download Build deck and video (2018)

Just as last year , I wrote a PowerShell script using which you can download the PowerPoint decks, and, videos from Microsoft Build’s conference, instead of streaming it (or manually download it one by one). You can choose if you want the decks, or the videos, or both. For the videos you can choose the desired resolution (Low, Medium, High) – of course the higher the resolution, the more space is needed. The script also downloads the description and if there is a session image (if there is one). ...

May 27, 2018 · Amit Bahree

Download Build (2017) decks and video

Update: Modified the script to handle multiple instances but pay heed to the warning here . Similar to last year , I have a PowerShell script that will allow you to download the various PowerPoint decks and videos to watch locally rather than stream. This makes some improvements from the earlier scripts (e.g. if a file is already downloaded it will skip downloading it again) and does the following: ...

May 24, 2017 · Amit Bahree

bash on Windows is real & not a VM

I have talked to a few folks recently, and they still don’t believe bash on Windows (RS1) is ‘real’ and think it some kind of a VM. No it is not. It is the ‘real’ user mode running on Windows. It is not Cygwin, and it is not a VM. It is essentially all of the user mode (I.e. Linux without the kernel). The kernel in this case is a wrapper around the NT kernel that translates the Linux commands to Windows and then things run. As far as Linux is concerned, its the same code and doesn’t have any changes). Technically this is called Windows Subsystem for Linux (WSL). ...

April 20, 2016 · Amit Bahree

Download Build (2016) decks and videos

Update - Was a typo in the script, which I fixed. If someone had an issue, copy it again and give it a go. I prefer to download and see the decks and videos ‘offline’ instead of streaming, as I can easily pause them and then pick off where I left - especially handy when I need to go to a meeting, or take care of some work, or just on a crappy network. ...

April 13, 2016 · Amit Bahree

Unity and Visual Studio

Have been playing, a little with the new Visual Studio “preview” version (the installation of which is super smooth and takes waaaaay less time!). And as part of that saw the Unity Debugger option. Was this always there or is that new? Or did the Unity Tools beta add it? Interesting times to start playing with this, primarily for AR/VR and #HoloLens.

April 6, 2016 · Amit Bahree

Humans and threading

We, humans, are multi-threaded by design and can do many things in parallel - with two exceptions I think. The only two blocking function we have to deal with are sneezing and farting. During these times, all current activity must be suspended for the duration. And of course it can be pretty annoying (or depending on the function, embarrassing). So next time you check in some code, think about it - is this smelly and sneezy (yep, that’s a word, now) or have I done the right thing? ...

March 12, 2016 · Amit Bahree

Open Live Writer

Just downloaded and installed and posting this via Open Live Writer . Remember the lovely (but dead) Windows Live Writer from Microsoft? Well this is a forked version of that which is open source, based on MIT license. The editor is offline and is very similar to word and can support a number of blogging platforms – including the common ones as you would expect. You can muck around the code (zip) or check it out on GIT . It is still work in progress of course (e.g. Plugin’s are not implemented yet). Irrespective, hugely grateful to Scott (Hanselman) to get this going. ...

February 21, 2016 · Amit Bahree

Is rand() harmful?

​I saw this awesome presentation on why rand() is considered harmful. When you need a random number, don’t call rand() and especially don’t say rand() % 100! This presentation will explain why that’s so terrible, and how C++11’s header can make your life so much easier. ...

November 6, 2013 · Amit Bahree

C++ Comment

1 2 3 4 5 6 7 8 9 10 11 12 13 14 int MyFunction() { // There once was a man named Dave int Result = 0; // Whose code just wouldn't behave MyObject \*Ptr = new MyObject(); // He left to go to a meetin' Result = Ptr->DoSomething(); // And left his memory a leakin' return Result; }

September 22, 2013 · Amit Bahree

How to insult a developer?

August 6, 2013 · Amit Bahree

How not to handle exceptions!

Was trying to pay my Electricity bill online via a site called Bangalore One , which is the Governments, premier one-stop shop for Electronic Delivery of Citizen Services. I could not pay because it seems like some backend services they need for credit card payment is down. How do I know this? Because the site is revealing too much detail! See the exception details pasted below. ...

July 19, 2013 · Amit Bahree

Writing a compiler using C#

I was cleaning out my old papers (finally!) and came across an old paper I had titled “ Compiler Writing Tools using C# ” which essentially shows how you can write a number of tools like lex and yacc but instead of C/C++ on Unix, you use C# and .NET. ...

October 2, 2012 · Amit Bahree

Metro Apps in C++ anyone?

In Visual Studio “11” when I try and create a new C++ Metro app using the built-in template, I get the following error: “Can’t find localized resources”. I wonder if anyone else has managed to get around this? I am running the Consumer Preview Build of Win 8 (Build 8250).

May 19, 2012 · Amit Bahree

AWS Extension for Visual Studio

I had forgotten that I had the AWS Extension for Visual Studio installed until recently I noticed AWS Explorer item in the View menu option. This add-in allows you to explore the various features that Amazon exposes right from within Visual Studio. The toolkit makes it easier for developers to debug and deploy a .NET solutions that uses AWS. ...

April 14, 2012 · Amit Bahree

Troubleshooting WCF Performance - Part 1

More related details on Dustin’s post - WCF scales up slowly with bursts of work .

May 26, 2011 · Amit Bahree

PowerShell script to kill named processes

There are times when you need to kill a number of processes in one-go like today when Chrome crashed a few times hanging all the running instances – next time Google says, one tab cannot bring down all of them – send them my way :). For such times, a PowerShell script is all you need. I wrote up a simple one which takes the process name as input and then kills all the processes which match that name. ...

May 23, 2011 · Amit Bahree

Twitter Trends

I was excited to find that Twitter had a JSON (Javascript Object Notation) endpoint for the current trending topics and decided to write a simple consumer which can read this and then spit it out in a simple console. And JSON being so simple and more or less “universal” meant that there are multiple implementations for .NET. Of course if you got lots of bandwidth you can roll out your own parser. ...

March 4, 2011 · Amit Bahree

Opensource ZigBee stack?

I was planning on getting the Telegesis ETRX2USB and wanted to know if there are any open source (or shareware) open source ZigBee stacks that I can use with that? I also wanted to know if there is any opensource (or not too expensive), network management or network analyser for a ZigBee network? Essentially I want to be able to programatically view network and node information on the ZigBee network (e.g. S/N ratio, signal strength, etc.) - something similar to Ember's Insight Desktop which shows the details I am interested in. I could not find anything specific and would be interested in getting ideas. ...

January 16, 2011 · Amit Bahree

C++ Message queuing options?

I am thinking of implementing a queue in one of the projects I am working on right now (sorry cannot go into more details until it gets published - hopefully in a few months). Anywyas, this is in C++ which needs to run on Ubuntu and my queueing experience (with C++ or otherwise) is only with MSMQ which is brilliant, but does not help me here as that run only on Windows. I also cannot use something like STL Queue as this will need to run across a number of machines and trying to sync between them would a royal pain. In other words, this needs to be distributed and async “loose” messaging. :-) ...

December 29, 2010 · Amit Bahree