Skip to content

Instantly share code, notes, and snippets.

View mmizutani's full-sized avatar

Minoru Mizutani mmizutani

  • Tokyo
  • 04:42 (UTC +09:00)
View GitHub Profile
@mmizutani
mmizutani / README.md
Created January 23, 2026 14:01 — forked from miklschmidt/README.md
Experimental codex collab/agent orchestration

How to use:

  1. Clone https://github.com/miklschmidt/codex and build codex yourself.
    • i've added devenv in my fork, you can try devenv shell nix build .#packages.<system>.codex-rs (eg. devenv shell nix build .#packages.x86_64-linux.codex-rs)
    • when built, symlink the binary to ~/.local/bin/codex: ln -s $(pwd)/result/bin/codex ~/.local/bin/codex
  2. Add the instructions (.md files) from this gist to .codex/ in the project where you want to test it.
  3. Launch codex --profile orchestrator and ask it to do something.
@mmizutani
mmizutani / init-firewall.sh
Last active June 13, 2025 09:59
Dev Container post create command script to setup firewall for Claude Code (Antropic's original plus some enhancements)
#!/bin/bash
#
# init-firewall.sh - Egress Firewall for Development Container with Claude Code
#
# This script configures iptables to function as a strict egress firewall.
# Its primary purpose is to enhance security by restricting network access from
# within a development container to only a predefined list of essential services
# required for development, such as package managers (npm, Go), source control
# (GitHub), and specific APIs (Anthropic).
# Adapted from https://github.com/anthropics/devcontainer-features/blob/e09d1bb8d0f413fc8e6a5936478939cf2463deec/src/claude-code/init-firewall.sh
@mmizutani
mmizutani / envoy-schema.json
Last active October 11, 2024 13:24 — forked from linux-china/envoy-schema.json
Envoy configuration json schema for Json and Yaml based on Envoy v1.20.1 (e9f36d2)
{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"node": {
"properties": {
"id": {
"type": "string",
"description": "An opaque node identifier for the Envoy node. This also provides the local\n service node name. It should be set if any of the following features are\n used: :ref:`statsd <arch_overview_statistics>`, :ref:`CDS\n <config_cluster_manager_cds>`, and :ref:`HTTP tracing\n <arch_overview_tracing>`, either in this message or via\n :option:`--service-node`."
},
"cluster": {
@mmizutani
mmizutani / l3min.py
Created August 10, 2024 21:04 — forked from awni/l3min.py
"""
A minimal, fast example generating text with Llama 3.1 in MLX.
To run, install the requirements:
pip install -U mlx transformers fire
Then generate text with:
python l3min.py "How tall is K2?"
@mmizutani
mmizutani / sqlite3_disable_referential_to_rails_5.rb
Created July 11, 2024 22:33 — forked from javier-menendez/sqlite3_disable_referential_to_rails_5.rb
Rails 5 initializer for disable foreign keys during `alter_table` for sqlite3 adapter
require 'active_record/connection_adapters/sqlite3_adapter'
#
# Monkey-patch for disable foreign keys during `alter_table` for sqlite3 adapter for Rails 5
#
module ActiveRecord
module ConnectionAdapters
class SQLite3Adapter < AbstractAdapter
@mmizutani
mmizutani / mysql.database.yml
Created September 5, 2017 22:04 — forked from jwo/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
@mmizutani
mmizutani / ocr.sh
Created June 29, 2023 05:18 — forked from doraTeX/ocr.sh
A shell script to perform OCR on images/PDFs using macOS built-in OCR engine
#!/bin/bash
SCRIPTNAME=$(basename "$0")
function realpath () {
f=$@;
if [ -d "$f" ]; then
base="";
dir="$f";
else
base="/$(basename "$f")";
@mmizutani
mmizutani / llama-home.md
Created May 15, 2023 19:12 — forked from rain-1/llama-home.md
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@mmizutani
mmizutani / libreoffice
Created June 8, 2018 09:27 — forked from fintanmm/libreoffice
LibreOffice headless server script
#!/bin/bash
# LibreOffice headless server script
#
# chkconfig: 2345 80 30
# description: headless openoffice server script
# processname: libreoffice
#
# Author: Vic Vijayakumar
# Modified by Federico Ch. Tomasczik
# and then by Mark Pavlichuk