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 / 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 / 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 / CMakeLists.txt
Created May 14, 2020 00:18
ros publish subscribe test
project(rosexample)
cmake_minimum_required(VERSION 3.1)
add_compile_options(-std=c++17)
find_package(catkin REQUIRED COMPONENTS roscpp rospy rostest std_msgs message_generation)
add_message_files(FILES ack.msg)
generate_messages(DEPENDENCIES std_msgs)
include_directories(${catkin_INCLUDE_DIRS})
add_rostest_gtest(tester tester.test tester.cpp)
add_dependencies(tester ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(tester ${catkin_LIBRARIES} ${rostest_LIBRARIES} gtest)
@sunapi386
sunapi386 / curl.sh
Created May 9, 2020 20:25
mailgun example sending
curl -s --user 'api:key-YOURAPIKEYHERE' \
https://api.mailgun.net/v3/mg.example.co/messages \
-F from='Excited User <postmaster@mg.example.co>' \
-F to=j@example.co \
-F subject='Hello' \
-F text='Testing some Mailgun awesomeness!'
@sunapi386
sunapi386 / download_vimeo_video.fish
Created October 26, 2019 23:02
Fish shell script to download Vimeo video
#!/usr/bin/env fish
# Script to download videos from vimeo
# Vimeo streams the video to you in segments of m4s and so this script
# downloads all the segments until failure, then combines the segments
# into a single mp4 file.
function download_vimeo_video
if test (count $argv) -ne 2
echo "Require a topic and url"
@sunapi386
sunapi386 / analysis.md
Last active October 26, 2019 01:15
stack smash with copy_elision and lying to c++ compiler

Looking at the difference between the generated assembly.

Foo::Foo() [base object constructor]:                         <
        pushq   %rbp                                          <
        movq    %rsp, %rbp                                    <
        movq    %rdi, -8(%rbp)                                <
        movq    -8(%rbp), %rax                                <
        pxor    %xmm0, %xmm0                                  <
        movss   %xmm0, (%rax)   ; 1.                          <
        nop                                                   <