Skip to content

Commit

Permalink
update 2022年 8月18日 星期四 19时41分11秒 CST
Browse files Browse the repository at this point in the history
  • Loading branch information
No-Github committed Aug 18, 2022
1 parent 74f6c0a commit 19d81a4
Show file tree
Hide file tree
Showing 37 changed files with 1,136 additions and 331 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**/.DS_Store
push.sh
**/2022.md
/assets/Temp
/1earn/Develop/*
/assets/img/Develop/*
Expand Down
129 changes: 105 additions & 24 deletions 1earn/Integrated/Linux/Power-Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,20 @@
* [butterfly](#butterfly)
* [Cacti](#cacti)
* [Chrony](#chrony)
* [clash](#clash)
* [cloud-torrent](#cloud-torrent)
* [code-server](#code-server)
* [DHCP](#dhcp)
* [DNS](#dns)
* [focalboard](#focalboard)
* [frp](#frp)
* [Kicktart](#kicktart)
* [nps](#nps)
* [OpenVPN](#openvpn)
* [PowerDNS](#powerdns)
* [PowerDNS-Admin](#powerdns-admin)
* [proxychains-ng](#proxychains-ng)
* [ss5](#ss5)
* [SSH](#ssh)
* [ttyd](#ttyd)
* [vnc4server](#vnc4server)
Expand All @@ -50,6 +54,7 @@
* [npm & Node](#npmnode)
* [Nexus](#nexus)
* [Nginx](#nginx)
* [php-cli](#php-cli)
* [phpMyAdmin](#phpmyadmin)
* [RabbitMQ](#rabbitmq)
* [searx](#searx)
Expand Down Expand Up @@ -83,6 +88,7 @@
* [Go](#go)
* [JDK](#jdk)
* [Perl](#perl)
* [PHP](#php)
* [Python3](#python3)
* [pip](#pip)
* [jupyterlab](#jupyterlab)
Expand All @@ -102,6 +108,8 @@
* [Docker](#docker)
* [Docker-Compose](#docker-compose)
* [Docker-Portainer](#docker-portainer)
* [Kubernetes](#kubernetes)
* [kubectl](#kubectl)
* [QEMU](#qemu)

* **[🥕 分布式](#分布式)**
Expand All @@ -114,6 +122,7 @@
* [PhpLdapAdmin](#phpldapadmin)
* [Snort](#snort)
* [Suricata](#suricata)
* [tripwire](#tripwire)

* **[🍷 设施配置](#设施配置)**
* [f8x](#f8x)
Expand Down Expand Up @@ -464,6 +473,19 @@ ctl+b
echo "set-option -g history-limit 3000" >> ~/.tmux.conf # 默认值为2000
```

**保存指定输出**
```bash
# 第 3 个会话 1000 行到 6000 行
tmux capture-pane -S -6000 -E -1000 -t 3
tmux save-buffer output.log
```

```bash
# 保存所有历史输出
tmux capture-pane -S -
tmux save-buffer output.log
```

---

## 网络服务
Expand Down Expand Up @@ -838,6 +860,47 @@ chronyc # 进入交互模式

---

### clash

**项目地址**
- https://github.com/Dreamacro/clash

**部署**
```bash
wget https://github.com/Dreamacro/clash/releases/download/v1.11.4/clash-linux-amd64-v1.11.4.gz
gzip -d clash-linux-amd64-v1.11.4.gz
mv clash-linux-amd64-v1.11.4 /usr/local/bin/clash
chmod +x /usr/local/bin/clash

wget https://raw.githubusercontent.com/wp-statistics/GeoLite2-Country/master/GeoLite2-Country.mmdb.gz
gzip -d GeoLite2-Country.mmdb.gz
mv GeoLite2-Country.mmdb ~/.config/clash/Country.mmdb

vim ~/.config/clash/config.yaml
```

**负载均衡配置**
```yaml
proxy-groups:
- name: "test"
type: load-balance
proxies:
- ss1
- ss2
- vmess1
- vmess2
url: 'http://www.gstatic.com/generate_204'
interval: 300
strategy: round-robin
```
**辅助项目**
- [yichengchen/clashX](https://github.com/yichengchen/clashX)
- [Fndroid/clash_for_windows_pkg](https://github.com/Fndroid/clash_for_windows_pkg)
- [ccg2018/ClashA](https://github.com/ccg2018/ClashA)
---
### cloud-torrent
> web torrent 下载服务
Expand Down Expand Up @@ -1283,7 +1346,7 @@ clearpart --all --initlabel
```bash
mkdir nps
cd nps
wget https://github.com/ehang-io/nps/releases/download/v0.26.7/linux_amd64_server.tar.gz
wget https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_server.tar.gz
tar -zxvf linux_amd64_server.tar.gz
./nps install
nps start
Expand Down Expand Up @@ -1895,6 +1958,10 @@ ss -tnlp
curl https://ipinfo.io --proxy socks5://test1:123456@ip:port
```

**一键安装脚本**
- [wyx176/Socks5](https://github.com/wyx176/Socks5)
- [Lozy/danted](https://github.com/Lozy/danted)

---

### SSH
Expand Down Expand Up @@ -5444,6 +5511,8 @@ setenforce 0 # 关闭 selinux
docker run -itd centos:v1 # 运行 centos:v1 镜像
docker rm [docker_name/docker_id] # 删除容器
docker rmi $(docker images -f "dangling=true" -q) # 删除 docker 悬空镜像
docker ps # 查看当前运行的 docker 容器的进程信息
docker ps -a # 查看当前容器
docker stats # 统计信息
Expand Down Expand Up @@ -5567,35 +5636,35 @@ kubectl get deployment -A # 列出所有 deployment
**与运行中的 Pod 交互**
```bash
kubectl logs my-pod # 获取 pod 日志(标准输出)
kubectl logs -l name=myLabel # 获取含 name=myLabel 标签的 Pods 的日志(标准输出)
kubectl logs my-pod --previous # 获取上个容器实例的 pod 日志(标准输出)
kubectl logs my-pod -c my-container # 获取 Pod 容器的日志(标准输出, 多容器场景)
kubectl logs -l name=myLabel -c my-container # 获取含 name=myLabel 标签的 Pod 容器日志(标准输出, 多容器场景)
kubectl logs my-pod -c my-container --previous # 获取 Pod 中某容器的上个实例的日志(标准输出, 多容器场景)
kubectl logs -f my-pod # 流式输出 Pod 的日志(标准输出)
kubectl logs -f my-pod -c my-container # 流式输出 Pod 容器的日志(标准输出, 多容器场景)
kubectl logs -f -l name=myLabel --all-containers # 流式输出含 name=myLabel 标签的 Pod 的所有日志(标准输出)
kubectl run -i --tty busybox --image=busybox:1.28 -- sh # 以交互式 Shell 运行 Pod
kubectl run nginx --image=nginx -n mynamespace # 在 “mynamespace” 命名空间中运行单个 nginx Pod
kubectl run nginx --image=nginx # 运行 ngins Pod 并将其规约写入到名为 pod.yaml 的文件
kubectl logs my-pod # 获取 pod 日志(标准输出)
kubectl logs -l name=myLabel # 获取含 name=myLabel 标签的 Pods 的日志(标准输出)
kubectl logs my-pod --previous # 获取上个容器实例的 pod 日志(标准输出)
kubectl logs my-pod -c my-container # 获取 Pod 容器的日志(标准输出, 多容器场景)
kubectl logs -l name=myLabel -c my-container # 获取含 name=myLabel 标签的 Pod 容器日志(标准输出, 多容器场景)
kubectl logs my-pod -c my-container --previous # 获取 Pod 中某容器的上个实例的日志(标准输出, 多容器场景)
kubectl logs -f my-pod # 流式输出 Pod 的日志(标准输出)
kubectl logs -f my-pod -c my-container # 流式输出 Pod 容器的日志(标准输出, 多容器场景)
kubectl logs -f -l name=myLabel --all-containers # 流式输出含 name=myLabel 标签的 Pod 的所有日志(标准输出)
kubectl run -i --tty busybox --image=busybox:1.28 -- sh # 以交互式 Shell 运行 Pod
kubectl run nginx --image=nginx -n mynamespace # 在 “mynamespace” 命名空间中运行单个 nginx Pod
kubectl run nginx --image=nginx # 运行 ngins Pod 并将其规约写入到名为 pod.yaml 的文件
--dry-run=client -o yaml > pod.yaml

kubectl attach my-pod -i # 挂接到一个运行的容器中
kubectl port-forward my-pod 5000:6000 # 在本地计算机上侦听端口 5000 并转发到 my-pod 上的端口 6000
kubectl exec my-pod -- ls / # 在已有的 Pod 中运行命令(单容器场景)
kubectl exec --stdin --tty my-pod -- /bin/sh # 使用交互 shell 访问正在运行的 Pod (一个容器场景)
kubectl exec my-pod -c my-container -- ls / # 在已有的 Pod 中运行命令(多容器场景)
kubectl top pod POD_NAME --containers # 显示给定 Pod 和其中容器的监控数据
kubectl top pod POD_NAME --sort-by=cpu # 显示给定 Pod 的指标并且按照 'cpu' 或者 'memory' 排序
kubectl attach my-pod -i # 挂接到一个运行的容器中
kubectl port-forward my-pod 5000:6000 # 在本地计算机上侦听端口 5000 并转发到 my-pod 上的端口 6000
kubectl exec my-pod -- ls / # 在已有的 Pod 中运行命令(单容器场景)
kubectl exec --stdin --tty my-pod -- /bin/sh # 使用交互 shell 访问正在运行的 Pod (一个容器场景)
kubectl exec my-pod -c my-container -- ls / # 在已有的 Pod 中运行命令(多容器场景)
kubectl top pod POD_NAME --containers # 显示给定 Pod 和其中容器的监控数据
kubectl top pod POD_NAME --sort-by=cpu # 显示给定 Pod 的指标并且按照 'cpu' 或者 'memory' 排序
```
**从容器中复制文件和目录**
```bash
kubectl cp /tmp/foo_dir my-pod:/tmp/bar_dir # 将 /tmp/foo_dir 本地目录复制到远程当前命名空间中 Pod 中的 /tmp/bar_dir
kubectl cp /tmp/foo my-pod:/tmp/bar -c my-container # 将 /tmp/foo 本地文件复制到远程 Pod 中特定容器的 /tmp/bar 下
kubectl cp /tmp/foo my-namespace/my-pod:/tmp/bar # 将 /tmp/foo 本地文件复制到远程 “my-namespace” 命名空间内指定 Pod 中的 /tmp/bar
kubectl cp my-namespace/my-pod:/tmp/foo /tmp/bar # 将 /tmp/foo 从远程 Pod 复制到本地 /tmp/bar
kubectl cp /tmp/foo_dir my-pod:/tmp/bar_dir # 将 /tmp/foo_dir 本地目录复制到远程当前命名空间中 Pod 中的 /tmp/bar_dir
kubectl cp /tmp/foo my-pod:/tmp/bar -c my-container # 将 /tmp/foo 本地文件复制到远程 Pod 中特定容器的 /tmp/bar 下
kubectl cp /tmp/foo my-namespace/my-pod:/tmp/bar # 将 /tmp/foo 本地文件复制到远程 “my-namespace” 命名空间内指定 Pod 中的 /tmp/bar
kubectl cp my-namespace/my-pod:/tmp/foo /tmp/bar # 将 /tmp/foo 从远程 Pod 复制到本地 /tmp/bar
```
> kubectl cp 要求容器镜像中存在 “tar” 二进制文件。如果 “tar” 不存在,kubectl cp 将失败
Expand Down Expand Up @@ -6526,6 +6595,18 @@ terraform -h
---
### pulumi
**项目地址**
- https://github.com/pulumi/pulumi
**安装**
```bash
curl -fsSL https://get.pulumi.com | sh -s -- --version 3.37.2
```
---
## 各种依赖和报错
**libboost-program-options1.58.0**
Expand Down
7 changes: 7 additions & 0 deletions 1earn/Integrated/Linux/Speed-Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,11 @@ ls # 查看目录下文件
ls -lah # 查看的内容更新详细
ls -l | grep "^-" | wc -l # 查看文件目录下的文件数

ls -lR| grep "^-" | wc -l # 统计当前目录下文件的个数
ls -lR | grep "^d" | wc -l # 统计当前目录下文件夹的个数

ls -lR | wc -l # 查看 / 文件+文件夹个数

pwd # 以绝对路径的方式显示用户当前工作目录
pwd -P # 目录链接时,显示实际路径而非 link 路径

Expand Down Expand Up @@ -666,6 +671,8 @@ cat /dev/null > access.log
**搜索命令**
```bash
which <Command> # 指令搜索,查找并显示给定命令的绝对路径
where <Command> # 指令搜索,查找并显示给定命令的绝对路径
whereis <Command> # 指令搜索,查找并显示给定命令的绝对路径
```

**搜索文件**
Expand Down
8 changes: 8 additions & 0 deletions 1earn/Integrated/Linux/实验/openssl.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ openssl x509 -in ca.crt -noout -text

---

## 随机数

```bash
openssl rand -base64 16
```

---

## Source & Reference

- https://blog.csdn.net/Michaelwubo/article/details/113736166
Expand Down
14 changes: 14 additions & 0 deletions 1earn/Integrated/Linux/实验/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,17 @@ EOF
```bash
terraform apply -var="test_ip=1.14.5.14"
```

**插件缓存**

- linux
```
echo 'plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"' > $HOME/.terraformrc
```

- windows

%APPDATA% 目录下 `terraform.rc` 文件
```
plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"
```
20 changes: 20 additions & 0 deletions 1earn/Integrated/Linux/笔记/工具.md
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,26 @@ jo -p -a spring summer winter
- https://github.com/multiprocessio/dsq

**xmllint**

> 解析 xml 格式
```bash
sudo apt-get install libxml2-utils
```

```
xmllint --xpath "//book[@id=2]/name/text()" sample.xml
```

**xpath**

> 解析 xml 格式
```bash
xpath -e '//book/name/text()' sample.xml
```

---

## 图像视频
Expand Down
10 changes: 10 additions & 0 deletions 1earn/Plan/Mac-Plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ defaults write com.apple.dock autohide-time-modifier -float 0.5 && killall Dock
defaults write com.apple.dock autohide-delay -int 0 && killall Dock
```

**左右光标移动速度**

系统偏好设置 -> 键盘 -> 键盘
- 按键重复:对应的是移动速度;
- 重复前延迟:对应的是移动前的反应时间。

---

## 软件
Expand Down Expand Up @@ -155,6 +161,10 @@ brew update && brew install --cask motrix

- https://www.microsoft.com/en-us/edge

**Alfred**

- https://www.alfredapp.com/

**code-server**

- https://github.com/coder/code-server
Expand Down
10 changes: 6 additions & 4 deletions 1earn/Plan/Misc-Plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [Wind4/vlmcsd](https://github.com/Wind4/vlmcsd) - kms 服务器
- [TGSAN/CMWTAT_Digital_Edition](https://github.com/TGSAN/CMWTAT_Digital_Edition) - 数字权利激活工具
- [kkkgo/KMS_VL_ALL](https://github.com/kkkgo/KMS_VL_ALL) - kms 激活脚本
- [massgravel/Microsoft-Activation-Scripts](https://github.com/massgravel/Microsoft-Activation-Scripts) - A collection of scripts for activating Microsoft products using HWID / KMS38 / Online KMS activation methods with a focus on open-source code, fewer antivirus detections and user-friendliness.

**激活 Windows**

Expand Down Expand Up @@ -100,6 +101,7 @@ ipconfig /flushdns
## 各种代理/源
- https://github.com/eryajf/Thanks-Mirror
- https://github.com/comwrg/package-manager-proxy-settings
### Git
Expand Down Expand Up @@ -301,15 +303,15 @@ npm config delete proxy # 取消代理
**命令行挂Socks5代理**
```
```bash
java -DsocksProxyHost=127.0.0.1 -DsocksProxyPort=1080 -jar test.jar
# 其中socksProxyHost是Socks5代理的IP地址,socksProxyPort是Socks5代理的端口号。socksProxyVersion版本号是5或者是4,默认是5版本,也就是Socks5代理,这里也可以指定。
```
**命令行挂HTTP代理**
```
```bash
java -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts="*.example.com|localhost" -jar test.jar
# 如果想使用代理访问HTTP的URL,则必须使用http.proxyHost,http.proxyPort。如果想用代理访问HTTPS的URL,则必须使用https.proxyHost,https.proxyPort。如果想同时抓HTTP、HTTPS的url访问的话,以上4项是必须设置的,缺一不可
Expand All @@ -320,13 +322,13 @@ java -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=127.0.0.
```
HTTPS代理设置如下:
```
```bash
java -Dhttps.proxyHost=host -Dhttps.proxyPort=port -Dhttps.proxyUser=user -Dhttps.proxyPassword="password" -Djavax.net.ssl.trustStore=c:/cacerts -Djavax.net.ssl.trustStorePassword=changeit -jar test.jar
```
**jar使用系统代理**
```
```bash
java -Djava.net.useSystemProxies=true -jar test.jar
```
Expand Down
Loading

0 comments on commit 19d81a4

Please sign in to comment.