Skip to content

Instantly share code, notes, and snippets.

View COx2's full-sized avatar

Tatsuya Shiozawa COx2

View GitHub Profile
@COx2
COx2 / add_debug_entitlement.sh
Created December 20, 2024 03:45 — forked from talaviram/add_debug_entitlement.sh
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.
@COx2
COx2 / pipewire.md
Created December 20, 2024 03:45 — forked from the-spyke/pipewire.md
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.

@COx2
COx2 / xstartup
Created April 5, 2024 04:03 — forked from ppoffice/xstartup
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
@COx2
COx2 / pulse_sreaming.md
Created April 4, 2024 14:53 — forked from savegame/pulse_sreaming.md
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

@COx2
COx2 / TransparentOpenGLComponent.cpp
Created August 27, 2023 15:15 — forked from yairchu/TransparentOpenGLComponent.cpp
Transparent OpenGL Component for JUCE
#include "TransparentOpenGLComponent.h"
using namespace juce;
TransparentOpenGLComponent::TransparentOpenGLComponent()
{
openGLContext.setComponentPaintingEnabled (true);
openGLContext.setRenderer (this);
openGLContext.setContinuousRepainting (true);
openGLContext.attachTo (*this);
@COx2
COx2 / download.sh
Created July 21, 2023 11:45 — forked from josh-padnick/download.sh
Download a private binary release file from GitHub in bash
#!/usr/bin/env bash
#
# This is an adaptation of code I wrote to download a private binary from GitHub. Such...pain.
# Why can't GitHub just offer a standardized URL you can download a release binary from and attach
# your Github Personal Access Token as a header?
#
# Since this code is an adaptation it hasn't been directly tested, but the code it was adapted from works
# and hopefully you can get the missing piece you're after by looking here.
#
@COx2
COx2 / ffmpeg.md
Created January 26, 2023 06:44 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
@COx2
COx2 / ffmpeg.md
Created January 26, 2023 06:44 — forked from euske/ffmpeg.md
FFmpeg チートシート
@COx2
COx2 / gist:947b1a21637fdf54b52531322172134c
Created June 20, 2022 07:04 — forked from ykst/gist:6e80e3566bd6b9d63d19
WebAudio+WebSocketでブラウザへの音声リアルタイムストリーミングを実装する

WebAudio+WebSocketでブラウザへの音声リアルタイムストリーミングを実装する

WebRTCでやれよ!と言われそうなところですが、 WebSocket+WebAudioの組み合わせで音声ストリーミングをシンプルに構成する方法を紹介してみます。

サーバーサイド(Node.js + ws + pcm)

サーバーサイドは何でも良いのですが、 とりあえずNode.jsでtest.mp3というサンプルファイルをpcmモジュールでデコードし、 wsでクライアントに垂れ流す作りにしておきます。

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

これは何?

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

  • WebCodecs
  • Insertable Stream for MediaStreamTrack

使い方

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