Sunday, January 29, 2023

Microsoft Edge Settings and Flags to boost performance : Part 2


Microsoft Edge Settings and Flags to boost performance : Part 2

Microsoft Edge on Windows Setting Tweaks

Microsoft Edge on Windows Performance Tuning : Adjust Settings to increase performance and reduce IO/CPU load on Windows 10+

The majority of users merely use the standard functionality of the Microsoft Edge browser instead of exploring the many valuable choices and enhancements that are available. You should set aside some time to explore the fantastic capabilities of the Edge browser that are concealed behind settings. Use the Microsoft Edge web browser on platforms including desktop, laptop, Android, and iOS mobile phones.

Click the "three dots" in the top right corner of the screen to access Microsoft Edge settings.

Use Find (Ctrl + F or F3) in the top right corner of the browser, enter your search term, and hit enter to find it. 

Optimize Memory Usage and Battery Consumption of Device

Sleeping Tabs and Efficiency Mode | Two Ways for Boosting Device Performance

Microsoft Edge provides two main ways for improving performance of your device; Sleeping Tabs and Efficiency Mode.

Through both settings, Edge releases trapped memory resources for tabs which are inactive for some time and thus saving battery. You can control this time (for Edge action) in performance settings; say 15 minutes, 30 minutes, or some hours. However, when you turn ON the Efficiency Mode, the browser automatically activates Sleeping Mode relatively fast; say around 5 minutes after there is no activity in the tab.

When a tab becomes faded, it means, it has released CPU resources which now can efficiently be used somewhere else, where they are needed most, for example some media editing software. It is very useful when you have opened multiple webpages of websites, and you are busy in some specific website opened in a tab; so, browser will still utilize CPU and energy resources for the tab where a webpage is visible, but it will release resources for the tabs, you are not interacting with since some time.

On the other hand, Chrome does not provide such optimizations and may use excessive battery power as noted by a Chrome user in this support page.

How Much Memory and CPU Resources Are Saved by Sleeping Tabs?

Just hover mouse over any sleeping tab and it will display the information telling you the amount of memory and processing resources it saved. It is quite beneficial for the working and performance of your device.

According to a recent official Windows article:

On average, each sleeping tab saves 85% of memory and 99% CPU for Microsoft Edge.”

How to Access Efficiency Settings in Edge Browser?

Clicking the Heart symbol in the toolbar of Edge browser. To control settings for Sleeping Mode and its time intervals, click Heart symbol and then select three dots (ellipsis) in small window and select ‘manage performance settings’.

You can also access those settings by clicking three dots in top right corner of web browser, then Settings and System and Performance.

For Which Devices Efficiency Mode Should be Activated?

No need to activate Efficiency Mode for desktop computer (connected through mains supply). For desktop computer, it is enough to just activate Sleeping Tabs for efficient utilization of resources. However, you can activate Edge Efficiency Mode for all other battery-operated devices such as laptops.

Tracking Prevention

  • I have turned ON the toggle button next to ‘Tracking prevention’ option.


Privacy

  • I have turned ON the toggle next to ‘Send "Do Not Track" requests’ option.

Diagnostic Data

  • Turn OFF the ‘optional’ diagnostic data.

  • However, you can turn OFF this optional diagnostic data. You will have to restart your computer for this change. You can do this through your Windows computer settings: Click StartSettingsPrivacyDiagnostics and feedback → under diagnostic data select on ‘Required diagnostic data’ to turn OFF the optional diagnostic data sharing. To Access the same settings in Microsoft Edge mobile browser, click ‘three dots’ (…) on bottom of phone screen, Settings → Privacy and security → Diagnostic data.

Search and Service Improvement Data

  • I don’t mind turning the button OFF next to ‘Search and service improvement’ option. It is

Personalize your web experience

  • I have turned OF the toggle button next to this option so that Microsoft does not show me relevant ads.

Enhance Performance and Speed of Edge Browser

SettingsSystem and performance.

Steps to Improve Performance and Speed of Microsoft Edge Browser

Watch Video on YouTubeBoost Performance and Speed of Microsoft Edge

