Could not fetch URL … There was a problem confirming the ssl certificate.

// Full error message
Could not fetch URL There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='', port=444): Max retries exceeded with url: /?cfru=aHR0cHM6Ly9weXBpLm9yZy9zaW1wbGUvYXV0b3BlcDgv (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))) - skipping

// This could mean there is no local certificate to read from. See this post

Could not install packages due to an EnvironmentError [Error 13] Permission denied:

// error message when installing a pip package
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: 'C:\\Python38\\Lib\\site-packages\\__pycache__\\pycodestyle.cpython-38.pyc'
Consider using the `--user` option or check the permissions.

// just add --user to the command. ex:
python -m pip install autopep8 --user --trusted-host --trusted-host

nginx error with Angular routing

404 Not Found

nginx/1.14.0 (Ubuntu)



#change this line:
try_files $uri $uri/ =404;
#to this:
try_files $uri $uri/ /index.html;
#then restart nginx
sudo systemctl restart nginx

Call API from Python

import requests
import urllib3

# suppress the HTTPS warnings in terminal

session = requests.Session()
session.verify = False

url = ""
headers = {'content-type': 'application/json', 'Accept-Charset': 'UTF-8'}

# call the HTTP endpoint
httpResult = session.get(url, headers=headers)

# some extra details
elapsedSeconds = httpResult.elapsed.total_seconds()
statusCode = httpResult.status_code

Get user credentials securely in PowerShell

#Get user credentials securely
Try {
	$credentials = Get-Credential "$env:username"
Catch {
	$log += "`n- " + $_.Exception.Message

#Get current domain to use for authentication. ADSI = Active Directory
$currentDomain = "LDAP://" + ([ADSI]"").distinguishedName

$activeDirectoryEntry = New-Object System.DirectoryServices.DirectoryEntry($currentDomain,$credentials.GetNetworkCredential().UserName,$credentials.GetNetworkCredential().Password)
if ($ -eq $null)
    $log += "`n- Failed to authenticate that username and password."
} else {
    $log += "`n- Authentication was successful."

#Display Results
$log = "Results:"
function Output-Result {
    [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") > null

Startup.cs example for .NET Core API w/ Swagger

using Swashbuckle.AspNetCore.Swagger;

public void ConfigureServices(IServiceCollection services)
    services.AddSwaggerGen(c =>
        c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" });

    services.AddTransient<ISomeInterface, SomeDependency>();

// -----------------

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    if (env.IsDevelopment())
        app.UseSwaggerUI(c =>
            c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API");