126 gists results Add gist
netnr/ linux-task-manager.sh 2019-04-20 11:27
任务管理器
yum install epel-release -y && yum install htop -y # 安装 htop

# help
https://www.tecmint.com/htop-linux-process-monitoring/


npm install gtop -g # 安装 gtop

# help
https://github.com/aksakalli/gtop
查看详情
netnr/ ab 2019-04-17 09:56
Linux 使用 ab 压力测试工具
yum install httpd-tools # 安装
ab -V # 版本

# Get 请求,10 并发 总 100 次
ab -c 10 -n 100 https://netnr.eu.org/

# Post 请求(发送当前目录下的 post.txt 文件:uid=1&pwd=1)
ab -c 10 -n 100 -p post.txt https://netnr.eu.org/
# Post 请求(发送当前目录下的 post.txt)
ab -c 10 -n 100 -T 'application/json' -p post.txt https://netnr.eu.org/
查看详情
netnr/ rwx.md 2019-04-09 07:29
Linux修改文件属性和权限
### 文件权限描述由10个字符组成,例如,“-rwxr-xr--”、"drwxr-xr-x"
+ 第一个字符的含义为:
    - d: 目录
    - -: 文件
    - l: 连接文件
    - b: 设备文件里面的可供存储的接口设备
    - c: 设备文件里面的串行端口设置,例如键盘、鼠标
+ 接下来的9个字符,分为三组,每组三个字符,均为 `rwx` 的三个参数组合。位置不会改变,没有某权限,则出现 `-` 号
+ 三组字符中,第一组表示文件所有者的权限;第二组表示同用户组的权限;第三组表示others的权限
+ 三种身份又有三种权限,r(读)、w(写)、x(执行)
查看详情
netnr/ netsh-interface.bat 2019-03-29 14:23
windows使用netsh命令实现端口转发
::安装IPv6,XP或更低版本要安装,安装后不需要启用,win7及以上不需要
netsh interface ipv6 install

::添加端口转发 192.168.1.2:1433 => 192.168.1.3:1433
netsh interface portproxy add v4tov4 listenaddress=192.168.1.2 listenport=1433 connectaddress=192.168.1.3 connectport=1433

::添加端口转发 *:1433 => 192.168.1.3:1433 不设置listenaddress
netsh interface portproxy add v4tov4 listenport=1433 connectaddress=192.168.1.3 connectport=1433

::删除端口转发 192.168.1.2:1433
查看详情
netnr/ Fetch-QQ-Mail.js 2019-03-29 11:32
提取QQ邮箱发送的日志,为月度考核作业
/*
    更新时间:2019-03-29
    使用方法:打开QQ邮箱,选择【已发送】界面,打开浏览器控制台(或按F12),拷贝脚本粘贴回车(按Enter)
 */

(function () {
    var win = document.getElementById('mainFrame').contentWindow;
    var tds = win.document.getElementsByTagName('td');

    //邮件ID
查看详情
netnr/ install-docker.sh 2019-02-19 11:10
linux 安装 docker
wget -qO- get.docker.com | bash # 一键安装

# ubuntu 清华镜像安装
apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common # 安装依赖
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable" # 添加 arm64 软件仓库
apt-get update && apt-get install docker-ce docker-ce-cli containerd.io
# help
https://mirror.tuna.tsinghua.edu.cn/help/docker-ce/
https://docs.docker.com/engine/install/ubuntu/
查看详情
netnr/ install-nodejs.sh 2019-02-18 09:15
安装 nodejs
# 版本号支持:lts.x current.x 5.x 6.x 7.x 8.x 10.x 12.x 14.x 16.x

# CentOS
curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash - # As root
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash - # No root privileges
yum install -y nodejs # 安装

# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
查看详情
netnr/ ifcfg 2019-01-23 11:47
设置静态 IP
# 进入目录
cd /etc/sysconfig/network-scripts
ls

# ifcfg-ens开头的文件,如 ifcfg-ens33

# 默认配置文件如下:

TYPE=Ethernet
PROXY_METHOD=none
查看详情
netnr/ conn.net.md 2019-01-18 13:12
ASP.NET数据库访问驱动(Oracle、MySQL、PostgreSQL等),VS开发使用
# Oracle

### ODBC 驱动
https://www.oracle.com/database/technologies/dotnet-odacdev-downloads.html  
https://www.oracle.com/database/technologies/odac-downloads.html (64bit)

### 下载 Oracle Visual Studio 工具和 ADO.NET 数据访问提供程序
https://www.oracle.com/technetwork/topics/dotnet/downloads/index.html

### Oracle 数据库下载
查看详情
netnr/ acme.sh 2019-01-17 20:18
使用 acme.sh 从 ZeroSSL 生成免费的 https 证书
yum install socat # CentOS7 需要先安装 socat

curl https://get.acme.sh | sh -s email=netnr@netnr.com # 一键安装

# 从 git 安装
git clone https://github.com/acmesh-official/acme.sh.git && cd ./acme.sh
./acme.sh --install -m netnr@netnr.com --server zerossl

# 安装完后重新加载 Bash
bash
查看详情

链接