Follow these steps to improve speed and performance of Microsoft Edge.

  • Preload pages for faster browsing and searching’ = ON.

  • Preload the new tab page for a faster experience = ON

  • Continue running background extensions and apps when Edge is closed = OFF

  • Turn ON the Startup Boost.

  • Turn ON the

  • ‘Save resources with sleeping tabs’ and ‘Fade sleeping tabs’.

  • Use hardware acceleration when available’ = ON

  • If Edge is slow or often crashes, TURN THIS OFF.

  • Turn on efficiency mode: OFF else Battery = ON I keep it turned OFF on my computer. However, if you are using a battery-operated device like a laptop, you can turn it ON.

  • Put inactive tabs to sleep after the specified amount of time: = 15


Preload Pages and Startup Boost in Microsoft Edge

Watch Video on YouTubePreload Pages and Startup Boost in Microsoft Edge. Should You Enable It?

Preload pages for faster browsing and searching. = OFF

edge://settings/system’ / Startup boost = OFF

For faster web browsing, user should also turn ON the toggle next to ‘Preload the new tab page for a faster experience’ option. This tweak can be accessed by typing or pasting (edge://settings/startHomeNTP) link in Edge browser.

For faster page loading, based on predictive preloading in background, you can also turn ON the ‘Startup Boost’ feature in Edge browser, by entering ‘edge://settings/system’ in Edge and hitting ‘Enter’ and then toggling ON the button next to ‘Startup boost’ option.

Should You Turn ON ‘Startup Boost’ and ‘Preload Pages’ in Edge Browser?

Normally, I prefer to keep the ‘Startup Boost’ and ‘Preload Pages’ options turned ON in Edge browser for faster browsing experience.

However, please keep in mind that though limited, this feature uses memory resources (RAM, SSD or HDD) as well as internet data for preloading of webpages in background.

Therefore, if you have limited data package, then you can turn it OFF.


How to Keep a Website Activated Always in Edge Browser?

Edge browser has great feature of sleeping tabs to save CPU and data resources from inactive tabs.

However, we do not want some important websites to sleep after a set time. You can tell those websites to your Edge browser in settings through below navigation path.

Click Three Dots for ‘Settings and More’ (or press Alt+F) in top right corner of Edge browser → SettingsSystem and performanceOptimize PerformanceNever put these sites to sleep.

Here you can enter URLs of websites which you want always active to get continuous notifications

Settings : Quiet notification requests

How to Hide/Show Performance Button in Microsoft Edge?

SettingsAppearanceSelect which buttons to show on the toolbar:Performance Button.

To access settings for enhancing performance and efficiency of your device, you can hide or show the ‘Performance button’ by toggling it in settings of Edge browser.

Performance enhancement means that Microsoft Edge browser saves both memory (CPU) and battery consumption of the device. When you turn ON the performance button, it appears on the right side of address bar in toolbar. It looks like a heart filled with pulse symbol.

Fix the New Tab page

By default, Edge’s New Tab page looks a lot like MSN of yore, sporting a bunch of news, ads, and promoted links. This clutter may potentially be a source of reduced performance in Microsoft Edge.

Open a new tab in Microsoft Edge and click the gear icon in the top-right corner of this page. Now, use the following settings:

  • Layout: Focused
  • Quick links: Off
  • Background: Off
  • Show greeting: Off
  • Office sidebar: Off
  • New tab tips: Off
  • Content: Content off

Other Settings

  • edge://flags/#enable-system-notifications = disabled
  •  edge://flags/#enable-quic =  disabled (privacy) enabled (speed)
    • Be aware that DoDo wants this OFF
  • edge://flags/#disable-accelerated-video-decode and 
  • edge://flags/#disable-accelerated-video-encode
If you get menus and dialog boxes not rendering correctly, a green screen appears when playing a video on Microsoft Edge, or there are rendering issues on a virtual machine, disabling hardware acceleration can resolve the problem

  •       edge://flags/#edge-global-media-controls =  enabled
  •       edge://flags/#enable-parallel-downloading =  enabled
  •       edge://flags/#smooth-scrolling = enabled
  •       edge://flags/#back-forward-cache = enabled
  •       edge://flags/#edge-experimental-tracking-prevention-features = enabled

---------------------

Disable or Replace ntp.msn.com

The exact URL, which is called every time you open a new tab, is ntp.msn.com. Unlike Google, Edge Chromium doesn’t offer any local page, which would load a lot faster. However, you can block the URL  via the Host file. Follow our guide on how you can edit the Hosts file,

Do this and then navigate to edge://settings/onStartup and then add about:blank against Open a specific page or pages under On Startup settings.



Some More Interesting Tweaks of Favorites in Edge Browser

Click on ‘Favorites’ + click ‘three dots’ : options such as importing favorites from another browser or removing duplicate links from favorites.

In the Favorites Bar, you can right-click any folder to see more interesting options; for example, you can open all Favorites links at once in a window.

In Favorites Bar, click any folder, then hover your mouse on any link and then right-click and you will see many useful options such as to edit, copy, cut or delete a specific link from the favorites.

---------------------

Monday, August 22, 2022

How to filter Bing results by Date? The Date filter is missing on bing, here is a work-around

 

Intro:

On bing.com can I filter the All results by Date using the UI?

More Information:

I have used bing.com from Edge Chromium, Edge Mobile, Google Chrome, logged into MS365 and logged out and in a private window.

The result is the same: I am unable to filter search results by date using the UI, the “Any time” drop down is gone.

Question:

Is there any solution besides tweaking the query string or adding special condition to a search?

Can we get the "Any time" drop down returned to the Bing search screen for All?

I would love to use Bing but without a Date filter feature that at least mimics Duckduckgo or at best matches google there is NO way I would ever recommend Bing for the business or home.

Solution:

From below Attempted Workarounds:
1) Add ‘Narrow by Date’ query sting params to url : 
&tbs=qdr:y
with:
 6) Add narrow by date to default search engine:
{bing:baseURL}search?q=%s&tbs=qdr:y&{bing:cvid}{bing:msb}

Attempted Workarounds

Here are the options that I have currently tried , I am personally using option 1 with 6 but it works for only my general searches. When I need something narrower like “Last Month” I have to tweak the url again.

 

1) Add ‘Narrow by Date’ query sting params to url

                last day

                &tbs=qdr:d

                or year

                &tbs=qdr:y

                Only date param that seems to use DatePublished and mimics duckduckgo / google functionality

                

 

               

2 ) Add Freshness (not same as datePublished)

                freshness=week

                freshness=2021-08-23..2022-08-23

                This is useless because freshness as design "Freshness refers to the date that Bing originally discovered the webpage, not when the publisher published the webpage." per MS

               

3) Adding datePublished to search (not sure what this does, does not seem to work)

                eg: datePublished=YYYY-MM-DD

4) Adding date range to search value: (doesn’t work)

                eg  "test search" (Jan. 1 - Feb 18)

5) Some unrelated setting? (doesn’t work)

                On the Worldwide screen, select “United States English”. For their own reasons, Bing only supports search-by-date in the United States.

                https://www.oyetimes.com/lifestyle/technology/52485-how-to-enable-bing-search-by-date

 6) Add narrow by date to default search engine:

{bing:baseURL}search?q=%s&tbs=qdr:y&{bing:cvid}{bing:msb}






Using narrow by Date results

 Appendix: Compare results with and without &tbs=qdr:y

 

With Narrow by Date


 

Without narrow by date









Friday, August 19, 2022

VS Code : Improve Load Time, Performance, Build and Debugging Speed

 

 

 

Here's How to Make VSCode Faster

So for some reason your VSCode is slow. Really slow. How are you supposed to be productive when the program is running at snail speed? I'm going to show you how to fix this and make VS Code faster.

VS Code Settings to tweak: 

1.     Minimap

a.     "editor.minimap.enabled": false,

Controls whether the minimap is shown I’ve set it to false. In my opinion, it creates visual clutter rather than actually help me while working in a file.

2.    editor.linkedEditing — Editor: Linked Editing

a.     "editor.linkedEditing": true

I’ve set it to true. As someone who likes to do frontend development, I work with HTML templates a lot. 

3.     Breadcrumbs thumbnails

a.     "breadcrumbs.enabled": false

not use the fancy settings editor, you can manually add this to your configuration: 

4.    Soft Preview

a.     "workbench.editor.enablePreview": false

