Skip to content

Instantly share code, notes, and snippets.

@irnb
irnb / connect.sh
Created May 3, 2025 16:17
SSH Tunneling
#!/bin/bash
# This script starts and automatically restarts an SSH SOCKS proxy connection.
REMOTE_USER="USER_NAME"
REMOTE_HOST="SERVER_IP"
LOCAL_PORT="PROXY_PORT"
# IMPORTANT: Adjust this path if needed. Use an absolute path (e.g., ~/.ssh/key_name)
# if you run the script from different directories.
SSH_KEY_PATH="KEY_PATH"
@irnb
irnb / a_simple_musig2_taproot_showcase.rs
Last active January 16, 2025 13:56
Taproot integration with Musig2
// SPDX-License-Identifier: CC0-1.0
//! Demonstrate creating a transaction that spends to and from p2tr outputs with musig2.
use std::str::FromStr;
use bitcoin::{
hashes::Hash,
key::Keypair,
locktime::absolute,
@irnb
irnb / isContract_web3py.py
Created August 15, 2021 15:02
check a account is a smart contract or not in web3py
from web3 import Web3
import hexbytes
web3 = Web3(
Web3.HTTPProvider("YOUR_WEB3_PROVIDER")
)
def is_contract(addr : str):
temp = web3.eth.getCode(addr)
if temp != hexbytes.main.HexBytes(""):