We’ve found 47 gist results

netnr / grub.cfg shell
2019-01-12 07:11
CentOS 7 修改开机等待时间
# 编辑配置
vi /boot/grub2/grub.cfg

# 找到位置
set timeout_style=menu
set timeout=5 

# set timeout=1 建议修改为 1 秒

# 保存
netnr / cmd shell
2018-12-29 21:58
Windows Server 无GUI常用命令操作记录
# 修改密码
net user Administrator 123

# 启用 Administrator 管理员账号
net user Administrator /active:yes

# 查看计算机名称
hostname

# 修改原计算机名称 OldName 为 netnr
netnr / sqlcmd-sa shell
2018-12-29 17:10
sqlcmd命令模式启用SQLServer管理员账号sa远程登录
# 连接
sqlcmd -S .

# 启用sa
alter login sa enable

# 设置sa密码
alter login sa with password="Abc123!@#"

# 启用混合模式登录,修改注册表 regedit
netnr / elrepo.sh shell
2018-12-18 23:42
CentOS升级内核为4.x
# 查看内核
uname -r

# 导入
rpm -import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
# 查看
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
# 安装
yum -y --enablerepo=elrepo-kernel install kernel-ml.x86_64 kernel-ml-devel.x86_64
netnr / ShadowsocksR.sh shell
2018-12-18 23:07
Install ShadowsocksR
# 安装
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh
chmod +x shadowsocksR.sh
./shadowsocksR.sh 2>&1 | tee shadowsocksR.log

# 卸载
./shadowsocksR.sh uninstall

# 状态
/etc/init.d/shadowsocks status
netnr / install-sqlserver shell
2018-12-07 08:02
CentOS7安装mssql-server
# 下载 Microsoft SQL Server Red Hat 存储库配置文件
curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo

# 安装
yum update
yum install mssql-server

# 更改2GB内存限制为512MB(可选)
cd /opt/mssql/bin
mv sqlservr sqlservr.old
netnr / nginx-proxy_pass shell
2018-11-30 14:34
nginx代理授权验证访问的站点(伪造User-Agent、Cookie验证)
server {
    listen 66;
    location / {
            # 允许跨域
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Credentials' 'true';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
            
            proxy_set_header X-Real-IP $remote_addr;
netnr / wget shell
2018-11-30 14:24
wget命令爬取整个站点,可设置(伪造)Cookie、User-Agent 授权验证
# 爬取站点
wget -c -r -npH -k -nv http://updatebrowser.netnr.com/

# 参数说明

-c  # 断点续传

-r  # 递归下载

-np  # 递归下载时不搜索上层目录
netnr / bench shell
2018-11-10 22:30
测试各种 Linux 发行版的网络(下行)和 IO 测试
#查看 Linux 系统信息,还可以测试网络带宽及硬盘读写速率 

#任选一个
wget -qO- bench.sh | bash
curl -Lso- bench.sh | bash
wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
curl -Lso- -no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench-CN.sh && bash ZBench-CN.sh
wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench.sh && bash ZBench.sh
netnr / kms shell
2018-11-10 14:16
一键安装KMS服务脚本
#安装
wget --no-check-certificate https://github.com/teddysun/across/raw/master/kms.sh && chmod +x kms.sh && ./kms.sh

#查看端口
netstat -nxtlp | grep 1688

#启动
/etc/init.d/kms start
#停止
/etc/init.d/kms stop
ˆ