This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -ex | |
CPU_CORES=$(sysctl -n hw.ncpu) | |
MAKE_JOBS=$(expr $CPU_CORES / 2) | |
# Set working directory. | |
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | |
cd $SCRIPT_DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Loosly based on https://openssl-ca.readthedocs.io/en/latest/index.html | |
set -eu | |
# --- Configuration --- | |
ROOT_CA_KEY_SIZE=4096 | |
OTHER_KEY_SIZE=2048 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
URL=https://dl.dod.cyber.mil/wp-content/uploads/pki-pke/zip/unclass-certificates_pkcs7_DoD.zip | |
FILENAME=$(basename $URL) | |
DOWNLOAD_FILE=$TMPDIR$FILENAME | |
curl -sL -o $DOWNLOAD_FILE $URL | |
unzip -p $DOWNLOAD_FILE *.pem.p7b | openssl pkcs7 -print_certs -outform PEM -out $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN CERTIFICATE REQUEST-----(?<certificate>\r?\n([A-Za-z0-9\/+]{64}\r?\n)*[A-Za-z0-9\/+]{1,64}={0,2}\r?\n)-----END CERTIFICATE REQUEST-----(\r?\n)? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ErrorActionPreference = "Stop" | |
$Global:ProgressPreference = "SilentlyContinue" | |
$installpath = Join-Path -Path $env:ProgramFiles -ChildPath OpenSSL | |
$uri = [uri]"https://github.com/git-for-windows/git/releases/download/v2.45.0.windows.1/PortableGit-2.45.0-64-bit.7z.exe" | |
$filename = $uri.Segments | Select-Object -Last 1 | |
$downloadpath = Join-Path -Path $env:TEMP -ChildPath $filename | |
Invoke-WebRequest -Uri $uri -OutFile $downloadpath | |
$expandpath = Join-Path -Path $env:TEMP -ChildPath (Get-Item -Path $downloadpath | Select-Object -ExpandProperty BaseName) | |
& $downloadpath -o"$expandpath" -y | |
$files = @( "openssl.exe", "libcrypto-3-x64.dll", "libssl-3-x64.dll", "zlib1.dll" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$code = @" | |
using System.Text; | |
using System; | |
using System.Runtime.InteropServices; | |
namespace CredManager { | |
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] | |
public struct CredentialMem | |
{ | |
public int flags; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Console] | |
"ColorTable00"=dword:000c0c0c | |
"ColorTable01"=dword:00da3700 | |
"ColorTable02"=dword:000ea113 | |
"ColorTable03"=dword:00dd963a | |
"ColorTable04"=dword:001f0fc5 | |
"ColorTable05"=dword:00981788 | |
"ColorTable06"=dword:00009cc1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl rsa -in somefile.pem -out id_rsa_somefile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-ListDirectory { | |
param ( | |
[Parameter(Mandatory = $false, Position = 0, ValueFromRemainingArguments = $true)]$Remaining | |
) | |
$defaultargs = "-la" | |
/bin/ls $defaultargs @Remaining | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-RemoteCertificate { | |
param ( | |
[uri]$Uri | |
) | |
$tcpclient = New-Object System.Net.Sockets.TcpClient($Uri.DnsSafeHost, $Uri.Port) | |
$rcvc = [System.Net.Security.RemoteCertificateValidationCallback]{ | |
param( | |
[object]$senderd, | |
[System.Security.Cryptography.X509Certificates.X509Certificate]$certificate, | |
[System.Security.Cryptography.X509Certificates.X509Chain]$chain, |
NewerOlder