Skip to content

Instantly share code, notes, and snippets.

View XueshiQiao's full-sized avatar
🕶️
WebRTC

xueshi XueshiQiao

🕶️
WebRTC
View GitHub Profile
@XueshiQiao
XueshiQiao / joey_archlinux.toml
Last active May 7, 2024 08:43
Linux_evremap_config
# Config file for evremap (https://github.com/wez/evremap)
# usage:
# sudo target/release/evremap remap /path/to/joey_archlinux.toml
# device_name = "AT Translated Set 2 keyboard"
device_name = "Apple Inc. Magic Keyboard with Touch ID"
# add phys when multiple device_name with same name exists
phys = "usb-0000:02:00.0-6/input1"
# Hold capslock for ctrl, tap for esc
@XueshiQiao
XueshiQiao / run_whisper.sh
Last active March 27, 2024 08:46
Run Whisper
# whisper https://github.com/openai/whisper
# 使用GPU做ASR,因为 1080 显存限制,使用medium比较合适(medium 使用约 5G 显存,大于 10G 显存可以用 large)
# T4 GPU,16G 显存,跑 meidum 时耗比大概 0.36(303 秒的音频用了 108s),显存占用 4.8G,显卡利用率在 85% 左右
# --word_timestamps True --highlight_words True 显示 word-level 的时间戳(不加为 sentence-level)
whisper --model medium --language Chinese --verbose True --word_timestamps True --highlight_words True .\download.mp4
# 使用 CPU
whisper --device cpu --threads 10 --model large --language Chinese --verbose True --word_timestamps True --highlight_words True .\download2.mp4
#include <iostream>
#include <functional>
using namespace std;
// -std=c++17
template <typename In, typename Out>
class Filter {
public:
@XueshiQiao
XueshiQiao / .Xmodmap
Last active August 9, 2022 06:33
Global Vim-like Arrow Mapping configuration using xmodmap on Ubuntu
! ref: https://wiki.archlinux.org/title/Xmodmap
! exec: xmodmap ~/.Xmodmap
! Set Keyboard::Dispatch to 'keyCode' in VSCode, otherwise capslock remapping does't work
! ref: https://github.com/microsoft/vscode/issues/23991
! auto startup with system:
! add following command to 'Startup Applications Preferences' app on Ubuntu
! /bin/bash -c 'xmodmap /home/xueshi/.Xmodmap'
clear lock
! Map Caplock key to Mode_switch key, we use it as 'Hyper' key later
@XueshiQiao
XueshiQiao / cpp_move.cpp
Last active February 12, 2021 17:48
C++ std:move usage sample
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
class SimpleString {
public:
SimpleString(int s, const char* content): size(s+1), string(new char[s+1]) {
for (int i = 0; i < size - 1; i++) {
@XueshiQiao
XueshiQiao / cvim.conf
Last active February 6, 2020 07:04
configuration for Chrome extension cVim
"=======================设置=======================
set smoothscroll
let typelinkhintsdelay = 0
"let showtabindices = 1
let barposition = "top"
let searchlimit = 50
"let hintcharacters = "abc123"
"===============Custom Key maps===================
"打开书签管理器,自动搜索manager(但并不输入回车)
@XueshiQiao
XueshiQiao / plantuml_style.puml
Created August 30, 2019 03:03
Style configuration for PlantUML
'ORIGNAL: https://raw.githubusercontent.com/xuanye/plantuml-style-c4/master/core.puml
@startuml core
!includeurl https://raw.githubusercontent.com/xuanye/plantuml-style-c4/master/colors.puml
' uncomment the following line and comment the first to use locally
'!include colors.puml
!includeurl https://raw.githubusercontent.com/xuanye/plantuml-style-c4/master/skinparam.puml
' uncomment the following line and comment the first to use locally
'!include skinparam.puml
@XueshiQiao
XueshiQiao / ExportNetEaseMusicSongList.js
Last active May 20, 2024 18:12
导出网易云音乐歌单到 AppleMusic / Spotify 等平台
/**
* 使用方法:
* 1. 用 Chrome 打开歌单的 web 页面(可以通过分享拿到链接,链接类似这样:http://music.163.com/playlist?id=xxx&userid=yyy)
* 2. 然后右键“检查”(如果有左上角有 device 选项,需要选择 Laptop 开头的,可以在 Edit/编辑 里添加)
* 3. 在 console 里输入下面脚本,即可输出 “歌曲名 - 歌手名” 格式的内容:
Springsteen - Eric Church
Chattahoochee - Alan Jackson
Baby Now That I Found You - Alison Krauss
Check Yes or No - George Strait
From 88287f270df660645b3f6c813ab3fd7ad522e64c Mon Sep 17 00:00:00 2001
From: KSC-VBU-SR <KSC-VBU-SRE@kingsoft.com>
Date: Wed, 14 Jun 2017 21:33:54 +0800
Subject: [PATCH] The RTMP protocol extensions for H.265/HEVC
---
libavformat/flv.h | 1 +
libavformat/flvdec.c | 16 +++++++++++++---
libavformat/flvenc.c | 29 ++++++++++++++++++++---------
3 files changed, 34 insertions(+), 12 deletions(-)
@XueshiQiao
XueshiQiao / transcode_live_stream.md
Last active May 23, 2018 12:21
拉流+转码+转推一路直播流到另外一个地址
ffmpeg -re -i "源流地址" -vcodec libx264 -acodec copy -vf scale=360:640 -b:v 1.5M -f flv "目标流地址"
  • -re 表示按帧率发送(保持视频按照时间戳发送,否则视频文件将很快传输完毕)  ref:https://trac.ffmpeg.org/wiki/StreamingGuide ref:https://blog.csdn.net/youhongaa/article/details/55004547
  • -i 指定输入源
  • -vcodec libx264 指定编解码器,即便一样这里也不能使用copy,因为下面有 -vf 改变分辨率以及 -b:v 改变码率,都决定了需要重新解码再编码,所以需要指定编解码器
  • -vf scale=360:640 修改分辨率为 360*640 (宽 * 高)