Skip to content

Instantly share code, notes, and snippets.

@sunapi386
sunapi386 / install.sh
Created February 7, 2026 22:45
Claude Code Command Center for tmux — one-shot installer
#!/usr/bin/env bash
# Claude Code Command Center — one-shot installer
# Run: bash ~/.claude/command-center/install.sh
set -euo pipefail
log() { printf '\e[1;34m→\e[0m %s\n' "$1"; }
ok() { printf '\e[1;32m✓\e[0m %s\n' "$1"; }
err() { printf '\e[1;31m✗\e[0m %s\n' "$1" >&2; exit 1; }
# ── Preflight ────────────────────────────────────────────────────────────────
@sunapi386
sunapi386 / README.md
Last active February 4, 2026 23:38
Download transcripts from Descript share links (VTT, JSON, plain text)

Transcript Tools

descript_download.sh

Download transcripts from Descript share links. Extracts the embedded publish ID from the page and downloads the subtitle and transcript files directly.

Output

File Contents
@sunapi386
sunapi386 / README.md
Created February 4, 2026 17:29
Claude CLI → Localhost Flask API

Claude CLI API Server

A lightweight Flask server that wraps the authenticated Claude Code CLI as a localhost REST API.

Single-file app. Prompt is passed via stdin to avoid shell injection and argument length limits.

Setup

git clone https://gist.github.com/sunapi386/043750b63ad09a5421c4d5bb78c0fcd1 claude-api
@sunapi386
sunapi386 / resize.sh
Created January 22, 2026 15:00
Disk Resize Script
#!/bin/bash
# ==============================================================================
# resize_disk.sh (v6 - Based on Your Working Commands)
#
# Uses the exact command sequence that you verified works manually.
#
# ==============================================================================
set -e
@sunapi386
sunapi386 / example-write-laz-point.cpp
Created April 2, 2019 05:49
C++ LAZ-PERF LAZPERF LAS tool example how to use
#include <laz-perf/io.hpp>
#include <laz-perf/las.hpp>
#include <filesystem>
void write_a_fake_laz(const std::string &path) {
const std::filesystem::path &outname (path);
using namespace laszip;
using namespace laszip::formats;
struct point {
las::point10 p;
@sunapi386
sunapi386 / mount_encrypt_drive.md
Created March 23, 2019 00:51
How to mount encrypted drive with same volume group name

Background/Setup

  • I have two physical 1TB disks with identical setup.
  • Both are encrypted.
  • I unlocked and booted off one of them.
  • The other disk is still locked at this point.
  • I am using fish shell.

1. Identify which disk you want to unlock

@sunapi386
sunapi386 / compress_cardano_db.sh
Created December 19, 2023 00:16
Compressing the Cardano node database to reduce storage space, for systems with limited storage capacity.
#!/bin/bash
# This script compresses the Cardano node's 'immutable' directory to reduce storage usage.
# It creates directories for archives, indexes, and a write-overlay within the db path.
# The script groups files by their name prefixes, compresses them using pixz, and checks for existing archives to avoid reprocessing.
# After compression, original files are deleted, and new files are moved to the write-overlay.
# Ratarmount is used to mount a virtual directory combining the read-only archives and the write-overlay for operational continuity.
# Variables
CARDANO_DB_PATH=~/cnode/db # Replace with your actual Cardano db path
RATAR_PATH="$CARDANO_DB_PATH/ratar"
@sunapi386
sunapi386 / CMakeLists.txt
Created March 8, 2019 03:32
install g++-8 ubuntu 18.04 and configure cmake
cmake_minimum_required(VERSION 3.10)
project(project_name CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_REQUIRED_FLAGS -std=c++17)
include(CheckCXXSymbolExists)
add_executable(project_name project_name.cc)
set_property(TARGET project_name PROPERTY CXX_STANDARD 17)
## target_link_libraries(project_name) # link libraries here
@sunapi386
sunapi386 / cuda_11.7_installation_on_Ubuntu_22.04
Last active June 1, 2023 15:27 — forked from primus852/cuda_11.7_installation_on_Ubuntu_22.04
Instructions for CUDA v11.7 and cuDNN 8.5 installation on Ubuntu 22.04 for PyTorch 1.12.1
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
@sunapi386
sunapi386 / guacaadduser.md
Created October 20, 2015 01:46
Guacamole Add User

Adding a user

Create a user

Then create the user; remember setting to his password to "chessman123"

sudo adduser binsun

Modifying guacamole's user login data