2018-09-21

Right click on Windows folder and open with Visual Studio Code

https://thisdavej.com/right-click-on-windows-folder-and-open-with-visual-studio-code/

Major Edit: It turns out that when you install VS Code for Windows, you have an opportunity to add an “Open with Code” action to the Windows Explorer file context menu—if you don’t hastily sprint through the installation and take the defaults like I did the first time around. 🙂 Take a deep breath and jog rather than scream through the installation. When you see the dialog box below, be sure to check the two checkboxes highlighted.

A. Manually add VSCode shortcuts to context menu when it is installed in C:\Program Files folder

vsCodeOpenFolder.reg
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Program Files\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"%V\""
removeVsCodeOpenFolder.reg
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
[-HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
[-HKEY_CLASSES_ROOT\Directory\shell\VSCode]
[-HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]

B. When Visual Studio Code is installed in C:\VSCode folder

vsCodeOpenFolder_C.reg
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\VSCode\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\VSCode\\Code.exe\" \"%1\""
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\VSCode\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"C:\\VSCode\\Code.exe\" \"%1\""
; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\VSCode\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"C:\\VSCode\\Code.exe\" \"%V\""

2018-07-29

How to Rebuild BCD in Windows

A long day of searching (which is typical) for how to fix the non-booting Windows 10 installation.

Eventually I've found the following procedure, which simply just worked.
The best thing only the Option 1 (the simplest) was necessary in my case :)

  1. Start Advanced Startup Options if you're using Windows 10 or Windows 8.
    Start System Recovery Options if you're using Windows 7 or Windows Vista.
  2. Open Command Prompt from Advanced Startup Options or System Recovery Options menu.
  3. At the prompt, type the bootrec command as shown below and then press Enter:
    bootrec /rebuildbcd
    
    The bootrec command will search for Windows installations not included in the BCD and then ask you if you'd like to add one or more to it.
  4. You should see one of the following messages at the command line.

    1. Option 1
      Scanning all disks for Windows installations.
      Please wait, since this may take a while...
      Successfully scanned Windows installations.
      Total identified Windows installations: 0
      The operation completed successfully.
      
      Option 2
      Scanning all disks for Windows installations.
      Please wait, since this may take a while...
      Successfully scanned Windows installations.
      Total identified Windows installations: 1
      [1] C:\Windows
      Add installation to boot list? Yes/No/All:
      
    2. If you see Option 1: Move on to Step 5. This result most likely means that Windows installation data in the BCD store exists but bootrec couldn't find any additional installations of Windows on your computer to add to the BCD. That's fine; you'll just need to take a few extra steps to rebuild the BCD.
    3. If you see option 2: Enter Y or Yes to the Add installation to boot list? question, after which you should see The operation completed successfully, followed by a blinking cursor at the prompt. Finish up with Step 10 toward the bottom of the page.

Read the whole post:
https://www.lifewire.com/how-to-rebuild-the-bcd-in-windows-2624508

2018-06-11

Safely Remove Unused Kernels In RHEL/CentOS/Fedora

There are three main ways to do it:

  1. Use package-cleanup command from yum-utils
  2. Use Fedora's dnf remove combined with dnf repoquery
  3. Set maximum number of installed kernels in /etc/yum.conf file
First:
# yum install yum-utils
# package-cleanup --oldkernels --count=2
Second:
# dnf remove $(dnf repoquery --installonly --latest-limit 2 -q)
Third:
# vim /etc/yum.conf
installonly_limit=3  #set kernel count

See also:

2018-04-28

Try changing HPET settings to improve your PC's performance

You need to run the following commands on the command line in Windows to enable or disable the exclusive use of the HPET timer.
  • Tap on the Windows-key, enter cmd, right-click cmd.exe in the results listing and select to run the command prompt with administrative privileges.
  • To enable HPET as the only timer run the command:
    bcdedit /set useplatformclock true
  • To disable HPET in Windows run the command:
    bcdedit /deletevalue useplatformclock
https://www.ghacks.net/2013/04/18/try-changing-hpet-settings-to-improve-your-pcs-performance/

AnandTech article about impact of High Performance Event Timer (HPET)
A Timely Discovery: Examining Our AMD 2nd Gen Ryzen Results

Blogger EU Cookie Notice

How to style, change or disable the Blogger EU Cookie Notice
Recently Blogger introduced support for the European Union Cookie Notice. [...]

Read more: https://blog.mridey.com/2015/08/how-to-style-change-or-disable-blogger.html

2018-02-22

The Pros and Cons of Windows 10’s "Fast Startup" Mode

Why You Might Want to Disable Fast Startup

[...] Fast Startup also has its problems, so you should take the following caveats into consideration before enabling it:

  • When Fast Startup is enabled, your computer doesn’t perform a regular shut down. Since applying new system updates often requires a shutdown, you may not be able to apply updates and turn your computer off. Restart is unaffected, though, so it still performs a full cold shutdown and restart of your system. If a shutdown doesn’t apply your updates, a restart still will.
  • Fast Startup can interfere slightly with encrypted disk images. Users of encryption programs like TrueCrypt have reported that encrypted drives they had mounted before shutting down their system were automatically remounted when starting back up. The solution for this is just to manually dismount your encrypted drives before shutting down, but it is something to be aware of. (This doesn’t affect the full disk encryption feature of TrueCrypt, just disk images. And BitLocker users shouldn’t be affected.)
  • Systems that don’t support hibernation won’t support Fast Startup either. Some devices just don’t play well with hibernation. You’ll have to experiment with it to see whether your devices respond well or not.
    When you shut down a computer with Fast Startup enabled, Windows locks down the Windows hard disk. You won’t be able to access it from other operating systems if you have your computer configured to dual-boot. Even worse, if you boot into another OS and then access or change anything on the hard disk (or partition) that the hibernating Windows installation uses, it can cause corruption. If you’re dual booting, it’s best not to use Fast Startup or Hibernation at all.
  • Depending on your system, you may not be able to access BIOS/UEFI settings when you shut down a computer with Fast Startup enabled. When a computer hibernates, it does not enter a fully powered down mode. Some versions of BIOS/UEFI work with a system in hibernation and some do not. If yours doesn’t, you can always restart the computer to access BIOS, since the restart cycle will still perform a full shutdown.
https://www.howtogeek.com/243901/the-pros-and-cons-of-windows-10s-fast-startup-mode/