Posts

Visual Studio Code keeps asking to sign in to sync settings...

Recently I had an issue where every time I started Visual Studio Code it would ask me to log in again to sync settings. It would work for the session, but after a restart of vscode it would appear to forget them. Turns out this is apparently due to a full list of credentials. This is referred to in the Troubleshooting keychain issues page: https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues Below is the text from the article at this point: Windows If the keychain throws the error "Not enough memory resources are available to process this command", open the Credential Manager application, click on Windows Credentials and go through the list to see if there are some you can delete. This error was first reported in  issue #130893  and happens when you have too many credentials in your Credential Manager. If you're not sure what credentials to delete, try deleting all of the vscode specific credentials which all start with  vscode . Here i...

Azurite!

While Azurite is automatically installed with Visual Studio 2022, it's not always the latest version. To keep in control of which version you're running, run it in docker ! Then when Visual Studio tries to start it up, it'll see something's already running on the Azurite ports and use that one instead. Run it with something like the following to persist any data: docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 -v c:/azurite:/data mcr.microsoft.com/azure-storage/azurite

Graphical glitches in WPF apps caused by Nahimic service

 This is a strange one - after upgrading to Windows 11 preview I expected to get a few problems and assumed this was one of them.  Apparently it affects various versions of Windows though and is caused by the "Nahimic service" which I believe came with Sonic Suite and is related to my new Asus motherboard. After setting this service to disabled I no longer get the graphical glitches in applications such as Fork GIT client, Visual Studio Installer and Choco GUI.

Upgrading Ubuntu on WSL

I was looking for a way to install Ubuntu 20.10 over my 20.04 WSL Windows 10 installation. Simply instruct the system to upgrade! sudo sed --in-place 's/Prompt=lts/Prompt=normal/' /etc/update-manager/release-upgrades sudo do-release-upgrade This will update, install missing packages and remove obsolete ones.

Making Microsoft Dataverse OData queries using Postman

Once you have registered your application and have your ClientId and ClientSecret you can use these to authenticate using oauth2 client credentials workflow. Environment Create an appropriate Postman environment with the following variables: url - https://<yourcompanyname>.crm4.dynamics.com clientid - <your clientid> clientsecret - <your clientsecret> version - 9.1 webapiurl - {{url}}/api/data/v{{version}} tenantid - <guid> authurl - https://login.microsoftonline.com/{{tenantid}}/oauth2/v2.0/token Collection Authorization Setup Authorization for your Postman Collection so all the calls within will inherit it and use the token. Set the Type to "OAuth 2.0" Add auth data to "Request Headers" Configure New Token Token Name - "MyToken" Grant Type - "Client Credentials" Access Token URL -  "{{authurl}}" Client ID - "{{clientid}}" Client Secret - "{{clientsecret}}" Scope - "{{url}}/.default...

Getting SSH agent passthrough working with VS code

(Updated 2023-04-24) I had frustrations getting SSH agent passthrough working with VS code such that when I was remoted onto a linux box and working with git, I wasn't able to use the git functions inside code as the auth was failing. Doing the following worked for me at an administrator powershell prompt on your own machine Set-Service ssh-agent -StartupType Automatic Start-Service ssh-agent Once you've got pageant or similar loading your keys then this should all work. You might need to add entries similar to below into your local ssh config file to ForwardAgent yes: Host remotehostname      User yourusername      ForwardAgent yes Also make sure that you've got your ssh identity loaded Use the following to list identities 'ssh-add -l' and the following to add your id_rsa key 'ssh-add ~/.ssh/id_rsa' Troubleshooting "ssh -V" to get the version. Try using "ssh -vT git@github.com" to test the forwarding. Due to bugs in the version of openss...

Removing credentials from your git repo

It happens... Occasionally a file you REALLY didn't want in your git repo is in there and you don't spot it until several days/months/years later! Worst case is that it's some credentials. First thing you do is change any affected systems where credentials may have been inadvertently been exposed. Make a backup of your repo using something like git clone --mirror <repo> Then as per  https://help.github.com/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository   you can remove the offending file. Don't forget the if the path to your file is in a sub-folder to use the correct slash, most likely "/" even on Windows. git filter-branch --force --index-filter \ "git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA " \ --prune-empty --tag-name-filter cat -- --all Then you can push your repo up and overwrite what's there. git push origin --force --all Other users may then have to do the following git fet...