Skip to content

Instantly share code, notes, and snippets.

View feliperomero3's full-sized avatar

Felipe Romero feliperomero3

View GitHub Profile
@shashank-shekhar
shashank-shekhar / CreateIISSite.ps1
Created January 17, 2022 22:34
Create an IIS site, accopanying self signed certificate, and update hosts
# This scripts create an IIS site with an SSL Certificate assigned to it
$siteName = 'sitename'
$sitepath = 'path to project'
Write-Host "Starting Site Creation for $siteName"
# Create Certificate
New-SelfSignedCertificate -Type SSLServerAuthentication -DnsName $siteName -CertStoreLocation 'cert:\LocalMachine\My' -KeyExportPolicy Exportable -KeyAlgorithm RSA -KeyLength 4096
New-WebAppPool -Name $siteName
@ridomin
ridomin / CreateLeafCert.ps1
Created December 17, 2021 19:37
CreateLeafCert.ps1
$root = gci "cert:\CurrentUser\my\d8c5cd7502cd699783d9b2c031636ca48ae4229f"
$rootSubject = $root.Subject.Substring(3)
Write-Host "Root Certificate" $root.Thumbprint
$certName = "myCustomCert"
$cert = New-SelfSignedCertificate `
-CertStoreLocation cert:\CurrentUser\my `
@davidfowl
davidfowl / .NET6Migration.md
Last active April 11, 2024 02:02
.NET 6 ASP.NET Core Migration
@ferferga
ferferga / delete_ghcr_dangling_images.sh
Created September 7, 2021 17:12
Deletes untagged images from GitHub Container Registry package using gh cli
#!/bin/bash
set -e
# Simple script to remove dangling images from GHCR.
# You need to have installed gh cli and jq for this script to work properly
# You need to be logged to 'gh' first
container="debian/buildd"
temp_file="ghcr_prune.ids"
rm -rf $temp_file
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@feliperomero3
feliperomero3 / README.md
Last active June 3, 2023 19:28
Generate a self-signed certificate using OpenSSL

Generate a self-signed root certificate using OpenSSL

This repository contains a script that will generate a trusted ssl certificate which can be used for local software development.

Prerequisites

  • OpenSSL.
  • Bash (Linux only).
  • Git Bash (Windows only).
@franps
franps / openssl_cheatsheet.md
Last active March 15, 2022 14:00
Comandos útiles openssl

Comandos útiles en openssl

Si se ven encabezados (-----BEGIN X509 CRL-----) es PEM, sino es DER

CRL

Ver info de CRL openssl crl -inform PEM -text -in test.crl

Ver solo encabezado

@changhuixu
changhuixu / git-prompt.sh
Created June 26, 2020 13:38
~/.config/git/git-prompt.sh
PS1='\[\033]0;$TITLEPREFIX:\W\007\]' # set window title
PS1="$PS1"'\n' # new line
PS1="$PS1"'\[\033[32m\]' # change to green
PS1="$PS1"'git@local ' # user@host<space>
PS1="$PS1"'\[\033[35m\]' # change to purple
PS1="$PS1"'$MSYSTEM ' # show MSYSTEM
PS1="$PS1"'\[\033[33m\]' # change to brownish yellow
PS1="$PS1"'\W' # current working directory
if test -z "$WINELOADERNOEXEC"
then
@MayMeow
MayMeow / Examples.md
Last active February 13, 2022 03:07
Selfsigned Certificates for Code signing in visual studio

Create CA file

$c = New-SelfSignedCertificate -DnsName SelfSignedCA -CertStoreLocation Cert:\CurrentUser\My -NotAfter (Get-Date).AddYears(10)

check certificate fingerprint

$c
@dahlsailrunner
dahlsailrunner / SelfSignedCerts-IIS.md
Last active June 18, 2023 05:27
Selfsigned certs in IIS from PowerShell

Create Authority

New-SelfSignedCertificate -DnsName "KnowYourToolset Cert Authority" -CertStoreLocation "Cert:\LocalMachine\My" -KeyUsage CertSign,CRLSign

Creates root authority with permission to sign stuff

Export-Certificate -Cert Cert:\LocalMachine\My\<CERTHUMB> -FilePath kytroot.cer

Trust Authority

Import-Certificate -FilePath .\kytroot.cer -CertStoreLocation Cert:\LocalMachine\Root