Skip to content

Instantly share code, notes, and snippets.

### Option 1 - Terraform can generate SSL/SSH private keys using the tls_private_key resource
variable "key_name" {}
resource "tls_private_key" "example" {
algorithm = "RSA"
rsa_bits = 4096
}
resource "aws_key_pair" "generated_key" {
//
// main.swift
// Shell Notification Center
//
// Created by Keng Lee on 2021/1/15.
//
import Foundation
import Combine
var bag = Set<AnyCancellable>()
@mkol5222
mkol5222 / govc-ubuntu-install.md
Created February 5, 2024 14:09 — forked from tdewin/govc-ubuntu-install.md
Install ubuntu via GOVC in a almost automated way

Automated install

You want to have a fresh copy instead of a template clone? Here you go

Set some variables

set GOVC_INSECURE=true
set GOVC_URL=login@vcenter.fqdn
set GOVC_PASSWORD=youguess
set GOVC_DATASTORE=mydatastore
@mkol5222
mkol5222 / cloud-init.yaml
Last active February 7, 2024 08:21
how to launch multipass Ubuntu LTS VM with docker
#cloud-config
package_upgrade: true
#ssh_authorized_keys:
# - <your key>
packages:
- docker.io
- docker-compose
- jq
# Originally from here : https://gist.github.com/ngaffa/15d46c98dd82620c8120ddf7398d6dbd
#cloud-config
package_update: true
package_upgrade: true
packages:
# Update the apt package index and install packages needed to use the Docker and Kubernetes apt repositories over HTTPS
- apt-transport-https
- ca-certificates
- curl
@mkol5222
mkol5222 / tmux-cheatsheet.markdown
Created January 29, 2024 08:46 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mkol5222
mkol5222 / Get-AzLastCall.ps1
Created January 29, 2024 05:53 — forked from s4parke/Get-AzLastCall.ps1
Get the last caller from the ActivityLog on a resource or resource group. Useful to find who what & when.
function Get-AzLastCall {
<#
.SYNOPSIS
Get the last caller from the ActivityLog on a resource or resource group.
Useful to find who what & when.
.DESCRIPTION
Inputs: ResourceGroupName (required) and ResourceName (optional).
Outputs: Array-list of PSEvent Objects
@mkol5222
mkol5222 / mount_vmdk.sh
Created January 28, 2024 22:21 — forked from janstarke/mount_vmdk.sh
Mount vmdk files
#!/bin/bash
display_usage() {
echo "$0 <dir with vmdk files>" >&2
}
exit_with_error() {
MSG="$1"
echo "$MSG" >&2
exit 1
---
extension_requests:
pp_preshared_key: "${psk}"
@mkol5222
mkol5222 / jwt-decode.sh
Created January 25, 2024 16:04 — forked from angelo-v/jwt-decode.sh
Decode a JWT via command line
# will not work in all cases, see https://gist.github.com/angelo-v/e0208a18d455e2e6ea3c40ad637aac53#gistcomment-3439904
function jwt-decode() {
sed 's/\./\n/g' <<< $(cut -d. -f1,2 <<< $1) | base64 --decode | jq
}
JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
jwt-decode $JWT