Disable single click soft preview file, this creates a preview window with any single-click in vs code solution explorer.

5.    Whitespace render:

a.     "editor.renderWhitespace": "all"

See whitespace usage.

6.    Code bracket readability

a.     "editor.bracketPairColorization.enabled": false,

"editor.bracketPairColorization.independentColorPoolPerBracketType": true

Improve code readability to improve productivity.

7.         Simple file dialog

a.     "files.simpleDialog.enable": true

Open file with in-app dialog

8.    Powershell and editor optimized settings:

a.     https://youtube.com/clip/UgkxJtWpfn9krX_U5U-KlZDjmM9PAlTeqtSG

9.    Window Title

"window.titleSeparator": " |",

    "window.title": "${dirty}${remoteName}${separator}${rootName}${separator}${activeEditorShort}${separator}${appName}"

    Controls the window title based on the active editor. Variables are substituted based on the context:

10.                       workbench.tips.enabled

a.     "workbench.tips.enabled": false

Disable the tips on load

11. debug.openExplorerOnEnd

a.     "debug.openExplorerOnEnd": true

12.                        Telemetry might impact performance.

a.     "telemetry.telemetryLevel": "off"

13.                        Disable Search on Type.

a.     "search.searchOnType": false

14.                        Stop Notifications

a.     "update.showReleaseNotes": false,

b.        "workbench.enableExperiments": false

15.                        Optional:

a.     CodeLens Disable

b.    Mindmap on/Off

c.     Terminal GPU Acceleration

d.    Extension Load times: You can easily monitor the startup time of all those plugins by executing cmd + p > Developer: Show Running Extensions.

 

 

 

All the user settings in json:

 "vsicons.dontShowNewVersionMessage": true,
    "editor.minimap.enabled": false,
    "editor.linkedEditing": true,
    "breadcrumbs.enabled": false,
    "workbench.editor.enablePreview": false,
    "editor.renderWhitespace": "all",
    "editor.bracketPairColorization.independentColorPoolPerBracketType": true,
    "files.simpleDialog.enable": true,
    "debug.onTaskErrors": "debugAnyway",
    "diffEditor.ignoreTrimWhitespace": false,
    "files.hotExit": "onExitAndWindowClose",
    "workbench.startupEditor": "none",
    "files.autoSaveDelay": 10000,
    "files.autoSave": "afterDelay",
    "editor.snippetSuggestions": "bottom",
    "editor.suggest.snippetsPreventQuickSuggestions": false,
    "editor.tabCompletion": "on",
    "update.enableWindowsBackgroundUpdates": false,
    "window.newWindowDimensions": "maximized",
    "window.titleSeparator": " |",
    "window.title": "${dirty}${remoteName}${separator}${rootName}${separator}${activeEditorShort}${separator}${appName}",
    "workbench.tips.enabled": false,
    "debug.openExplorerOnEnd": true,
    "telemetry.telemetryLevel": "off",
    "search.exclude": {
        "": true
    },
    "files.exclude": {
        "**/node_modules": true
    },
    "editor.bracketPairColorization.enabled": false,
    "search.searchOnType": false,
    "extensions.ignoreRecommendations": true,
    "update.showReleaseNotes": false,
    "workbench.enableExperiments": false

   

 References:

https://bit.ly/3QCrQjR

https://bit.ly/3K3zYaS

https://bit.ly/3QwmxT8

https://bit.ly/3c6dGbT

https://bit.ly/3QCR9CC

https://bit.ly/3QDeTq2

https://bit.ly/3pxaV6o

Azure Microsoft Graph Explorer Permissions : How to resolve "Application must have one of the following scopes" Error

Symptoms: 

When using the MS Graph Explorer in Azure: 

Summary:

Resolving the error "Application must have one of the following scopes"  when accessing the GraphAPI


Detail: 

If you receive an error with the following substring part in the error message:

"Application is not authorized to perform this operation."

and/or

"Application must have one of the following scopes:"

When accessing the service url : https://graph.microsoft.com/beta/deviceManagement



