Skip to content

Instantly share code, notes, and snippets.

View czyt's full-sized avatar
🍒
Working as a Coder

虫子樱桃 czyt

🍒
Working as a Coder
View GitHub Profile
@czyt
czyt / PKGBUILD
Created February 20, 2020 05:49 — forked from EHfive/PKGBUILD
给VLC打补丁, 使flac网络文件/流的Content-Type始终为"audio/flac", 以"修复"网易云音乐获取的flac网络文件Content-Type为"audio/mpeg"而导致VLC不能正确识别文件而播放失败的问题
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Sarah Hay <sarahhay@mb.sympatico.ca>
# Contributor: Martin Sandsmark <martin.sandsmark@kde.org>
pkgname=vlc
_vlcver=3.0.6
# optional fixup version including hyphen
_vlcfixupver=
pkgver=${_vlcver}${_vlcfixupver//-/.r}

video subtitle

ffmpeg -i *.mp4 -vf subtitles=*.srt output.mp4

element stream to ts

  • ffmpeg -i audio.aac -i ch2.h264 -acodec copy -vcodec copy -f mpegts out.ts

rtsp 2 rtmp

  • ffmpeg -rtsp_transport tcp -i rtsp://fuck.com/fuck/fuck -c copy -f flv rtmp://shit.com/shit/shit

截图片

@czyt
czyt / hugo-auto-deoply.yml
Created December 11, 2020 08:12 — forked from lisez/hugo-auto-deoply.yml
如何使用 Github Actions 自動部署 Hugo
# link: https://sujingjhong.com/posts/how-to-deploy-hugo-automatically-with-github-actions/
# author: lisez <mm4324@gmail.com>
name: Auto publish to public site
# 只有推送到 master 才自動化
on:
push:
branches:
- master
@czyt
czyt / convert.sh
Created February 5, 2021 04:31 — forked from subwiz/convert.sh
Go HTTP client using pkcs12 certificate
#!/bin/sh
## First convert .p12 cert to certificate and key .pem files:
openssl pkcs12 -in cert.p12 \
-clcerts -nokeys -out usercert.pem
openssl pkcs12 -in cert.p12 \
-nocerts -out userkey.pem -nodes
@czyt
czyt / get_go.sh
Created June 2, 2021 13:14 — forked from Zate/get_go.sh
Shell script to download and install latest golang
#! /bin/bash
# [get_golang.sh](https://gist.github.com/n8henrie/1043443463a4a511acf98aaa4f8f0f69)
# Download latest Golang release for AMD64
# https://dl.google.com/go/go1.10.linux-amd64.tar.gz
set -euf -o pipefail
# Install pre-reqs
sudo apt-get install python3 git -y
o=$(python3 -c $'import os\nprint(os.get_blocking(0))\nos.set_blocking(0, True)')
@czyt
czyt / TinyGoGoRoutine.go
Created July 23, 2021 07:29 — forked from tzechienchu/TinyGoGoRoutine.go
Test TinyGo goroutine on wio terminal
package main
import (
"fmt"
"machine"
"math/rand"
"sync"
"time"
)
@czyt
czyt / custom.css
Created September 26, 2021 05:14 — forked from MitaZ/custom.css
V2EX Custom CSS
/* https://www.v2ex.com/settings */
/* 使用圆角头像 */
img.avatar {
border-radius: 100%;
}
/* 设定顶部栏颜色 */
body,#Top,#Bottom {
background-color:#2b2f3e;
}
/* 设定链接颜色 */

WARNING: interfaces can enumarate differently:

ufw status
#iptables -F
#iptables --table nat --append POSTROUTING --out-interface wlxe0b94db737c9 -j MASQUERADE
#iptables --table nat --append POSTROUTING --out-interface enp0s20u1u1 -j MASQUERADE
iptables --table nat --append POSTROUTING --out-interface enp0s20u1u2 -j MASQUERADE
#iptables --append FORWARD --in-interface enx1cba8c9bbeb5 -j ACCEPT
#iptables --append FORWARD --in-interface enx9884e391a556 -j ACCEPT
iptables --append FORWARD --in-interface enx9884e391a559 -j ACCEPT
@czyt
czyt / dial-pq-via-ssh.go
Created March 8, 2022 15:19 — forked from vinzenz/dial-pq-via-ssh.go
Use postgres via SSH in Golang
package main
import (
"database/sql"
"database/sql/driver"
"fmt"
"net"
"os"
"time"
@czyt
czyt / dial-mysql-via-ssh.go
Created March 8, 2022 15:19 — forked from vinzenz/dial-mysql-via-ssh.go
Using MySQL / MariaDB via SSH in Golang
package main
import (
"database/sql"
"fmt"
"net"
"os"
"github.com/go-sql-driver/mysql"
"golang.org/x/crypto/ssh"