Zhixian's Tech Blog

2019-01-12

Installing PowerShell Core

Filed under: computing, software, windows — Tags: , , , — Zhixian @ 23:42:01 pm

This blog post is a reminder to myself on the installation process for PowerShell Core.

What is PowerShell Core?

PowerShell Core is a version of PowerShell based on .NET Core.
The idea is to bring PowerShell across to platforms other than Windows (for example Linux, and macOS).

Images of PowerShell Core Installation (for Windows)

The installer for PowerShell Core can be found at https://github.com/PowerShell/PowerShell.

If you browse to this page, you’ll see the Windows Installer somewhere on the middle of the page.

image

After you clicked on the link, an installation file should be downloaded to your computer.
After the file has finish downloading, you should see the downloaded file which is named something like “PowerShell-<version>-<platform>.msi”.

image

Double-clicking the file will start the installation process.
After the installation process startup, you will see a screen like the below.
Click on the “Next” button to proceed with the installation process.

image

After you clicked on the next button, you will come to the “End-User License Agreement” dialog.
Checked on the “I accept the terms in the License Agreement” checkbox.
Click on the “Next” button to proceed with the next step of the installation process.

image

After you clicked on the “Next” button, you will see the “Destination Folder” dialog.
You can choose to change the installation location of the PowerShell Core, if you would like to install it to a location other than its default (which is “C:\Program Files\PowerShell\”).
After you set the location, clicked on the “Next” button to proceed with the next step of the installation process.

image

After you clicked on the next button, you will see the “Optional Actions” dialog.

Accept the default checked items, and clicked on the “Next” button to proceed.

image

After you clicked on the next button, you are finally ready to install PowerShell Core.
Click on the “Install” button to proceed with the installation.

image

After you clicked on the install button, the installation process will install PowerShell Core.

image

After the installation is complete, you will see a screen like the below.
Click on the “Finish” button to complete the installation process.

image

After closing the installation dialog, you can run PowerShell from Windows Start Menu by clicking on the item labeled “PowerShell 6 (x64)”.

image

This is bring up the PowerShell Core command-line shell.
Type “$PSVersionTable” on the command-line to see the version of the PowerShell that you are running.

Things to note are PSVersion and PSEdition.
PSEdition should read “Core” and PSVersion should report the version of PowerShell Core that you are running.

image

At this point, if you see a screen like the above, it means you have a running copy of PowerShell Core.

Advertisements

2019-01-09

Fixing Open Live Writer HTML styles toolbar

Filed under: computing, software, windows — Tags: , , , — Zhixian @ 22:59:01 pm

This blog post relates to fixing HTML styles toolbar of a Windows blogging application call Open Live Writer.   

Disclaimer: This is not a foolproof or perfect fix. I only encounter this on a new installation in a new PC lately.
I do think this issue is highly related to the CSS theme used in the blog.
However, it remains unclear as to what is the actual cause of this problem. This issue has been reported in GitHub here.

Symptoms

After you installed Open Live Writer, you may notice that the HTML styles portion of the toolbar looks like the following:

open-live-writer corrupted HTML styles toolbar

Solution

There is no official solution for fixing this issue.
But you may be able to get rid of those blocks overlaying the HTML styles.

Disclaimer: This is not the correct solution. It merely provides a way to get rid of the blocks.

Assumptions

I assumed:

  1. You know how to run Windows File Explorer and know how to navigate to a folder location.
  2. You know how to download a zip file.
  3. You know how to extract files from a zip file.
  4. You know how to make backup copies of files.

Steps overview

  1. Download a dummy set of HTML style images from the zip file (Open-Live-Writer HTML Styles.zip) here.
    This is a set of HTML styles images based on the WordPress theme “Twenty Nineteen”.
  2. Go to  Open Live Writer’s blog templates folder (at %APPDATA%\OpenLiveWriter\blogtemplates)
    This folder contains multiple folders.
  3. In each folder, there would be a set of bitmap (BMP) images titled P, H1, H2,… to H6.
    Go through each folder until you find the set of images that matches what you see in your Open Live Writer toolbar.
  4. Make a backup copy of the images (in case, you don’t like this fix).
  5. Extract the images from zip file downloaded from step 1 and store them in this folder.
  6. Close Open Live Writer. You should see the changes when you restart Open Live Writer.

Steps details

1. Download a dummy set of HTML style images

I’m skipping this step.
I assume you know how to download a zip file from Internet.

2. Go to  Open Live Writer’s blog templates folder (at %APPDATA%\OpenLiveWriter\blogtemplates)

Open Windows FIle Explorer
Enter “%APPDATA%\OpenLiveWriter\blogtemplates” in the navigation bar.

file-explorer-01

You may see multiple folders in this folder.
Each folder represents a blog that you have registered with Open Live Writer.
So the following image implies that I have 3 blogs registered with Open Live Writer.

image

3. Going through each folder until I find the folder with images similar to what I see in the toolbar.

If you could not see the preview of the image files in the folder, try setting the view layout to “Large icons”.

image

4. Making backup of the images.

I’m skipping this step here.
I assumed you know how to do this.

5. Extract the images from zip file downloaded from step 1 and store them in this folder.

After replacing the image files, your folder should look something like the below:

image

6. Restart Open Live Writer,

After restarting Open Live Writer, your HTML styles toolbar should look something like the below image:

open-live-writer fixed HTML styles toolbar

2017-07-12

Using ACMESharp to get SSL certificates from Let’s Encrypt

This blog post is a reminder note to myself on how to use the ACMESharp PowerShell module to get SSL certificates from Let’s Encrypt CA.

Essentially, the usage can be divided into the following phases:

  1. Install ACMESharp PowerShell module
  2. Import ACMESharp PowerShell module
  3. Initial (one-time) setup
  4. Register DNS of certificate
  5. Get “challenge” details (to prove that you are the owner of the domain)
  6. Signal Let’s Encrypt to confirm your challenge answer
  7. Download certificates

Steps 1-3 is only for setting up on a new PC.
Step 2, 4 should be repeated for each domain that you want SSL certificates for.
Steps 2, 5-7 should be repeated whenever you want to get or renew certificate.

1. Install ACMESharp PowerShell module

Install-Module -Name ACMESharp -AllowClobber

2. Import ACMESharp PowerShell module

Import-Module ACMESharp

 

3. Initial (one-time) setup

Initialize-ACMEVault

New-ACMERegistration -Contacts mailto:zhixian@hotmail.com -AcceptTos

4.  Register DNS of certificate

New-ACMEIdentifier -Dns plato.emptool.com -Alias plato_dns

5. Get challenge (to prove that you are the owner of the domain)

Complete-ACMEChallenge plato_dns -ChallengeType http-01 -Handler manual

6. Signal Let’s Encrypt to confirm your challenge answer

Submit-ACMEChallenge plato_dns -ChallengeType http-01
(Update-ACMEIdentifier plato_dns -ChallengeType http-01).Challenges | Where-Object {$_.Type -eq “http-01”}
New-ACMECertificate plato_dns -Generate -Alias plato_cert1
Submit-ACMECertificate plato_cert1
Update-ACMECertificate plato_cert1

7. Download certificates

NGINX

Get-ACMECertificate plato_cert1 -ExportCertificatePEM “C:\src\certs\plato_cert1.crt.pem”
Get-ACMECertificate plato_cert1 -ExportIssuerPEM “C:\src\certs\plato_cert1-issuer.crt.pem”

Add-Content -Value (Get-Content plato_cert1.crt.pem) -Path nginx.plato.emptool.com.pem
Add-Content -Value (Get-Content plato_cert1-issuer.crt.pem) -Path nginx.plato.emptool.com.pem

HAPROXY

ZX: Generating SSL certificates for HAPROXY is similar to NGINX, except it includes a key.

Get-ACMECertificate plato_cert1 -ExportKeyPEM “C:\src\certs\plato_cert1.key.pem”
Get-ACMECertificate plato_cert1 -ExportCertificatePEM “C:\src\certs\plato_cert1.crt.pem”
Get-ACMECertificate plato_cert1 -ExportIssuerPEM “C:\src\certs\plato_cert1-issuer.crt.pem”

Add-Content -Value (Get-Content plato_cert1.crt.pem) -Path haproxy.plato.emptool.com.pem
Add-Content -Value (Get-Content plato_cert1-issuer.crt.pem) -Path haproxy.plato.emptool.com.pem
Add-Content -Value (Get-Content plato_cert1.key.pem) -Path haproxy.plato.emptool.com.pem

 

IIS

Get-ACMECertificate plato_cert1 -ExportPkcs12 “C:\src\certs\iis.plato_cert1.pfx”

 

2016-01-04

Fixing “The Parallel port driver service failed to start” on Windows 2003

Filed under: computing, windows — Tags: , — Zhixian @ 19:42:01 pm

My first blog post for 2016.
This is a reminder blog post.

Summary

  1. Symptoms
  2. Solution
  3. Reference

Symptoms

When your Windows 2003 boot up, you may see another a message like the below:

VirtualBox_Win2k3-ZXDBM_04_01_2016_19_14_09

When you logged into Windows and examine the Event Viewer, you may see an error under System.

VirtualBox_Win2k3-ZXDBM_04_01_2016_19_21_43

When you open up the error, you would see, the following error message:

VirtualBox_Win2k3-ZXDBM_04_01_2016_19_23_32

 

Solution

Start a Windows command prompt and run the following command:

sc config parport start= disabled

Note the space after “start=” in the above command. It is required.

After you ran this command, you should not see the error message prompt on your next Windows bootup.
Note: This solution deviate from the one stated in the reference.

 

Reference

  1. Error message on a Windows Vista-based or Windows Server 2008-based computer that does not have a parallel port: "The Parallel port driver service failed to start"

Create a free website or blog at WordPress.com.