An example response:

 {

    "error": {
        "code": "Forbidden",
        "message": "{\r\n  \"_version\": 3,\r\n  \"Message\": \"Application is not authorized to perform this operation. Application must have one of the following scopes: DeviceManagementConfiguration.Read.All, DeviceManagementConfiguration.ReadWrite.All - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: 5c977c7f-ae03-4be0-82c2-408eafb65caf - Url: <https://fef.msub05.manage.microsoft.com/DeviceConfiguration_1911/StatelessDeviceConfigurationFEService/deviceManagement?api-version=5019-09-20>\",\r\n  \"CustomApiErrorPhrase\": \"\",\r\n  \"RetryAfter\": null,\r\n  \"ErrorSourceService\": \"\",\r\n  \"HttpHeaders\": \"{}\"\r\n}",
        "innerError": {
            "request-id": "5c977c7f-ae03-4be0-82c2-408eafb65caf",
            "date": "2019-11-15T18:53:00"
        }
    }
}

Resolution:

  1. Sign in to the Azure portal, go to Azure Active Directory > Enterprise Applications, and then select Graph explorer from the list of applications. For example for me : Enterprise Application is at this url 



  2. Click "Graph Explorer"

  3. Click Permissions



  4. Search for, Add and then Grant the permission that we want Graph Explorer to execute without error:



  5. With our permission added, we can now execute without error:


  6. Execute:



Sunday, July 17, 2022

