Skip to content

Instantly share code, notes, and snippets.

@yougg
yougg / command.md
Created April 4, 2022 12:53
Command Note

Command Note

软路由

@yougg
yougg / topics.go
Created March 11, 2021 09:09
list/create kafka topic in go
//go:generate go env -w CGO_ENABLED=0 GOPROXY="https://goproxy.cn|https://goproxy.io|direct"
//go:generate rm go.*
//go:generate go mod init kafka.topic
//go:generate go mod tidy
//go:generate go build -trimpath -buildmode pie -installsuffix netgo -tags "osusergo netgo static_build" -ldflags "-s -w -extldflags '-static'" ${GOFILE}
package main
import (
"flag"
"fmt"
@yougg
yougg / monitor.go
Last active April 25, 2021 02:55
Simple monitor for running multi process in docker scratch image
//go:generate go build -trimpath -buildmode pie -installsuffix netgo -tags "osusergo netgo static_build" -ldflags "-s -w -extldflags '-static'" -o monitor ${GOFILE}
package main
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"os"
"os/exec"
@yougg
yougg / qq_nickname.md
Last active March 25, 2020 14:42
通过QQ空间个人资料修改QQ昵称为空格过程记录
  1. 登陆自己的QQ空间 https://qzone.qq.com/

  2. 进入个人档,点击修改基本资料

  3. 在昵称处填入一个到多个Unicode空格

  4. 点击最下方的保存按钮,此时会弹框提示很抱歉,昵称不能全为空,请重新输入

    • 按Chrome F12或者Ctrl+Shift+I快捷键打开开发者工具窗口
  • 进入Network标签页,先点击Clear清理一下之前的请求记录
@yougg
yougg / hibernate.md
Last active December 16, 2020 04:16
Ubuntu 19.04 enable hibernate

Enable hibernate with swapfile on Ubuntu 19.04

Install hibernate and other dependencies which are needed to hibernate

sudo apt install hibernate

Create the swap file

@yougg
yougg / dump.go
Created August 16, 2019 08:39
Dump goroutine stack by signal
package dump
import (
"fmt"
"os"
"os/signal"
"runtime"
"syscall"
)
@yougg
yougg / deepin_non-free.md
Last active June 29, 2021 01:20
Ubuntu中通过Deepin软件源安装非自由软件 wps-office deepinwine-qq sogoupinyin等

添加deepin软件源GPG key

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 425956BB3E31DF51

添加deepin软件源中非自由软件

sudo add-apt-repository 'deb http://packages.deepin.com/deepin stable non-free'
@yougg
yougg / detectrun.go
Created June 20, 2019 13:43
Detect if windows golang executable file is running via double click or from cmd/shell terminator
// +build windows
//go:generate go build -ldflags "-s -w -extldflags '-static'" $GOFILE
package main
import (
"fmt"
"syscall"
"unsafe"
)