Skip to content

Instantly share code, notes, and snippets.

View banyudu's full-sized avatar
🎯
Focusing

Yudu banyudu

🎯
Focusing
View GitHub Profile
@banyudu
banyudu / git进阶.blog.md
Last active March 4, 2020 18:59
Git进阶

Git进阶

剖析Git Commit

Commit中有什么内容?

使用 git show 可以看到一条commit的详情:

如下所示:

@banyudu
banyudu / Serverless域名管理方案.blog.md
Last active November 29, 2020 07:48
Serverless域名管理方案

引言

Serverless应用一般都是微服务架构,项目会比较多,域名管理比较复杂。

本文提出了一种便捷的Serverless应用域名管理方案。

此方案基于 AWS 平台,使用 Serverless 框架及其周边生态实现。使用其它平台或框架的读者请酌情参考。

@banyudu
banyudu / nginx.conf
Created January 8, 2020 02:39
nginx proxy_pass rewrite prefix
location /foo {
rewrite /foo/(.*) /$1 break;
proxy_pass http://localhost:3200;
proxy_redirect off;
proxy_set_header Host $host;
}
@banyudu
banyudu / nginx.conf
Created January 8, 2020 02:50
nginx.conf with backend and frontend
# replace ${server} with backend host.
# sed -i -e 's/\${server}/my-backend.my-domain.com/' nginx.conf
upstream backend {
server ${server}; # this line will be replaced with real value
}
server {
location / {
root /var/www;
index index.html;
@banyudu
banyudu / use_aliyun_apt_mirror.sh
Created January 8, 2020 10:36
use aliyun apt mirror instead of official to speed up
sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list \
&& sed -i s@/security.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list \
&& sed -i s@/security.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
@banyudu
banyudu / axios_proxy.ts
Created February 3, 2020 08:06
setup axios proxy with shadowsocks
// change host / port / protocol to your real values
const axiosOptions: AxiosRequestConfig = {}
const httpsAgent = new SocksProxyAgent({
host: '127.0.0.1',
port: 1086,
protocol: 'socks5:',
rejectUnauthorized: false
})
axiosOptions.httpAgent = httpsAgent
@banyudu
banyudu / daemon.conf
Created February 16, 2020 06:49
Docker registry for china
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
@banyudu
banyudu / README.md
Created February 17, 2020 13:36 — forked from chuyik/README.md
macOS 给 Git(Github) 设置代理(HTTP/SSH)
@banyudu
banyudu / .metadata_never_index
Created February 21, 2020 16:20
macOS中对指定目录禁用 mds 索引
在开发前端应用时,经常会安装 node_modules,文件系统中突然增加很多细碎的文件。
有时候这会触发macOS的自动索引,即 mds 进程,耗费大量的CPU。
有一个方法可以禁用mds对此目录的监听,建立一个名为 .metadata_never_index 的文件即可
@banyudu
banyudu / create_blog_with_serverless_framework.blog.md
Last active March 2, 2021 07:07
使用Serverless框架搭建博客

动机

最近在学习Serverless相关技术,打算使用Serverless框架搭建出一套博客系统,一方面学习Serverless,另一方面也尝试做一个更好的博客系统。

规划