Skip to content

Instantly share code, notes, and snippets.

View COx2's full-sized avatar

Tatsuya Shiozawa COx2

View GitHub Profile
@savegame
savegame / pulse_sreaming.md
Last active April 22, 2025 20:50
PulseAudio / PipeWire streaming audio from Client to remote PulseAudio / PipeWire Server

We have Server machine, this computer with Headphones, and we have Client computer, this is remote PC with music =) On Server we should first open port for listening connections from Client :

# on ubuntu 
sudo ufw allow from <Client_IP> to any port 4656 proto tcp
# on fedora ( with firewalld ) 
sudo firewall-ctl --add-port 4656/tcp

note: port 4656 just for sample. you can use any port you want
than on Server, from current user add listening for connections

@ppoffice
ppoffice / xstartup
Last active April 30, 2025 03:43
VNC xstartup for Ubuntu Desktop (Gnome)
#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
export DESKTOP_SESSION=/usr/share/xsessions/ubuntu.desktop
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
dbus-launch --exit-with-session /usr/bin/gnome-session --systemd --session=ubuntu
@the-spyke
the-spyke / pipewire.md
Last active May 14, 2025 09:39
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@monyone
monyone / LIVE_FOR_WEBCODECS.md
Last active June 13, 2022 06:27
TSライブ再生実験 (used by Insertable Stream for MediaStreamTrack)

これは何?

Chrome M94 で追加された以下のAPIを使ったTSのライブ再生用デモ実装

  • WebCodecs
  • Insertable Stream for MediaStreamTrack

使い方

mpgets.js と同じような構成で (max_delay はリップシンクのため 0 推奨, データストリームは入れない事を推奨)

import pyworld as pw
import pysptk
from scipy.io import wavfile
import numpy as np
fs, x = wavfile.read(pysptk.util.example_audio_file())
assert fs == 16000
wavfile.write('./orig.wav', fs, x)
# shortからfloatに変換します
@talaviram
talaviram / add_debug_entitlement.sh
Last active May 12, 2025 11:00
Simple Utility Script for allowing debug of hardened macOS apps.
#! /bin/bash
# Simple Utility Script for allowing debug of hardened macOS apps.
# This is useful mostly for plug-in developer that would like keep developing without turning SIP off.
# Credit for idea goes to (McMartin): https://forum.juce.com/t/apple-gatekeeper-notarised-distributables/29952/57?u=ttg
# Update 2022-03-10: Based on Fabian's feedback, add capability to inject DYLD for sanitizers.
#
# Please note:
# - Modern Logic (on M1s) uses `AUHostingService` which resides within the system thus not patchable and REQUIRES to turn-off SIP.
# - Some hosts uses separate plug-in scanning or sandboxing.
# if that's the case, it's required to patch those (if needed) and attach debugger to them instead.
@voluntas
voluntas / webrtc_non_browser.rst
Last active January 21, 2021 05:06
ブラウザ以外で WebRTC を利用する

ブラウザ以外で WebRTC

日時:2018-04-29
作:@voluntas
バージョン:18.4.0
url:https://voluntas.github.io/

クライアント側の WebRTC には明るくないため、

@ed95
ed95 / EmojiJUCE.h
Created March 29, 2018 16:33
A simple JUCE app using emojis
/*******************************************************************************
The block below describes the properties of this PIP. A PIP is a short snippet
of code that can be read by the Projucer and used to generate a JUCE project.
BEGIN_JUCE_PIP_METADATA
name: EmojiJUCE
vendor: JUCE
website: http://juce.com
@ed95
ed95 / juce_EmojiDefines.h
Last active November 29, 2019 19:49
C++/JUCE emoji defines
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
@tmorioka
tmorioka / 00_HowToClonePrivateRepos.md
Last active March 18, 2025 03:19
Dockerビルド時に, GitHubのPersonal access tokenを使ってプライベートリポジトリをクローンする

概要

Dockerビルド時にプライベートリポジトリをクローンする方法は色々考えられる.

  1. 秘密鍵を ADD してリポジトリをクローン, 終えたら削除(ssh経由)
  2. --build-arg で秘密鍵情報を渡してリポジトリをクローン, 終えたら削除(ssh経由)
  3. --build-arg でユーザ名, パスワードを渡してリポジトリをクローン(https経由)
  4. ユーザ名, パスワードを記した ~/.netrcADD してリポジトリをクローン, 終えたら削除(https経由)

上記で挙げた方法のなかには, セキュリティの点から好ましくないものもある.