Skip to content

Instantly share code, notes, and snippets.

View rickapps's full-sized avatar

Rick Eichhorn rickapps

View GitHub Profile
@rickapps
rickapps / AddRootCertToOS.md
Last active December 28, 2024 22:03
How to Add Your Own SSL Root Certificate to Linux and Windows

How to Add a Root Certificate

The best way to make your web browser trust SSL certificates you create yourself is to add your own root certificate to your operating system. Your web browser will trust any certificate it can trace back to a root certificate that resides either in the browser's trusted store or in the operating system's trusted store. The benefit of installing the root to your operating system is that every browser on your computer will trust all certificates you create from that root. The GitHub project rickapps/self-signed-ssl-chain demonstrates how to create your own certificate chains that behave identically to the SSL certificates you purchase.

How to Check if an SSL Certificate is a Root

Root certificates must meet two criteria: 1) Self-signed, meaning Issuer and Subject are equal 2) Basic Constraints attribute CA is True and marked critical. Use the following command to see if your certificate qual

@rickapps
rickapps / ssl-cert-howto.md
Last active December 27, 2024 23:24
How to create SSL certificates that your web browser will trust.

Commands to Create Trusted SSL Certificates using OpenSSL

Commands described below can be found in a bash script included in this github project.

Generate a key pair

# Create a new private key with key length 4096
openssl genrsa -out mykey.pem 4096
# Create a new private key and password protect it
openssl genrsa -aes256 -out protected.pem 4096
@rickapps
rickapps / ssl-certificate-chains.md
Last active December 30, 2024 21:12
Explains how SSL certificate chains work. How does a web browser trust a certificate?

How SSl Certificates Work

SSL Certificate Chains

For your browser to trust an SSL certificate, that certificate must be linked to a certificate that your browser already trusts. Web browsers are shipped with certificates that are trusted by default. These are called root certificates and they are always self-signed. The SSL certificates you purchase from a certificate authority (CA) are signed using the CA's private key and their intermediate certificate. The CA's intermediate certificate is signed by either another CA or by one of your web browser's trusted root certificates. In order for your web browser to trust your SSL certificate, it must be able to follow the signing chain until it reaches a trusted root certificate. That's why when you create a self-signed certificate on your computer, your web browser does not initially trust it. For an example script demonstrating how to create a trusted certificate chain, see this github project.

Be

SQL Server Express LocalDB Quick Start

SQL Server Express LocalDB is a free, low impact version of the SQL Server database engine. LocalDB runs in-process rather than as a service. That means the database instance runs only when your application runs. Otherwise, it uses no machine resources other than disk space. It is intended for use on any database project in early stages of development. No database administration is needed and setup is easy. It is included with Visual Studio. If you use Visual Studio to generate Entity Framework scaffolding, Visual Studio can automatically create a LocalDB connection. Typically, you would migrate your project to a more robust database as your development progresses. But you can deploy a finished project using LocalDB as an embedded database for applications that do not require more than LocalDB offers.

SQL Server Databases:

SQL Server offers several products you can use for your projects. For many projects, especially projects in early stages of development, you c

@rickapps
rickapps / NetCoreSecrets.md
Last active July 23, 2022 22:13
Hide passwords using Secrets.json in Visual Studio .NET Core projects.

How to use Secrets.json

Problem:

We don't want passwords and other sensitive information in our project configuration files. The information could end up on github or other code sharing sites.

Solution:

Use Secrets.json file. Note that Secrets.json is only meant for your development machine. It is not designed for use on a production machine. Here's how to set it up:

@rickapps
rickapps / RefreshTokens.md
Last active March 26, 2025 19:01
How to generate eBay Refresh Tokens

How to Generate a Refresh Token for eBay

Refresh tokens are used to generate eBay user tokens. User tokens are required for every eBay API call that returns account specific information from eBay. A user token has a life span of about two hours. To avoid forcing your user to log into eBay every time their user token expires, your application instead can store a refresh token. Refresh tokens last about 18 months. The user logs into eBay one time to associate their eBay account with your application. This gives your application permission to act on their behalf. The permission lasts for the lifetime of the refresh token or until the user revokes permission.

To generate a refresh token you need a base64 authorization code, your RuName, and an eBay user willing to give you their login credentials (It can be your account). The steps below would normally be automated

@rickapps
rickapps / mandelbrot.ipynb
Last active July 6, 2024 20:25
Python program to create Mandelbrot plot
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rickapps
rickapps / AddNewItemDialogViewModel.cs
Created January 13, 2017 21:08
UWP Template10 Busy.xaml made into a real modal dialog with OK,Cancel buttons and ViewModel
using GalaSoft.MvvmLight.Command;
using RickApps.eBayLoader.Domain.Abstract;
using RickApps.eBayLoader.Domain.Entities;
using RickApps.eBayLoader.Views;
using System;
namespace RickApps.eBayLoader.ViewModels
{
public class AddNewItemViewModel : ViewModelBase
{