Friday, November 12, 2021

Android 2021 - scrolling capture not working with Chrome browser

 Looks like the scrolling capture functionality is application dependent. With Chrome, you can enable this functionality by visiting chrome://flags/#scroll-capture

Once you enable and restart, you should I'll be able to scroll capture web pages in chrome.

Thursday, November 11, 2021

GitLens Remote Provider Settings for AWS CodeCommit

 If you wish to enable the shortcuts in GitLens to open remotes, as shown in the following screen shots, here is how I did it.

Screenshots of the shortcuts:













1. CTRL+SHIFT+P to open command palette.

2. Type Preferences: Open Settings (Json). Click on it to open the user settings file.





3. Add the following code, fixing the region values (As a Gist: gitlens.remotes.aws.md (github.com))

"gitlens.remotes": [{
        "regex": "https:\\/\\/(git-codecommit\\.us-west-2\\.amazonaws\\.com)\\/v1/repos\\/(.+)",
        "type": "Custom",
        "name": "AWS Code Commit",
        "protocol": "https",
        "urls": {
            "repository": "https://us-west-2.console.aws.amazon.com/codesuite/codecommit/repositories/${repo}/browse?region=us-west-2",
            "branches": "https://us-west-2.console.aws.amazon.com/codesuite/codecommit/repositories/${repo}/branches?region=us-west-2",
            "branch": "https://us-west-2.console.aws.amazon.com/codesuite/codecommit/repositories/${repo}/browse/refs/heads/${branch}?region=us-west-2", //
            "commit": "https://us-west-2.console.aws.amazon.com/codesuite/codecommit/repositories/${repo}/commit/${id}?region=us-west-2",
            "file": "https://us-west-2.console.aws.amazon.com/codesuite/codecommit/repositories/${repo}/browse/refs/heads/${branch}/--/${file}?region=us-west-2&lines=${line}",
            "fileInBranch": "https://us-west-2.console.aws.amazon.com/codesuite/codecommit/repositories/${repo}/browse/refs/heads/${branch}/--/${file}?region=us-west-2&lines=${line}",
            "fileInCommit": "https://us-west-2.console.aws.amazon.com/codesuite/codecommit/repositories/${repo}/browse/${id}/--/${file}?region=us-west-2&lines=${line}",
            "fileLine": "{line}",
            "fileRange": "${start}-${end}"
            }
        }]












Reference: https://github.com/Axosoft/vscode-gitlens#remote-provider-integration-settings-

Monday, August 16, 2021

Microsoft work account doesnt send push notifications for sign ins to Authenticator app

 Push notifications suddenly stopped working for me. Here is how I fixed it:

  1. If you go to My Sign-Ins (microsoft.com), you can see all the ways in which you can sign in to your microsoft account.
  2. In my case, "Microsoft Authenticator" was in the list, but on my phone within the authenticator app, my account was grayed out.
  3. I deleted the "Microsoft Authenticator" item from the list and then added back again. The website prompts you through a couple of dialogs and then finally provides you a QR code to use against the authenticator app. Once I did this, the account was no longer grayed out.
  4. The final step was to mark the Authenticator app as the default sign in method on the website.
That fixed my problem.

Tuesday, May 11, 2021

Add Git Commands to the Visual Studio Toolbar

 I wanted to be able to quickly access the Git "Manage Branches" from the toolbar.


Here is how to do it:

  1. Go to View >> Toolbars >> Customize
  2. Switch to the "Commands" tab
  3. Then radio check the "Toolbar" option and in the drop down select "Standard" (in my case, I wanted to add it to the standard toolbar. You can add it to a new toolbar or a different toolbar).
  4. Click on the "Add Command" button
  5. Select "View" under categories
  6. Select "GitRepositoryWindow" and also optionally the "GitWindow"


  7. You now have easy access to the commands:



Wednesday, February 24, 2021

Databricks - Connecting to an Azure Storage Account using a SAS key

This post is about setting up a connection from Databricks to Azure Storage Account using a SAS key.

This method is perfect when you need to provide temporary access with fine grained permssions to a storage account. In this post, I will show how to setup readonly access for a temporary period of time.

Please note: you should try and use pass through credentials, but, that functionality need premium tier databricks. This post is a workaround that utilizes the Shared Access Signature.


  1. Create a Shared Access Signature Key for your Storage Account
    Go to your Storage Account and under "Settings", select "Shared access signature"
    Allowed Services: "Blob"
    Allowed Resource Types: "Container" and "Object"
    Permissions: "Read" and "List"


  2. Click Generate SAS and connection string
  3. You need the "SAS Token"


  4. Python code for Databricks Notebook:

from pyspark.sql import SparkSession
container = "<<containerName>>"
storageAccountName = "<<storageAccountName>>"
sasKey = "<<sas token from step 3>>"; # you should use:#dbutils.secrets.get(scope="scopeName",key="keyName") 
spark.conf.set(f"fs.azure.sas.{container}.{storageAccountName}.blob.core.windows.net", sasKey)
spark.conf.set("spark.sql.execution.arrow.enabled", "true")
spark.conf.set("spark.sql.execution.arrow.fallback.enabled", "true")

inputfilepath = f"wasbs://{container}@{storageAccountName}.blob.core.windows.net/pathToFile/fileName.parquet"
dataframe = spark.read.option("mergeSchema", "true").parquet(inputfilepath)
dataframe.describe()
display(dataframe)


Comments:

The SAS key doesn't seem to allow you to use the abfs[s]: endpoint from databricks. Instead you need to use the wasb[s]: endpoint. Also, the SAS key doesn't seem to allow you to use the DFS URL (eg: {storageAccountName}.dfs.core.windows.net). So this isn't ideal, but, its a great way to connect using a temporary SAS key