Skip to content

Instantly share code, notes, and snippets.

View jan4984's full-sized avatar
🎯
Focusing

JiangYD jan4984

🎯
Focusing
  • moonshot.cn
  • ShangHai
View GitHub Profile
@jan4984
jan4984 / pass.go
Last active June 17, 2022 16:34
add pass to linux game console
package main
import (
"encoding/binary"
"fmt"
"io"
"os"
"strings"
)
@jan4984
jan4984 / pulseaudio-ffmpeg.md
Last active October 18, 2021 21:48
audio over tcp with pulseaudio and ffmpeg

linux(WSL)

  • 永久启用pulseaudio

/etc/pulse/client.conf

autospawn = yes
@jan4984
jan4984 / server.sh
Created July 30, 2021 05:31
vscode wsl2 snap nodejs
cat /home/jan/.vscode-server/bin/c3f126316369cd610563c75b1b1725e0679adfb3/server.sh
#!/usr/bin/env sh
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
case "$1" in
--inspect*) INSPECT="$1"; shift;;
esac
@jan4984
jan4984 / golangci-lint-present.html
Created March 23, 2020 04:16
golangci-lint presention
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>golangci-lint Lint Visualization</title>
<link href="https://unpkg.com/vue-json-tree@0.3.3/dist/json-tree.css" rel="stylesheet">
<script src="https://unpkg.com/vue@2.4.2/dist/vue.js"></script>
<script src="https://unpkg.com/vue-json-tree@0.3.3/dist/json-tree.js"></script>
</head>
<section>
@jan4984
jan4984 / golangci-lint-present.html
Created March 23, 2020 04:16
golangci-lint presention
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>golangci-lint Lint Visualization</title>
<link href="https://unpkg.com/vue-json-tree@0.3.3/dist/json-tree.css" rel="stylesheet">
<script src="https://unpkg.com/vue@2.4.2/dist/vue.js"></script>
<script src="https://unpkg.com/vue-json-tree@0.3.3/dist/json-tree.js"></script>
</head>
<section>
@jan4984
jan4984 / main.go
Created February 17, 2020 11:00
simple txt copy via web
package main
import (
"fmt"
"html/template"
"io/ioutil"
"net/http"
)
var txt = ""
@jan4984
jan4984 / ws-c.cpp
Created August 29, 2019 08:18
websock in simple c++
#include <unistd.h>
#include <assert.h>
#include <iostream>
#include <string>
#include <wslay/wslay.h>
#include <sys/socket.h>
#include <netdb.h>
#include <cstring>
#include <poll.h>
@jan4984
jan4984 / local.go
Last active September 15, 2018 08:51
integer goproxy http proxy server with shadowsocks-go local
//github.com/shadowsocks/shadowsocks-go/cmd/shadowsocks-local/local.go
import "golang.org/x/net/proxy"
import "github.com/elazarl/goproxy"
import "net/http"
func main(){
//...
parseServerConfig(config)
@jan4984
jan4984 / reverse-proxy.go
Created August 21, 2018 17:00
simple proxy for LAN https
package main
import (
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
rpURL, err := url.Parse("http://10.0.0.125:8080")
File.stream!("/home/jan/prjs/opus-codec-service/src/git.ogo.run/opuscodec/testprebuilts/far.opus.dong", [], 1) |> Enum.map(fn bl -> :binary.bin_to_list(bl) |> hd end) |> Enum.each(fn b -> if b >= 128 do IO.write "#{b-256}," else IO.write "#{b}," end end)