Skip to content

Instantly share code, notes, and snippets.

View AGou-ops's full-sized avatar
💭

Sephiroth AGou-ops

💭
View GitHub Profile
#!/bin/bash
# 获取总内存大小
total_mem=$(free -m | awk 'NR==2{print $2}')
# 获取buff/cache大小
buff_cache=$(free -m | awk 'NR==2{print $6}')
# 计算buff/cache占总内存的百分比
usage_percentage=$((buff_cache * 100 / total_mem))
#!/bin/bash
#
#**************************************************
# Author: AGou-ops *
# E-mail: [email protected] *
# Date: 2023-08-30 *
# Description: *
# Copyright 2023 by AGou-ops.All Rights Reserved *
#**************************************************
#
@AGou-ops
AGou-ops / build_neovim.sh
Created July 17, 2023 02:41
Build neovim nightly. (for nvim-ufo)
#!/bin/bash
#
#**************************************************
# Author: AGou-ops *
# E-mail: [email protected] *
# Date: 2023-07-17 *
# Description: *
# Copyright 2023 by AGou-ops.All Rights Reserved *
#**************************************************
#
@AGou-ops
AGou-ops / deploy.yml
Last active April 7, 2023 14:03
hexo/hugo deploy actions sample
name: Pages
on:
push:
branches:
- main # default branch
jobs:
pages:
runs-on: ubuntu-latest
@AGou-ops
AGou-ops / push.sh
Created April 1, 2023 13:10
hexo/hugo git手动推送脚本
# --- hexo \\ hexo init test
#!/usr/bin/bash
hexo g
cd public
git init
git add -A
git commit -m "rebuilding site $(date)"
git remote add origin [email protected]:xxx
git push --set-upstream origin main
@AGou-ops
AGou-ops / allKey.json
Created September 28, 2022 02:20
allKey.json
{
"title": "All - by: AGou-ops.cn",
"rules": [
{
"description": "Change left_shift to command+spacebar if pressed alone for all app",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_shift"
链接两个独立的系统或者软件,即使他们有着不同的接口,但是通过中间件都仍能实现信息交换.
常见的中间件有:Tomcat/JBoss(web服务器)/Kfaka/Redis/influxdb/zookeeper/RabbitMQ
lvs的三种工作模式,dr直接路由模式,tun隧道模式,nat模式
- nat: 客户端发送数据包到lvs负载均衡器,在负载均衡器上将数据包的目的ip换为后端rs的ip,rs接受数据包并作出相应将返回的数据包发送给负载均衡器,负载均衡器将SIP替换成自己的ip,最后将响应的数据包发送给客户端
优点是:集群中的物理服务器可以使用任何支持TCP/IP操作系统,只有负载均衡器需要一个合法的IP地址。
缺点:扩展性有限。当服务器节点(普通PC服务器)增长过多时,负载均衡器将成为整个系统的瓶颈。
@AGou-ops
AGou-ops / install_ipv6_tunnel.sh
Last active May 3, 2022 11:11
快速安装IPv6隧道脚本(tunnelbroker)
#!/usr/bin/env bash
set -euo pipefail
#
#**************************************************
# Author: AGou-ops *
# E-mail: [email protected] *
# Date: 2021-12-02 *
# Description: *
# Copyright 2021 by AGou-ops.All Rights Reserved *
@AGou-ops
AGou-ops / resort-files.sh
Created August 25, 2021 03:03
根据excel中的文件列表,对图片文件按照年月的格式进行重新归档并输出相关日志。
#!/bin/bash
#
#**************************************************
# Author: AGou-ops *
# E-mail: [email protected] *
# Date: 2021-08-10 *
# Description: Re-sort picture file *
# Copyright 2021 by AGou-ops.All Rights Reserved *
#**************************************************
set -euo pipefail