会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
熊先生的博客
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
下一页
2023年12月4日
处理golang gin框架下载文件时中文文件名乱码问题
摘要: func Download(c *gin.Context) { c.Writer.WriteHeader(http.StatusOK) //设置文件类型 c.Header("Content-Type", "application/vnd.ms-excel;charset=utf8") // Path
阅读全文
posted @ 2023-12-04 18:24 熊先生不开玩笑
阅读(622)
评论(0)
推荐(0)
2023年11月23日
centos 和ubuntu 配置ssh key登录。
摘要: vim /etc/ssh/sshd_config RSAAuthentication yes #开启RSA验证 PubkeyAuthentication yes #使用公钥验证 AuthorizedKeysFile .ssh/authorized_keys #公钥保存位置 所以需要把公钥写到 对应用
阅读全文
posted @ 2023-11-23 19:58 熊先生不开玩笑
阅读(64)
评论(0)
推荐(0)
2023年4月8日
用Cloudflare做域名重定向
摘要: 在域名提供商处设置域名的DNS解析服务器为Cloudflare的DNS域名服务器。 在DNS 的Records中先为域名设置一条A记录解析,IPV4 地址可以随意填写。因为后续要做定向。 在Rules 的Page Rules中添加一条,URL为“www.yourhost.top/*”,Pick a
阅读全文
posted @ 2023-04-08 21:29 熊先生不开玩笑
阅读(631)
评论(0)
推荐(0)
2023年4月4日
nginx配置媒体文件Content-Type
摘要: 用nginx做代理用来做多媒体文件的下载,因为有些文件名后缀类型没有匹配。所以返回个请求端的响应头会是: Content-Type: application/octet-stream,给请求端造成困扰。例如:acc 文件需要是: Content-Type: audio/aac,wav 文件需要是:C
阅读全文
posted @ 2023-04-04 11:31 熊先生不开玩笑
阅读(2659)
评论(0)
推荐(0)
2023年4月2日
nginx 下监听同一端口通过路径转发不同服务
摘要: 注意 v1d2 最优先匹配 server { listen 80; server_name localhost; location /v1d2 { proxy_pass http://127.0.0.1:8088; } location / { root /data/dist; try_files
阅读全文
posted @ 2023-04-02 22:31 熊先生不开玩笑
阅读(665)
评论(0)
推荐(0)
ubuntu下配置supervisor 运行golang打包后的可执行文件
摘要: apt update apt install supervisor vim /etc/supervisor/supervisord.conf 添加如下配置: command 配置成可执行文件的路径,directory为文件所在目录 [program:tempupService] command= /
阅读全文
posted @ 2023-04-02 22:24 熊先生不开玩笑
阅读(185)
评论(0)
推荐(0)
2023年3月30日
golang 判断目录存在、修改权限等
摘要: func main() { // 修改文件所属组 os.Chown( filename, uid, gid) } // 检查目录是否存在 func checkDirExist(path string) (bool, error) { s, err := os.Stat(path) if err !=
阅读全文
posted @ 2023-03-30 23:56 熊先生不开玩笑
阅读(54)
评论(0)
推荐(0)
2023年3月19日
一段多协程处理日志文件的代码
摘要: package main import ( "bufio" "encoding/csv" "flag" "fmt" "os" "regexp" "sort" "strings" "sync" "time" ) type BatteryPercent struct { Timestamp int64
阅读全文
posted @ 2023-03-19 15:29 熊先生不开玩笑
阅读(32)
评论(0)
推荐(0)
2023年2月28日
vim 快捷键
摘要: | 操作 | 键位 | |: |: | | 删除/剪切一行 | dd | | 删除/剪切当前开始的n行 | ndd | | 删除/剪切光标之后的一个字/单词部分 | dw | | 删除/剪切光标之后的n个字/单词部分 | ndw | | 删除/剪切当前字符 | x | | 删除/剪切光标到行尾 |
阅读全文
posted @ 2023-02-28 11:52 熊先生不开玩笑
阅读(48)
评论(0)
推荐(0)
2022年9月14日
vim 小记录
摘要: 将str1批量替换成str2 , 特殊符号前用转译符 \ :%s/str1/str2/g
阅读全文
posted @ 2022-09-14 16:00 熊先生不开玩笑
阅读(14)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
下一页
公告