Skip to content

Instantly share code, notes, and snippets.

View flydo's full-sized avatar
💭
I may be slow to respond.

飞度 flydo

💭
I may be slow to respond.
View GitHub Profile
@flydo
flydo / main.go
Created October 24, 2023 11:44
飞书/钉钉群机器人通知发送的案例(Go、Shell)https://www.idev.top/d/385
/**
# 飞书/钉钉群机器人通知发送的案例
1. 创建文件夹 `test`
2. 将下述代码粘贴至 test 目录下的 `main.go` 文件中
3. 执行 `go mod tidy test`,创建 `module` 方式
4. 使用 `go run main.go -u "https://open.feishu.cn/xxx" -s "Secret" -m "Message" -t 1234567890` 方式发送通知消息(-t 部分可省略)
5. 执行 `go build` 生成 `test` 可执行文件
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).MailStats=t()}(this,(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function n(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((t===undefined||null===t)&&n.path)}},n.exports),n.exports}var i,o,r=function(e){return e&&e.Math==Math&&e},a=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||function(){return this}()||Function("return this")(),s=function(e){try{return!!e()}catch(t){return!0}},u=!s((function(){retu
@flydo
flydo / tomp4.sh
Last active February 11, 2022 07:59
将视频转换为 mp4 格式
#!/bin/bash
##
## 用法:
## tomp4.sh 忽略参数时,默认为将当前目录下的所有 rmvb 格式视频转换为 mp4 格式
## tomp4.sh . .wmv : 将当前目录下的所有 wmv 格式视频转换为 mp4 格式
## tomp4.sh a.avi .avi 将 a.avi 视频转换为 mp4 格式
##
## -c:a mp3 mp3 可修改为 aac 等音频格式码。
## -c:v libx265 libx265 可修改为 h264、libx264 (H.264 格式)和 libx265 (H.265 格式),其中 H.265 占用资源比 H。264 少一倍。
@flydo
flydo / get_latest_release.sh
Created September 25, 2021 08:45 — forked from lukechilds/get_latest_release.sh
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@flydo
flydo / xiuno2flarum.php
Last active April 16, 2024 06:41
xiunobbs to flarum
<?php
/**
* # XiunoBBS 转 Flarum
* ## 使用说明
* ### 注意:本程序只转移 主题、帖子和版块,不转会员
*
* 1. 将本文件上传到两个网站共同的服务器(只要支持两个站的数据库连接均可)
* 2. 复制 xiunobbs 下的 conf/conf.php 到本目录,或者自己修改以下的引入路径
* 3. 复制 flarum 下的 config.php 到本目录,或者自己修改以下的引入路径
package main
import (
"crypto/md5"
"encoding/hex"
"crypto/hmac"
"crypto/sha1"
)
func Md5String(data string) string {
package main
import (
"crypto/md5"
"crypto/sha1"
"encoding/hex"
"math/rand"
"strconv"
"time"
)
@flydo
flydo / issue_deploy.sh
Last active October 24, 2023 11:48
acme.sh 证书创建与部署
#!/usr/bin/env bash
# 手动安装证书到容器中的 /data/ssl
# https://github.com/acmesh-official/acme.sh/wiki/Run-acme.sh-in-docker
set -eu
BASE_EXEC="docker exec acme.sh"
DOMAIN="${1}"
@flydo
flydo / ip.go
Created August 5, 2019 02:13
IP2Long And Long2IP
package main
import (
"bytes"
"encoding/binary"
"fmt"
"net"
)
func main() {
@flydo
flydo / copy.go
Created July 8, 2019 02:21 — forked from r0l1/copy.go
Copy a directory tree (preserving permissions) in Go.
/* MIT License
*
* Copyright (c) 2017 Roland Singer [roland.singer@desertbit.com]
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions: