Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
read -p "centos install nfs, server is [s] and client is [c]: " TYPE
if [ "s" == "${TYPE}" ]; then
read -p "need close firewalld: " CLOSE_FIREWALLD
if [ -z "${CLOSE_FIREWALLD}" ]; then
systemctl stop firewalld
fi
read -p "need clese iptables: " CLOSE_IPTABLES
#!/bin/bash
# 查看磁盘
df -h
# 格式磁盘 ---> fat32
DISK_NAME=disk2
diskutil partitionDisk ${DISK_NAME} 1 MBR fat32 NEW 100%
#!/usr/bin/env bash
function mac() {
export CGO_ENABLED=1
export CC=clang
export CXX=clang++
export GOOS=darwin
export GOARCH=amd64
}
@bzeron
bzeron / certbot
Last active August 10, 2019 04:09
#!/bin/bash
if [ -z "$1" ]; then
echo "请输入域名"
exit -1
fi
domin=$1
# dns 配置方法
# see https://certbot.eff.org/docs/using.html#dns-plugins
docker run -it --rm \
--name certbot \
查询备份
sudo tmutil listlocalsnapshots /
删除备份
tmutil deletelocalsnapshots {日期}
package skip_list
import (
"fmt"
"math/rand"
"time"
)
const (
Max = 32
@bzeron
bzeron / git-note.md
Created December 20, 2019 05:37 — forked from sh7ning/git-note.md
Git使用笔记

Git分支开发工作流

git 配置

  1. git配置:
    git config --global user.name <用户名>
    git config --global user.email <邮箱>
    git config --global push.default simple
    git config --global credential.helper store #不用每次都输入密码
    

如果你的主机有多块网卡,你可能会需要把 Docker 容器绑定到指定网卡,以使容器内的所有网络请求都经过该指定网卡发送至外网。

不幸的是,Docker 并没有直接提供实现该需求的方法。不过,通过 iptables 可以轻松搞定。

一刀切 假设你的主机上有两块网卡:一块网卡的 IP 地址是 192.168.0.100 ;另一块网卡的 IP 地址是 10.0.0.100 。你想让这台主机上的 Docker 容器内的所有服务都走第二块网卡进出外网。

先给出答案再解释:

复制代码代码如下:

@bzeron
bzeron / GethBEHAVE.md
Created July 11, 2022 04:07 — forked from yorickdowne/GethBEHAVE.md
Pruning Geth 1.10.x

Overview

Geth (Go-Ethereum) as of January 2022 takes about 500 GiB of space on a fast/snap sync, and then grows by ~ 10 GiB/week. This will fill a 1TB SSD in ~6 months, to the point where space usage should be brought down again with an offline prune.

Happily, Geth 1.10.x introduces "snapshot offline prune", which brings it back down to about its original size. It takes roughly 4 hours to prune the Geth database, and this has to be done while Geth is not running.

Caveat that while several folx have used offline pruning successfully, there is risk associated with it. The two failure modes we have seen already are:

  • There is 25 GiB or less of free disk space