#!/bin/bash
#cf.security.change.sh
##近期平均负载情况判定
usage=`echo $(cat /proc/loadavg | awk '{print $2}')` #获取当前系统平均负载值
max=2 #设置最大阈值
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ```bash | |
| # 1. 临时从 .gitignore 中删除规则(或注释掉) | |
| sed -i 's/^.env.development$/# .env.development/' .gitignore | |
| # 2. 修改配置文件 | |
| vim .env.development | |
| # 3. 强制添加文件 | |
| git add -f .env.development |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # 函数:输出错误信息并退出 | |
| print_error_and_exit() { | |
| echo "Error: $1" | |
| exit 1 | |
| } | |
| # 步骤1:检查并创建/tmp/sangforinstallationtemp目录 | |
| if [ ! -d "/tmp/sangforinstallationtemp" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::env; | |
| use std::io::{Error, Read, Write}; | |
| use std::net::{TcpStream, ToSocketAddrs}; | |
| use std::ptr::eq; | |
| use std::sync::{Arc, Mutex}; | |
| use std::time::Duration; | |
| use tokio::time::sleep; | |
| #[derive(Debug)] | |
| pub struct TcpTransport { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // a simple test server by nodejs | |
| var net = require('net'); | |
| net.createServer(function(socket){ | |
| socket.on('data', function(data){ | |
| console.log("recv data:",data); | |
| }); | |
| setInterval(() => { | |
| var data = Buffer.from("hello"); | |
| var datalen = data.length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "encoding/binary" | |
| "errors" | |
| "fmt" | |
| "io" | |
| "net" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Module dependencies. | |
| */ | |
| var net = require('net'); | |
| var inherits = require('util').inherits; | |
| var EventEmitter = require('events').EventEmitter; | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "presets": [ | |
| [ | |
| "@babel/preset-env", | |
| { | |
| "useBuiltIns": "entry", | |
| "modules": false | |
| } | |
| ] | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <arpa/inet.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <sys/socket.h> | |
| #include <unistd.h> | |
| int main() { | |
| const char* server_name = "localhost"; | |
| const int server_port = 8877; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function inputEvent(val) { | |
| if (val) { | |
| var len = (val + '').length; | |
| console.log(`len:${len},val:${val}`); | |
| var res = '*'.repeat(len - 1) + val.substr(-1); | |
| console.log(res); | |
| this.inputModel = res; | |
| } else { | |
| return ''; | |
| } |
NewerOlder