Skip to content

Instantly share code, notes, and snippets.

@ilap
ilap / ledger_nano_ssh_on_macos.md
Last active April 6, 2026 10:32
SSH using Ledger Nano S

Ledger Nano S/S+/X SSH Intro

OpenSSH 8.2 introduced a new feature allowing “native” usage of FIDO authentication devices for SSH key storage. Though macos does not have the required shared library for FIDO security key provider (SecurityKeyProvider).

Ledger's SecurityKey based install (RECOMMENDED)

Requirements:

  • Security Key app installed on Ledger Nano S/S+/X
  • Build env for building the Security key provider

Intro

  1. Google takeout subscription and watch history
  2. convert the watch-history.html to history.json using the js script below
  3. upload to invidious

2. Convert

# Part one
@ilap
ilap / epoch_rewards.md
Last active February 9, 2023 14:43
Epoch Rewards

Zsh script

#!/usr/bin/env zsh
# 
# usage:
# epoch_rewards.sh {317..390}
# or
# epoch_rewards.sh 390
@ilap
ilap / plot_rss.md
Last active April 27, 2023 00:43
Plot RSS with and without cost

Plot RSS with and without cost

#!/usr/bin/env python3

import math

import matplotlib.pyplot as plt
@ilap
ilap / pledge_model.py
Created November 13, 2022 00:28
Cardano's RSS Simulation - Pledge Model
#!/usr/bin/env python3
# Python implementation of Lars's Haskell based `pledge_model`.
# https://github.com/brunjlar/pledging-model
#
# Install:
# python -m pip install numpy argparse
import random
import numpy as np
import argparse
@ilap
ilap / recover_byron.md
Last active October 2, 2022 03:19
Recover Byron with permutations

Install

$ mkdir recover && cd recover
# 1. Save the recover.js javascript below as recover.js

# 2. Install prereqs
$ npm i cbor cardano-crypto.js@6.1.1

# 3. Create a password file with the password candidates, 1-per-line
@ilap
ilap / Playground.hs
Last active October 4, 2021 07:12
Plutus Playground Smart Contract
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@ilap
ilap / Playground.hs
Created October 3, 2021 10:43
Plutus Playground Smart Contract
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@ilap
ilap / Playground.hs
Last active October 2, 2021 23:23
Plutus Playground Smart Contract
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@ilap
ilap / get_hydra_build.md
Last active May 24, 2022 08:35
Retrieve Hydra Build based on Git tag