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))
apiVersion: v1
data:
sablier.yaml: |
provider:
name: kubernetes
server:
port: 10000
base-path: /
storage:
file:
#!/bin/bash
#
#**************************************************
# Author: AGou-ops *
# E-mail: agou-ops@foxmail.com *
# 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: agou-ops@foxmail.com *
# 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 git@github.com: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"
@AGou-ops
AGou-ops / iterm2_key.json
Last active August 5, 2022 08:18
MacOS偏门解决vim/Neovim光标跳转(j/k键)卡顿的问题。【使用karabiner】
{
"title": "iterm2 - by: AGou-ops.cn",
"rules": [
{
"description": "Change left_shift to command+spacebar if pressed alone in iterm2",
"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 / surfingkeys.settings
Last active March 14, 2022 01:45
Default Surfingkeys Settings
const {
unmap,
iunmap,
vunmap,
aceVimMap,
mapkey,
imap,
imapkey,
getClickableElements,
vmapkey,