Skip to content

Instantly share code, notes, and snippets.

View kimsk's full-sized avatar
💭
We have two lives, and the second begins when we realize we only have one.

Karlkim Suwanmongkol kimsk

💭
We have two lives, and the second begins when we realize we only have one.
View GitHub Profile
@kimsk
kimsk / get-synthetic-sk.ps1
Created November 19, 2022 06:21
Given synthetic public key and fingerprint, output the synthetic secret key
$fp = 3855208971
$synthetic_pk = "93c8a14b74d0cfe62cf451200eb42f3f2fe5c581f5153d308b10c43f40fba9d49a812204e0f970b2f83e23c59eb22e09"
$index = chia keys derive -f $fp child-key -t wallet -n 20 |
% { $_ -replace "^Wallet public key (\d{1,}): ", "" } |
% { cdv inspect keys --synthetic -pk $_ | select -first 1 } |
% { $idx =0 } { [pscustomobject]@{ index = $idx; sythetic_public_key = $_.Substring(12, 96)}; $idx++ } |
? { $_.sythetic_public_key -eq $synthetic_pk } |
% { $_.index }
chia keys derive -f $fp child-key -t wallet -i $index -s |
@kimsk
kimsk / cats-breaking.ps1
Last active June 7, 2022 20:40
A script breaking large CAT coins to smaller CAT coins.
$sw = new-object system.diagnostics.stopwatch
$sw.Start()
$FINGERPRINT = 219821919
$WALLET_ID = 2
$WALLET_ID_JSON = (@{ wallet_id = $WALLET_ID } | ConvertTo-Json) -replace '"', '\""'
$FEE = 50000000 # 50_000_000 mojos is 0.00005 XCH
$FEE_WALLET_ID_JSON = (@{ wallet_id = 1 } | ConvertTo-Json) -replace '"', '\""'
$AMOUNT = 1000 # one CAT is 1000 mojos
@kimsk
kimsk / offers_creating.ps1
Last active June 15, 2022 13:02
A script to create Chia offer files
$sw = new-object system.diagnostics.stopwatch
$sw.Start()
$OFFER_FINGERPRINT = 2705744614
$OFFER_WALLET_ID = 2
$OFFER_WALLET_ID_JSON = (@{ wallet_id = $OFFER_WALLET_ID } | ConvertTo-Json) -replace '"', '\""'
$AMOUNT = 1000 # one CAT is 1000 mojos
$FEE_WALLET_ID_JSON = (@{ wallet_id = 1 } | ConvertTo-Json) -replace '"', '\""'
$FEE = 50000000 # 50_000_000 mojos is 0.00005 XCH
@kimsk
kimsk / xch_breaking.ps1
Last active June 10, 2022 01:16
Breaking large XCH coins for fees
$sw = new-object system.diagnostics.stopwatch
$sw.Start()
$FINGERPRINT = 219821919 # fingerprint of your wallet
$FEE = 50000000 # 50_000_000 mojos is 0.00005 XCH
$WALLET_ID = 1
$NUM = 100
$AMOUNT = $FEE
@kimsk
kimsk / keybase.md
Created May 27, 2021 15:37
keybase.md

Keybase proof

I hereby claim:

  • I am kimsk on github.
  • I am karlkim (https://keybase.io/karlkim) on keybase.
  • I have a public key ASArYA5xlYytCDbOkZhKidUUA4a7XDmBN7ms4hAjyuWdZwo

To claim this, I am signing this object:

@kimsk
kimsk / setup-aks.ps1
Created May 11, 2020 15:15
Set up k8s on aks with ingress-nginx, prometheus, and grafana
[CmdletBinding()]
param (
[Parameter(Mandatory=$true, Position=0)] [string] $aksName,
[Parameter(Mandatory=$true, Position=1)] [string] $resourceGroup,
[Parameter(Mandatory=$true, Position=2)] [string] $location,
[Parameter(Mandatory=$true, Position=3)] [string] $apiUrl,
[Parameter(Mandatory=$true, Position=4)] [string] $sslKeyFile,
[Parameter(Mandatory=$true, Position=5)] [string] $sslCrtFile,
[Parameter(Mandatory=$true, Position=6)] [string] $apiFileYml,
[Parameter(Mandatory=$true, Position=7)] [string] $ingressFileYml,
@kimsk
kimsk / local-msi-azure-management-fluent.fs
Last active April 22, 2019 19:36
Using MSI locally with Azure Management Libraries for .NET (Fluent)
// https://docs.microsoft.com/en-us/dotnet/azure/dotnet-sdk-azure-concepts?view=azure-dotnet
// https://github.com/Azure/azure-libraries-for-net/issues/585
// https://github.com/Azure/azure-libraries-for-net#ready-to-run-code-samples-for-databases
open Microsoft.Azure.Services.AppAuthentication
open Microsoft.Azure.Management.ResourceManager.Fluent.Authentication
open Microsoft.Azure.Management.ResourceManager.Fluent
open Microsoft.Azure.Management.Fluent
open Microsoft.Azure.Management.ResourceManager.Fluent.Core
open Microsoft.Rest
@kimsk
kimsk / static-storage.md
Created March 11, 2019 21:12
Manage Static Website on Azure Storage using Azure CLI

Instructions (using PowerShell)

Initial

$resourceGroup = "myResource"
$storageName = "myStorage"
$location = "southcentralus"
$sku = "Standard_RAGRS"
$kind = "StorageV2"
@kimsk
kimsk / acr-appservice.md
Last active June 24, 2021 20:25
Manage Azure AppService & Container Registry (ACR) using Azure CLI

Instructions (using PowerShell)

Initial

Setup Varialbes

$appServiceName = "myApp"
$appServicePlan = "myAppPlan"
$resourceGroup = "myResource"
Verifying my Blockstack ID is secured with the address 1N5icDpqQQ2nJQfy3QCWWzNyTbBFaahjCJ https://explorer.blockstack.org/address/1N5icDpqQQ2nJQfy3QCWWzNyTbBFaahjCJ