Skip to content

Instantly share code, notes, and snippets.

View BruceZhang1993's full-sized avatar
🐰
Eating a wolf

Bruce Zhang BruceZhang1993

🐰
Eating a wolf
View GitHub Profile
@tinywrkb
tinywrkb / btswitch
Last active February 6, 2024 10:09
NOT NEEDED WITH 0.3.21 OR GIT VERSION | PipeWire Pulse Server Bluetooth Auto-Switch
#!/bin/bash
#
# ~/.local/bin/btswitch
#
# wait a second this is too fast for udev
sleep 1
btdev="$(pactl list sinks|grep Name|grep 'bluez.*.a2dp.sink'|sed 's/Name: //'|sed 's/\s//')"
if [ -n "$btdev" ]; then
@HugoGresse
HugoGresse / adbx
Last active November 27, 2022 11:19
Adb command to set proxy (WIP)
#!/bin/bash
usage() {
echo "Usage:"
echo " adbx proxy set"
echo " adbx proxy get"
echo " adbx proxy remove"
}
@isaactzab
isaactzab / stream-audio-to-kodi.md
Last active January 24, 2021 22:40
Streaming Audio From Linux to Raspbmc
A backup from (http://westmarch.j5int.com/2014/04/streaming-audio-linux-to-raspbmc/)
Posted on April 12, 2014 by matth

Streaming Audio From Linux to Raspbmc

Early in 2014, I finally got around to turning my Raspberry Pi in to a little XMBC media centre by installing Raspbmc. Which was fun. And also easy. Perhaps a little too easy: I’m a bit of a nerd, so it didn’t take long to get bored of just playing regular type media off the external hard drive. Part of the reason I have a Raspberry Pi, is for the fun of thinking of what relatively useless thing I might potentially do with it next, and then spending (wasting?) many hours trying to do it. So, as I was trying to decide what to do next, I considered the fact that I fairly often like to play music on my PC while I’m working. And my sound system is now hooked up to the Raspberry Pi. So it would be most convenient if I could just deliver the sound across my network for Raspbmc to play for me. I was running Ubuntu 13.10 – Saucy Salamander – at the tim

@sfan5
sfan5 / alpine-container.sh
Last active April 27, 2024 18:35
bootable systemd-nspawn containers with Linux distributions: Alpine, Arch Linux, Ubuntu
#!/bin/bash -e
# Creates a systemd-nspawn container with Alpine
MIRROR=http://dl-cdn.alpinelinux.org/alpine
VERSION=${VERSION:-v3.19}
APKTOOLS_VERSION=2.14.3-r1
wget_or_curl () {
if command -v wget >/dev/null; then
@BruceZhang1993
BruceZhang1993 / voice.py
Created April 3, 2016 09:11
Baidu tts and voice recognize Python3 implements
#!/usr/bin/env python3
# coding: utf-8
import requests, json, os, subprocess, sys
import uuid
import pyaudio
import wave
import signal
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active February 19, 2024 21:55
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');