Skip to content

Instantly share code, notes, and snippets.

View zhiyue's full-sized avatar
🌻
just do it.

zhiyue zhiyue

🌻
just do it.
View GitHub Profile
@zhiyue
zhiyue / docker-compose.yaml
Created May 30, 2022 11:30 — forked from fogx/docker-compose.yaml
Broken Traefik - Cloudflare
version: "3"
services:
traefik:
#https://www.smarthomebeginner.com/traefik-2-docker-tutorial/
image: traefik:latest
container_name: traefik
command: # CLI arguments
- --global.sendAnonymousUsage=false
- --api=true

ws: a Node.js WebSocket library

Version npm Build Windows x86 Build Coverage Status

ws is a simple to use, blazing fast, and thoroughly tested WebSocket client and server implementation.

@zhiyue
zhiyue / tmcleanup.md
Created May 6, 2022 07:28 — forked from blanboom/tmcleanup.md
Script to automatically remote old Mac OSX Time Machine Backups older than a specified number of days

Prerequisites

  • gfind (via brew install findutils)
  • Time Machine drive mounted on your computer (or you can change path from standard /Volume/Time\ Machine\ Backups/Backups.backup.db/
  • Admin/sudo access in the OSX terminal

Script

  • Be sure to set the correct machine name. You can check the actual folder things are going into by looking in the backup location.
  • By default, it erases all backups older than 30 days. Adjust as desired.
@zhiyue
zhiyue / cloudflared.yaml
Created April 8, 2022 07:51 — forked from a1994sc/cloudflared.yaml
cloudflared - k3s
---
apiVersion: apps/v1
#kind: Deployment
kind: DaemonSet
metadata:
name: cloudflared
namespace: ingress
labels:
group: cloudflare
spec:
@zhiyue
zhiyue / xiaoxiao_tts.py
Created April 7, 2022 07:30 — forked from Lulalaby/xiaoxiao_tts.py
superb edit of an old parameterless script
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Edge Microsoft TTS for Python."""
import sys
from ws4py.client.threadedclient import WebSocketClient
import binascii
import argparse
import json
import requests
import re
@zhiyue
zhiyue / xiaoxiao_tts.py
Created April 7, 2022 06:59 — forked from xjohjrdy/xiaoxiao_tts.py
返回的音频没有文件头,所以我随便加的一个文件头,但显示的音频时长有问题。如果播放器不能正常播放,可以使用Chrome播放。
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from ws4py.client.threadedclient import WebSocketClient
import binascii
class WSClient(WebSocketClient):
def __init__(self, url, text, filename):
@zhiyue
zhiyue / setup-python3.8-via-ppa.sh
Created April 1, 2022 06:08 — forked from ptantiku/setup-python3.8-via-ppa.sh
Setup Python3.8 in Ubuntu Xenial (16.04 LTS). The python version was fixed at Python 3.5.1
#!/bin/sh
# install PPA
sudo add-apt-repository ppa:deadsnakes/ppa
# update and install
sudo apt update
sudo apt install python3.8 python3.8-dev python3.8-venv
# setup alternatives
@zhiyue
zhiyue / GitConfigHttpProxy.md
Created March 29, 2022 08:49 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@zhiyue
zhiyue / SpaceFn.json
Created November 2, 2021 06:37 — forked from tshu-w/SpaceFn.json
Karabiner Elements config to simulate SpaceLauncher
{
"title": "SpaceFN",
"rules": [
{
"description": "SpaceFN: Space enables SpaceFN mode (see: https://geekhack.org/index.php?topic=51069.0)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar"
@zhiyue
zhiyue / SpaceFn.json
Created November 2, 2021 06:37 — forked from tshu-w/SpaceFn.json
Karabiner Elements config to simulate SpaceLauncher
{
"title": "SpaceFN",
"rules": [
{
"description": "SpaceFN: Space enables SpaceFN mode (see: https://geekhack.org/index.php?topic=51069.0)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar"