Skip to content

Instantly share code, notes, and snippets.

@shirayu
shirayu / 0.Play Audio and Desktop Notifications from Docker or Podman Containers.md
Last active July 10, 2026 02:19
Play Audio & Desktop Notifications from Docker / Podman Containers

Play Audio and Desktop Notifications from Docker / Podman Containers

This guide explains how to play audio and send desktop notifications from a Debian- or Ubuntu-based container to a native Linux desktop host.

The setup shares two UNIX sockets from the host desktop session:

  • The PulseAudio socket, or PipeWire’s PulseAudio-compatible socket, for audio playback
  • The session D-Bus socket for desktop notifications

A Python verification script checks the socket mounts, sends a test notification, generates a short WAV tone, and plays it through the host audio server.

@shirayu
shirayu / SKILL.md
Created June 27, 2026 11:14 — forked from k16shikano/SKILL.md
japanese-tech-writing/SKILL
name japanese-tech-writing
description 日本語の技術文書・書籍原稿の文章規範。整形(一文一行、引用ブロック、脚注、コラム記法)、段落と論証の構成(パラグラフライティング)、論証の厳密さ(ツッコミどころの除去)、読み手の負荷の管理、視点と語り、演出の抑制、LLM っぽい空句の禁止、冗長の排除を定める。日本語で技術書の章、草稿、記事、解説文を書くとき、または推敲・リライトするときに使用する。

日本語技術文書の文章規範

日本語で技術的な原稿(書籍の章、記事、解説文)を書く・推敲するときは、以下の規範に従う。

整形

package main
import (
"fmt"
"time"
)
type fileType uint32
const (
@shirayu
shirayu / 1.md
Created June 30, 2024 10:14
How to fix `Connection refused` by open-webui

Open WebUI (Formerly Ollama WebUI)

Error

$  docker logs open-webui 

...

ERROR:apps.ollama.main:Connection error: Cannot connect to host host.docker.internal:11434 ssl:default [Connection refused]
@shirayu
shirayu / co2monitor.py
Created September 8, 2023 11:46
UD-CO2S にシリアル接続して結果をJSONで配信するウェブサーバー
#!/usr/bin/env python3
import argparse
import datetime
import json
import re
import threading
from http.server import BaseHTTPRequestHandler, HTTPServer
from pathlib import Path
import serial
@shirayu
shirayu / dl.py
Last active August 31, 2023 00:44
ReazonSpeech Dataset
#!/usr/bin/env python3
import time
from datasets import load_dataset
while True:
try:
ds = load_dataset("reazon-research/reazonspeech", "all")
except Exception as e:
#!/usr/bin/env python3
from transformers import AutoTokenizer
def main() -> None:
txt: str = "鯯を食べたい"
m1 = "rinna/japanese-gpt-neox-3.6b-instruction-ppo"
@shirayu
shirayu / Linux on WSL2.md
Last active May 27, 2023 06:52
Tips to run on Linux in Windows WSL2
@shirayu
shirayu / TensorRT + Ubuntu 22.04 (on WSL2).md
Last active June 20, 2025 01:36
TensorRT + Ubuntu 22.04 (on WSL2)

TensorRT + Ubuntu 22.04 (on WSL2)

I received the following warnings related to libnvinfer.so.7 and libnvinfer_plugin.so.7

W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: xxxxx
W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: xxxxx
W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
@shirayu
shirayu / bookmarklet-en.txt
Last active November 2, 2022 03:34
google meetのPIPを呼ぶ
javascript:document.querySelector('button[aria-label="More options"]').click();new MutationObserver((m,o) => { const p = Array.from(document.querySelectorAll("span")).find( (el) => el.textContent === "Open picture-in-picture mode" ); if (p) { p.click(); o.disconnect(); }}).observe(document.getElementsByTagName("body")[0], { childList: true, subtree: true,});