Windows10 Tips


Windows 10 Tips

  • Bypass Windows 10 lock screen and go directly to login screen
    • Open registry editor (regedit)
    • Navigate to HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft
    • Right-click Windows and select New / Key
    • Enter Personalization and hit Enter
    • Right-click on the right pane and select New / DWORD (32-bit) Value
    • Rename the new DWORD value to NoLockScreen
    • Double click NoLockScreen and assign the value 1 to it

    Alternatively, copy the following text to a file with a .reg extension:

      Windows Registry Editor Version 5.00
    
      [HKEY_LOCAL_MACHINESOFTWAREPoliciesMicrosoftWindowsPersonalization]
      "NoLockScreen"=dword:00000001
        

    Right-click on this file and select Merge

  • Disable Hiberboot
  • More than one Acer Aspire laptop has had problems with screen blacking out or flickering
    after boot. To resolve this issue, you can disable Windows 10 Hybrid Boot or
    Fast boot function. By doing so, you may also increase the life of a solid state
    or M.2 drive, because the O/S RAM will not be dumped to the drive every time you shut
    the computer down.

    • Open registry editor (regedit)
    • Navigate to HKEY_LOCAL_MACHINE / SYSTEM / CurrentControlSet / Control / Session Manager / Power
    • Double click HiberbootEnabled and assign the value 0 to it

    Alternatively, copy the following text to a file with a .reg extension:

      Windows Registry Editor Version 5.00
    
      [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerPower]
      "HiberbootEnabled"=dword:00000000
        

    Right-click on this file and select Merge

  • Hide OneDrive in explorer
    • Open registry editor (regedit)
    • Navigate to HKEY_CLASSES_ROOT / CLSID / {018D5C66-4533-4307-9B53-224DE2ED1FE6}
    • Right-click System.IsPinnedToNameSpaceTree and select Modify
    • Change value to 0 and hit Enter
    • For changed to take effect, you have to close all instances of Explorer and open it again.

    Alternatively, copy the following text to a file with a .reg extension:

      Windows Registry Editor Version 5.00
    
      [HKEY_CLASSES_ROOTCLSID{018D5C66-4533-4307-9B53-224DE2ED1FE6}]
      "System.IsPinnedToNameSpaceTree"=dword:00000000
        

    Right-click on this file and select Merge

  • Optimization tips:
  • Please assess the risk or behaviour that these steps will have on your device first – please see the disclaimer.
    If performance is a real issue for you, then may I suggest that you investigate using a Linux distribution
    to get more performance out of your hardware.

    • To reduce processor usage, disable these services:
    • (Open Services app to make these changes)

      • Superfetch
      • Windows Remediation Service
      • Windows Modules Installer (it does not seem possible to stop this service)
    • Antivirus: (see disclaimer)
    • Open “Window Defender Settings” and press “Open Windows Defender Security Centre”
      Go to “Virus & threat protection” and click on “Virus & threat protection settings”
      Disable all options

    • Microsoft Store:
      • Open “Microsoft Store” and click on menu (“…” – right top) and select “Settings”
      • Disable all options
    • Windows Module Installer
    • For using internet via WiFi connection, follow these steps:

      • Go to Start/Settings/Network/Internet/Wi-FI.
      • Click “Advanced options”
      • Switch on “Set as metered connection”

      For using internet via Ethernet connection, follow these steps:

      • Open regedit and navigate to:
      • HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/NetworkList/DefaultMediaCost
      • Right-click and select “Permissions”
      • Click “Advanced” and change Owner to your user account (press OK when done)
      • Back in “Permissions” dialog, press “Add”, type your user name and press “Check Names”.
      • Give yourself “Full Control” permission.
      • Now change the setting “Ethernet” to 2 (metered connection)

      If metered connection option fails, set the startup type of “Windows Module Installer” service to manual using the Services app.

References:

Disclamer: Anyone using any of these instructions do so at their own risk. Neither the author or anyone or any company related to this site takes any responsibility for effects performing any of the tasks on any device.


Windows Outlook Conversion


Outlook PST Conversion

  • Get PST location
    • Open Outlook
    • Select the account
    • Right-click the account and select Data File Properties
    • Click Advanced
    • Copy the contents of Filename
  • Copy the PST file to a Linux PC
  • Install readpst
  •       sudo apt -y install pst-utils
        

  • Convert PST folders to MBOX files
  •       mkdir out
          readpst -D -b -o out {filename.pst}
        

  • Import MBOX files into Thunderbird
    • Install Thunderbird ImportExportTools NG extension
    • Create a new local folder
    • Right-click the folder and choose ImportExportTools NG / Import mbox file
      • Select Import directly one or more mbox files
      • Navigate to the folder where mbox files are located
      • Select all mbox files
      • Press Open



Vscode Unit Tests



Debugging javascript running in Chrome using VSCode

Installation steps:

  • Install mocha NPM module
  •         npm install
            npm install mocha chai --save-dev
            sudo npm install -g mocha
          
  • Install Debugger for Chrome plugin in VSCode
  • Copy the node_modules/mocha folder to your public (or public/lib) folder
  • Copy the node_modules/chai folder to your public (or public/lib) folder
  • Include mocha in the page you want to debug
  •         <html>
              <head>
                <link rel="stylesheet" href="lib/mocha/mocha.css">
              </head>
              <body>
                <script src="lib/mocha/mocha.js"></script>
                <script src="lib/chai/chai.js"></script>
                <script>mocha.setup('bdd')</script>
                <div id="mocha">
                </div>
                <script>
                  mocha.run();
                </script>
              </body>
            </html>
          

You can use chai to run unit tests in NodeJS application by including chai and using mocha to run tests

    # Include this in the script you need to debug
    var chai = require('chai')
  

References:


VSCode Chrome Debugging



Debugging javascript running in Chrome using VSCode

Installation steps:

  • Install mocha NPM module
  •         npm install
            npm install mocha chai --save-dev
            sudo npm install -g mocha
          
  • Install Debugger for Chrome plugin in VSCode
  • Create a launcher (edit launch.json)
  •       # In this example, the nodejs server is running on port 1337
          # The page to open is mypage.html located in public folder of the workspace
          {
            "version": "0.2.0",
            "configurations": [
              {
                  "name": "chrome debug",
                  "type": "chrome",
                  "request": "launch",
                  "url": "http://localhost:1337/mypage.html",
                  "webRoot": "${workspaceFolder}/public",
                  "smartStep": true
              }
            ]
          }
        
  • Launch the launcher you created
  • Set up breakpoints (breakpoints seems to be lost between lanches)
  • Activate code to debug from button click or other event in web browser

References:


Static USB Device Name


Static USB device name

When a device name is important (e.g. a line printer device such as /dev/usb/lp1), the
name could cause problems when multiple devices could change the device name sequence
at boot time or when devices are plugged or unplugged. The UDEV subsystem provides
a way to statically name these devices or symlinks to it.

It is recommended to specify static symlinks rather than device names in order to
avoid blocking adding devices if names already exists.

In modern versions of Linux, udev rules replaces the need for usb_modeswitch. In stead
if editing files in /etc/usb_modeswitch.d, you have to add configurations in
/etc/udev/rules.d.

  • Find the USB vendor and product IDs
  •       lsusb
          # or if you cannot recognise the USB device, but you know the current device name
          udevadm info -a -p  $(udevadm info -q path -n /dev/usb/lpX) | grep -B 3 -A 3 idVendor
          # Replace /dev/usb/lpX with the actual device number
        
  • Add a UDEV device ADD rule by editing /etc/udev/rules.d/10-local.rules and adding the following:
  •       ACTION=="add", ATTRS{idVendor}=="1504", ATTRS{idProduct}=="003d", SYMLINK+="pos"
          # Change vendor, product and name of symlink
          # In this example, plugging in a POS printer creates a device symlink /dev/pos
        
  • Refresh UDEV rules without rebooting
  •       udevadm control --reload-rules
          udevadm trigger
        
  • Unplug the device, wait a few seconds and plug it in again
  • Verify that symlink exists
  • Change application configuration
  •       # For example, change CUPS printer
          service cups stop
          # Edit /etc/cups/printers.conf and change the line printer device URL to your symlink:
          # e.g. DeviceURI parallel:/dev/pos
          service cups start
        

References:

http://www.reactivated.net/writing_udev_rules.html#external-naming
https://unix.stackexchange.com/questions/66901/how-to-bind-usb-device-under-a-static-name
https://unix.stackexchange.com/questions/39370/how-to-reload-udev-rules-without-reboot