Skip to content

Instantly share code, notes, and snippets.

View bloatfan's full-sized avatar
🤒
Out sick

bloatfan bloatfan

🤒
Out sick
View GitHub Profile
@bloatfan
bloatfan / post.lua
Last active November 28, 2025 17:01
wrk post
local threads = {}
wrk.headers['nonce'] = '1'
wrk.headers['sign'] = '1'
wrk.headers['token'] = '1'
wrk.headers['timestamp'] = '1'
setup = function (thread)
table.insert(threads, thread)
end
@bloatfan
bloatfan / vmnetcheck.sh
Last active November 28, 2025 17:18
vmnetcheck.sh
#!/bin/bash
############################################
# 云服务器带宽检查脚本
#
#version:1.2
#使用方法:
#例:./vmnetcheck.sh [em2|em1]
#
#参数说明:
#不写参数时,默认检查外网网卡em1
@bloatfan
bloatfan / remove.sh
Last active December 29, 2018 08:27
#!/bin/bash
# https://www.linuxidc.com/Linux/2017-12/149752.htm
TRASH_DIR="/root/.trash"
basepath_array=(
/
)
@bloatfan
bloatfan / go_graceful_restart.go
Last active April 12, 2021 14:45
[Go平滑重启实现的Demo]
// https://juejin.im/post/5b3629cbf265da59645b1ac5
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"net"
@bloatfan
bloatfan / ubuntu-lxc
Last active November 28, 2025 17:19
ubuntu-lxc
# network.yaml
network:
version: 2
renderer: networkd
ethernets:
enp9s0:
addresses:
- 192.168.1.13/24
gateway4: 192.168.1.1
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ll='ls -al'
# Source global definitions
glide mirror set https://golang.org/x/text https://github.com/golang/text
@bloatfan
bloatfan / bash-zsh-auto-complete.sh
Last active May 26, 2021 15:20
bash 补全文件
# bash
https://stackoverflow.com/questions/33632668/bash-tab-completion-of-filenames-after-arguments
complete -D -o default
# zsh
https://unix.stackexchange.com/questions/333530/zsh-path-file-name-completion-on-file-arguments/333543#333543?newreg=65c5031ab2d6429984db9f2c4a26ac3c
@bloatfan
bloatfan / mobile-hls-video.html
Created April 9, 2018 13:14 — forked from ufologist/mobile-hls-video.html
Web 前端如何播放 HLS(.m3u8) 视频
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Mobile HLS video</title>
</head>
<body>
<h1>Mobile HLS video</h1>
// Copyright © 2016 Alan A. A. Donovan & Brian W. Kernighan.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
// See page 333.
// Package display provides a means to display structured data.
package display
import (
"fmt"