This is a personal reference workflow for minimizing token usage while maintaining project continuity across Claude Code (Sonnet 4 with file access).
Claude loads CLAUDE.md automatically at session start.
| #!/bin/bash | |
| # === Cache Cleanup Script === | |
| # Cleans caches for Homebrew, UV, Hugging Face, and NPM | |
| # Usage: bash cleanup.sh [options] | |
| # Options: | |
| # -a, --all Clean all caches | |
| # -b, --brew Clean Homebrew cache | |
| # -u, --uv Clean UV cache | |
| # -h, --huggingface Clean Hugging Face cache |
If you want to run Ollama on a specific GPU or multiple GPUs, this tutorial is for you. By default, Ollama utilizes all available GPUs, but sometimes you may want to dedicate a specific GPU or a subset of your GPUs for Ollama's use. The idea for this guide originated from the following issue: Run Ollama on dedicated GPU.
Create a script let's call it ollama_gpu_selector.sh:
nano ollama_gpu_selector.sh| import torch | |
| import subprocess | |
| import time | |
| import logging | |
| # Takes about 8GB | |
| ndim = 25_000 | |
| logging.basicConfig(format='[%(asctime)s] %(filename)s [%(levelname).1s] %(message)s', level=logging.DEBUG) | |
| def get_gpu_usage(): |
| ########## | |
| # Win10 Initial Setup Script | |
| # Author: Disassembler <[email protected]> | |
| # Version: 1.4, 2016-01-16 | |
| # | |
| # Modifications and video from CraftComputing : https://www.youtube.com/watch?v=PdKMiFKGQuc&ab_channel=CraftComputing | |
| # | |
| ########## | |
| # Ask for elevated permissions if required |
| name: Build | |
| on: [push] | |
| jobs: | |
| build_latex: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Git repository | |
| uses: actions/checkout@v1 | |
| - name: Install TeX Live packages # (Note that you may don't need some of them) | |
| run: sudo apt install -y texlive-base texlive-xetex texlive-lang-chinese latexmk |
| import streamlit as st | |
| from persist import persist, load_widget_state | |
| def main(): | |
| if "page" not in st.session_state: | |
| # Initialize session state. | |
| st.session_state.update({ | |
| # Default page. | |
| "page": "home", |
| #!/bin/sh | |
| # https://dl.ubnt.com/unifi/5.11.46/unifi_sh_api | |
| #username=ubnt | |
| #password=ubnt | |
| #baseurl=https://unifi:8443 | |
| #site=default | |
| #[ -f ./unifi_sh_env ] && . ./unifi_sh_env | |
| cookie=$(mktemp) |