Utility Powershell and Dos Commands: Save Output and Commands to file, Get Versions, Get Folder, Update Common Packages

 ###########################  
 # Write output and commands to text file DOS and PS  
 #########################  
 REM Check Version of spfx related packages and save to a file  
 node --version >> C:\temp\Logs\cmdPrompt.log  
 npm --version >> C:\temp\Logs\cmdPrompt.log  
 pnp --version >> C:\temp\Logs\cmdPrompt.log  
 yo --version >> C:\temp\Logs\cmdPrompt.log  
 gulp -v >> C:\temp\Logs\cmdPrompt.log  
 nvm ls >> C:\temp\Logs\cmdPrompt.log  
 choco --version >> C:\temp\Logs\cmdPrompt.log  
 type C:\temp\Logs\cmdPrompt.log   
 REM save command output to a file and command error output STDERR and STDOUT  
 choco --version 1>> C:\temp\Logs\cmdPrompt.log 2>&1   
 REM View file in cmd  
 type C:\temp\Logs\cmdPrompt.log   
 REM Save commands to append to a file  
 doskey /history >> C:\temp\Logs\cmdPrompt.Commands.log  
 REM Copy the Command Output to Windows Clipboard  
 REM ould copy the details of your network connections to the clipboard:  
 ipconfig /all | clip  
 REM opy the contents of a folder to the clipboard  
 dir | clip  
 # Powershell save commands + output  
 # ps output to a file, output to a text file with PowerShell on Windows 11 or Windows 10,   
 ipconfig | Out-File -FilePath C:\temp\Logs\cmdPrompt.log  
 #view the saved output on the screen  
 Gt-Content -Path C:\temp\Logs\cmdPrompt.log  
 # saving BOTH the commands you type AND all their output? I'm not talking about piping the output of any one to a file, like above. Instead, this is about the PowerShell Start-Transcript cmdlet. Try it out some time:  
 Start-Transcript  
 # Without any parameters, the transcript will be saved in the user’s documents folder, filename will automatically be generated and consists of the device name, random characters  
 #e.g:   
 # c:\users\name\documents\PowerShell_transcript.DEVICENAME.qp9EOTN2.20220301132612.txt  
 # Start recording  
 Start-Transcript  
 # stop recording  
 Stop-Transcript  
 # start options  
 # Append to a log file.  
 Start-Transcript -Path C:\temp\Logs\cmdPrompt.log -Append  
 #use -NoClobber prevent overwriting file  
 Start-Transcript -Path C:\temp\Logs\cmdPrompt.log -NoClobber  
 # -OutputDirectory parameter. This way we can specify the directory where we want to store the log file  
 Start-Transcript -OutputDirectory C:\Temp\Logs  
 # Result:  
 Transcript started, output file is C:\Temp\Logs\PowerShell_transcript.WIN11-LAB02.uftVAXsv.20220301045218.txt  
 # limit the header information to only a timestamp o  
 Start-Transcript -OutputDirectory C:\Temp\Logs -UseMinimalDeader  
 # E.g:  
 **********************  
 PowerShell transcript start  
 Start time: 20220301135543  
 **********************  
 # See also: https://itluke.online/2019/03/24/what-is-captured-with-powershell-transcripts/ for Verbose+Debug levels  
 # See also: https://4sysops.com/archives/powershell-transcript-record-a-session-to-a-text-file/  
 ###########################  
 # Get Versions  
 #########################  
 # PS get version of Spfx imprtant packages  
 node --version   
 npm --version   
 pnp --version   
 yo --version   
 gulp -v   
 nvm ls   
 choco --version   
 winget --version  
 # get version of Powershell  
 host  
 # or  
 $PSVersionTable  
 $PSVersionTable.PSVersion  
 # get the value of the PowerShellVersion parameter in the registry key   
 (Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine -Name 'PowerShellVersion').PowerShellVersion  
 #Version of PowerShell on Remote Computers  
 Invoke-Command -ComputerName 192.168.1.15 -ScriptBlock {$PSVersionTable.PSVersion} -Credential $cred  
 # get version of .Net + .Net Core  
 # versions of the .NET SDK are currently installed with a terminal  
 dotnet --list-sdks  
 (dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'sdk')).Name  
 # which versions of the .NET runtime   
 dotnet --list-runtimes  
 (dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'shared\Microsoft.NETCore.App')).Name  
 # dotnet core installed runtimes and SDKs, as well as some other info:  
 dotnet --info  
 # .NET Framework   
 # get from https://github.com/jmalarcon/DotNetVersions/releases save to C:\Windows\System32 or PATH  
 dotnetversions -b  
 # security updates and hotfixes that are installed on a computer using PowerShell:  
 $DotNetVersions = Get-ChildItem HKLM:\SOFTWARE\WOW6432Node\Microsoft\Updates | Where-Object {$_.name -like  
  "*.NET Framework*"}  
 ForEach($Version in $DotNetVersions){  
   $Updates = Get-ChildItem $Version.PSPath  
   $Version.PSChildName  
   ForEach ($Update in $Updates){  
     $Update.PSChildName  
     }  
 }  
 # Get CLR versions  
 # displays all the versions of the CLR installed on the computer. dl Clrver.exe (CLR Version Tool)  
 clrver   
 # get version of VS Code / Visual Studio   
 code --version  
 nuget help | select -First 1  
 dotnet nuget --version  
 # change based on version to be checked  
 (Get-Item "${env:ProgramFiles(x86)}\Microsoft Visual Studio 11.0\common7\ide\devenv.exe").VersionInfo.ProductVersion  
 # get paths to GAC  
 gacutil.exe -l  
 # get version of PnP  
 # get version of Spfx  
 REM DOS Get   
 Version of spfx related packages and save to a file  
 node --version >> C:\temp\Logs\cmdPrompt.log  
 npm --version >> C:\temp\Logs\cmdPrompt.log  
 pnp --version >> C:\temp\Logs\cmdPrompt.log  
 yo --version >> C:\temp\Logs\cmdPrompt.log  
 gulp -v >> C:\temp\Logs\cmdPrompt.log  
 nvm ls >> C:\temp\Logs\cmdPrompt.log  
 choco --version >> C:\temp\Logs\cmdPrompt.log  
 type C:\temp\Logs\cmdPrompt.log   
 ###########################  
 # Get Install Folders  
 #########################  
 # get install location of powershell  
 ###########################  
 # Update ps, choco,   
 #########################  
 #update ps core  
 iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"  
 # or   
 winget install PowerShell  

Thursday, July 7, 2022

Convert Gif to MP4 via ffmpeg

The below command can be used to convert a GIF to an MP4 using the pre-requsite ffmpeg app on Windows:


1. Open notepad, create a bat file : e.g: "fmpg.bat" 

2. Add the following : replace paths as needed:

 cd [PathToFFMpeg]\FFMpeg\bin

echo fn %~n1

echo INFILE- %1

echo OUTFILE- [PathOutput]\%~n1.mp4

ffmpeg -i "%1" -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" [PathOutput]\%~n1.mp4


Usage:

fmpg "C:\MyGifs\1.gif"

Example: