Windows, VS Code, Git and SSH Authentication with passphrases

Have you spent the past several hours frantically searching the web for a solution of integrating Git with VSCode? Are you tempted to remove passphrases from your SSH Key just to get around Permission denied (publickey) errors every time you try and clone a repo?

Yes, it is disappointing that there is no clear documentation for this.
Hopefully, this will fill the gap.

Pre-requisites

Windows 10
Git installed
VSCode installed
Created an SSH key using the Git terminal and is passphrase protected.
Added your SSH public key to your chosen Git Service.

Solution

Before starting VSCode, open up a new Windows CMD window.
Enter the command: start-ssh-agent and you will be prompted to provide the passphrase to your SSH Key.

cmd start-ssh-agent
start-ssh-agent

Now you will be able to open VSCode and clone into your repository.

Automation

If you wanted to automate start-ssh-agent and open VSCode at the same time, I have built a batch script that will do just this.

Open text editor and paste in the code below. Save file as VSCode_ssh-agent.bat

I decided to place this file in my Windows home directory. On the Desktop, I created a shortcut to the .bat file and set the icon to point to:

C:\Users\[USER]\AppData\Local\Programs\Microsoft VS Code\Code.exe

The final result:

  1. Check if SSH-AGENT is running.
    If not, start SSH-AGENT and ask for the passphrase for your key.
  2. Start VSCode

Slow/Laggy/Poor graphics performance: Linux Guest VirtualBox 6.0

I have spent many an hour trying to figure out why VirtualBox 6 has given me terrible graphical performance on Linux Guests. I’m going to give you a no-mess solution that just might save your sanity.

Within the Settings for Your Virtual Machine, navigate to the Display > Screen tab.
Under the Graphics Controller dropdown, select VMSVGA for your Linux guest.

Next, you will need to boot into the virtual machine and reinstall the VBOX Guest Additions for this to work (and cement it in with the obligatory reboot)

So you may be wondering why or when you might need to use this guide?
You may have upgraded to VB6 from VB5 or earlier and trying to use a pre-existing VM.
You may have installed VB6 for the first time, created and installed a new Linux guest VM and experienced graphical slowness.
You may have tried (mostly) every setting within VBOX and viewed every forum post on the internet regarding VB performance issues and have got no further.

Admittedly, I was incredibly close to giving up altogether with VBOX 6 and going back to VBOX 5 as I have been struggling with this since VBOX 6 release. Finally, I have my VM back =)

Have you been compromised?

If you ever wanted check if your login email/username credentials have ever been hacked or breached, you might be in luck! (or unluck in some cases…)

haveibeenpwned.com is a website that will check against known data-breaches from many major websites, or “pastes” from hackers who have compromised data and pasted the credentials publicly.
It will also notify you about the type of data that has been leaked, which is important to know.

By now, people should be using the approach of using a strong, unique password for every different account / service that they sign up for, but more often then not, this is not the case.

If you don’t follow these practices, it might be time to start thinking about it; otherwise 1 databreach can quickly lead to many.

Adding desktop shortcuts in Ubuntu 18.04

I like having my desktop filled with shortcuts to programs that I regularly use. In Ubuntu 18.04, there is a lack of a “right click > add shortcut to desktop” option. If you are missing this option too, don’t fret! There is another way to do just that.

In the Terminal, navigate to:

/usr/share/applications/

If you list all files with ls, you will see many different .desktop files each of which houses the information for executing a program. It also tells the UI where to find the icon that it should display.

Find the program that you wish to add to the desktop (you should find it here if it is installed through apt and it is a GUI application)

Copy the .desktop file to your own Desktop folder:

cp /usr/share/applications/<app>.desktop /home/<user_name>/Desktop/<app>.desktop

Next we need to make the desktop file executable:

chmod +x /home/<user_name>/Desktop/<app>.desktop

Now looking at the desktop, you should see your copied .desktop file.

ubuntu 18.04 desktop shortcut
ubuntu 18.04 desktop shortcut

Double clicking on the file will bring up a prompt, warning that the program is untrusted. Click “Trust and Launch”

ubuntu desktop 18.04 launch application
Ubuntu 18.04 desktop launch application

Once accepted, the application should launch as normal. Close it down, and you should now see the once .desktop file changed into an icon launcher as intended!

ubuntu 18.04 desktop shortcut 2
ubuntu 18.04 desktop shortcut

Changing Pagefile (Virtual Memory) settings in Windows 10

The Pagefile is a file used by Windows that is kept on the hard-drive. Pagefile is also known as Virtual Memory. It acts as an additional cache for things that might be kept in RAM, but stored this way because either RAM is too full or the data might be needed to made persistent.

If you frequently run out of RAM, increasing the pagefile will help to keep your programs running properly could stop crashes caused by low memory.

Some things you need to know

  • Data stored in the in the Pagefile is not optimal as hard-drives are much slower to access then in physical RAM.
  • Important: Pagefile/Virtual Memory is not recomended on SSDs as the file can be written to and read from fairly frequently and can cause premature wear on the drive. If you’re not worried about wear, you may still set a page file.
    You may also move the pagefile to a mechanical drive or set the file to a static amount.
    Also to note: as SSD tech matures, the agility of flash increases thus lowering potential wear.

Changing the settings

Use Cortana to search for “Advanced system settings“:

Search Cortana: advanced system settings
Search Cortana: advanced system settings

Clicking into Advanced system settings will bring up the “System Properties” view. In the “Advanced” tab, click “Settings…” under the “Performance” section:

System Properties: Advanced
System Properties: Advanced

This will bring up the “Performance Options” view. Continue to the pagefile settings by clicking “Change…” under “Virtual Memory” in the “Advanced” tab:

Performance Options: Virtual Memory
Performance Options: Virtual Memory

Lastly, you should be presented with the “Virtual Memory” view where you will be able to control your pagefile settings:

Virtual Memory view
Virtual Memory view

You can set a static size, move the pagefile to another drive or simply let Windows take control of the virtual memory with dynamic allocation.