Skip to content

Instantly share code, notes, and snippets.

View lucamilan's full-sized avatar
:bowtie:
I may be slow to respond.

Luca Milan lucamilan

:bowtie:
I may be slow to respond.
View GitHub Profile
@lucamilan
lucamilan / file1.lua
Created July 12, 2024 17:35
Esempio di Gist
Contenuto del file 1
@lucamilan
lucamilan / Basic-WebRequest.ps1
Created October 24, 2023 13:56 — forked from rithala/Basic-WebRequest.ps1
PowerShell HTTP Request with Basic Auth
$user = 'user'
$pass = 'pass'
$uri = '<url>'
$pair = "$($user):$($pass)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"
@lucamilan
lucamilan / MinimalAPIs.md
Created May 17, 2023 06:15 — forked from davidfowl/MinimalAPIs.md
Minimal APIs at a glance
@lucamilan
lucamilan / powershell-cert.md
Created January 22, 2023 18:11 — forked from nmoinvaz/powershell-cert.md
Powershell Commands for Certificates

Self-signed Code Signing Certificate

To create the code signing certificate using PowerShell (using Administrator prompt):

$cert = New-SelfSignedCertificate -Subject "My Certificate" -Type CodeSigning -CertStoreLocation Cert:\CurrentUser\My -NotAfter (Get-Date).AddYears(100)

To export the certificate from the certificate store:

$certPassword = ConvertTo-SecureString -String "passwordhere" -Force –AsPlainText
$cert | Export-PfxCertificate -FilePath "mycert.pfx" -Password $certPassword
@lucamilan
lucamilan / SelfSignedCert.md
Created January 22, 2023 18:02 — forked from mrcunninghamz/SelfSignedCert.md
Creating a self signed certificate in a pfx format on a mac.

Create Self Signed Certificate using OpenSSL on a Mac

Introduction

Every now and then I need to create a self signed certificate in azure for something. In my particular case its Azure B2C. I am using a mac so its not simply just running something like

New-SelfSignedCertificate `
    -KeyExportPolicy Exportable `
    -Subject "CN=yourappname.yourtenant.onmicrosoft.com" `
 -KeyAlgorithm RSA `
@lucamilan
lucamilan / beyondcompare.ps1
Created January 19, 2023 12:59 — forked from flcdrg/boxstarter-bare-v3.ps1
My BoxStarter Scripts
cinst beyondcompare
cinst beyondcompare-integration
@lucamilan
lucamilan / choco.config
Last active January 27, 2023 09:18
Boxstarter installer script for developer workstation
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="1password" version="7.9.832" />
<package id="7zip" version="22.1" />
<package id="7zip.install" version="22.1" />
<package id="adobereader" version="2022.003.20310" />
<package id="Boxstarter" version="3.0.0" />
<package id="Boxstarter.Bootstrapper" version="3.0.0" />
<package id="Boxstarter.Chocolatey" version="3.0.0" />
<package id="Boxstarter.Common" version="3.0.0" />
// create CA key
openssl genrsa -out ca.key 2048
// create CA cert
openssl req -x509 -sha256 -new -nodes -key ca.key -days 365 -out ca.pem
// create client key
openssl genrsa -out client.key 2048
// create client csr
@lucamilan
lucamilan / java-webapp-az-pipeline.yaml
Created September 17, 2022 16:17 — forked from pretty25/java-webapp-az-pipeline.yaml
Automate Java container deployments with Azure Pipelines
az configure --defaults location=westus2
# resourceSuffix=$RANDOM
# webName="java-container-cicd-${resourceSuffix}"
# registryName="javacontainercicd${resourceSuffix}"
# dbServerName="java-container-cicd-${resourceSuffix}"
# rgName='java-containers-cicd-rg'
# planName='java-container-cicd-asp'
# az group create --name $rgName
@lucamilan
lucamilan / terraform-deploy.yaml
Created September 16, 2022 07:55
Simple Terraform deploy pipeline
name: Terraform Sample 1
env:
tf_directory: sample-1
on:
push:
paths:
- 'sample-1/**'
workflow_dispatch: