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 · 2 min · 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....

August 6, 2018 · 2 min · 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....

May 27, 2018 · 6 min · 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: Creates the relevant folder which includes the Session details (including the Title, and the Presenters) For each session, saves the description in a text file in the created folder....

May 24, 2017 · 6 min · 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....

April 20, 2016 · 5 min · 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 · 6 min · 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 · 1 min · 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 · 1 min · 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 ....

February 21, 2016 · 1 min · 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. If you need uniqueness and non-deterministic, especially on the context of security or crypto then you need to think about a few things. For example the frequency, non-uniform distribution, and not using a pseudo random number generator (such as Mersenne twister ) and not a linear congruential generator ....

November 6, 2013 · 1 min · 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 · 1 min · Amit Bahree

LeapMotion SEHException

If for some reason when you try and run your code and you get a PINVOKE exception (like the one below), then most likely you don’t have the LeapMotion binaries in your Debug (or Release) folders. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 System.TypeInitializationException was unhandled HResult=-2146233036 Message=The type initializer for 'Leap....

August 14, 2013 · 2 min · Amit Bahree

How to insult a developer?

August 6, 2013 · 0 min · 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. This is a great example of what not to do!...

July 19, 2013 · 2 min · 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. This paper covers the tokenizer, grammar , DFA , NFA , etc. I think conflicts and precedence is one area it would need a little more work....

October 2, 2012 · 2 min · 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 · 1 min · 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. When you install this, you also get AWS SDK for .NET which provides one with all the building blocks that are required for consuming the IaaS services exposed by AWS including SimpleDB , S3 and EC2 ....

April 14, 2012 · 1 min · 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 · 1 min · 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 · 2 min · 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 · 3 min · Amit Bahree