Compiling
#GeekyJokes
#GeekyJokes
If you are like me and get annoyed with the big PowerShell upgrade ’nag’ ‘reminder’ (see screenshot below); instead of trying to figure out what to download and install the update, there is a simpler way to get the latest update and address the nag. :) You can just run the code below in an elevated prompt to get the latest release of PowerShell - it is easy-peasy. :) ...
If you are like me, and don’t really have your work saved in the “%USERPROFILE%” it gets annoying after a time, to keep changing the directory. If there is one specific folder that you prefer, it is an easy configuration change in the profile setting - add a setting called “startingDirectory” and point it to the path you want. For example, I have a root folder called “src” where most of the code I am working on sits, and that’s where I wanted to default the terminal to. ...
I recently needed to get a list of users that belong to a specific Microsoft Teams team - and there isnt anything out of the box to get this using the Teams app. AFAIK, the only way to do this is using the Microsoft graph API - for which there are a few options. For something quick (e.g. getting a list of users in a team), using the Graph explorer could be easy enough. On the other hand, if you need something more robust, you should program against the (REST) API. ...
I think this from xkcd sums up my afternoon quite nicely. Messed up a repo, and then was trying to ‘clean up’. A huge thank you to Lily, on the team, for working with me to cleaning up my mess, and helping me show some of the ropes. I know there are quite a few tutorials out there; a couple of these that I found including one from Lily. ...
Been playing with a few things at home, and as part of that was trying to get Docker and Docker Compose running on a Raspberry Pi. Docker Compose if you aren’t familiar with, allows one to run multi-container apps, and is very handy when building multi-tier layered applications - which are quite common. ...
Haven’t had time until now to explore on what is new as Tesla continues to push updates. The latest version as of this post is v3.9.1 which is what there I decompiled and when compared to the earlier version ( I had posted (v3.8.2) , there three new REST API’s outlined below. Service data from the car - not sure what exactly does this will. Need to try it. ...
This is a output of a few frustrating hours (spanning over a few days - as and when I can get time), and finally got it fixed and working. Hopefully it might help someone who is also dealing with npm blues. When NodeJS and npm works, its awesome. But when it borks, it is worst than my code or so it seems :). Been playing with a few things and wanting to get a dashboard going with Grafana (and InfluxBD as a time-series DB). But some of the installation was failing and for the life of me, could not figure out why and how. Clean image install and downgrading to the previous stable version also didn’t help. ...
A key virtue of a programmer is laziness. As an example it is what inspires me to automate my home to the point where I don’t have to lift a finger to switch on the light. Removing friction from a system is a anesthetic joy. The drug of efficiency, feels really good. I still write code and people get surprised by that sometimes - maybe it’s the quality of the code 🤓.
I have been playing with a #selfdriving car for a while , and that is super exciting. From a #AI and #ML perspective it is small scale but allows one to exploit all aspects of the tech stack and also appreciate the limitations of not only the software but also the hardware. With this, You run a NN on a raspberry pi that uses TensorFlow, and Keras and run inference on the edge. The pi doesn’t have enough power to train, so you need to do that on a beefier machine and then deploy the model back to run this. ...
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. ...
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. ...
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). ...
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. :) ...
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. ...
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. :) ...
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). ...
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: ...
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). ...
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. ...
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.
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?
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.
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. ...
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; }