We’ve found 41 gist results

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
netnr / ssh shell
2018-11-10 13:18
Linux下更改SSH端口
#编辑
vi /etc/ssh/sshd_config

#搜索、修改端口号
/Port 22

#重启服务
/bin/systemctl restart  sshd.service

#help
netnr / bbr shell
2018-11-10 08:25
快速开启Google BBR的方法,BBR内核要求为4.9
#修改系统变量
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

#保存生效
sysctl -p

#查看内核是否已开启BBR
sysctl net.ipv4.tcp_available_congestion_control
netnr / slmgr shell
2018-11-05 10:02
Windows软件授权管理slmgr命令,KMS服务激活系统
# 管理员 运行

# 设置服务
slmgr -skms kms.netnr.com

# 安装秘钥,或者通过操作界面输入秘钥激活也可以的
slmgr -ipk 输入对应版本的秘钥

# 激活(已安装秘钥)
slmgr -ato
netnr / ToTimestamp.cs csharp
2018-11-03 10:13
将Datetime转换成时间戳,10位,秒
/// <summary>
/// 将Datetime转换成时间戳,10位,秒
/// </summary>
/// <param name="datetime"></param>
/// <returns></returns>
public static long ToTimestamp(this DateTime datetime)
{
    return (datetime.ToUniversalTime().Ticks - 621355968000000000) / 10000000;
}
netnr / ToEncode-ToDecode.cs csharp
2018-11-03 10:12
编码、解码
/// <summary>
/// 编码
/// </summary>
/// <param name="uri"></param>
/// <param name="charset"></param>
/// <returns></returns>
public static string ToEncode(this string uri, string charset = "utf-8")
{
    string URL_ALLOWED_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~";
netnr / ToDataTable-ToModel.cs csharp
2018-11-03 10:06
实体转表、表转实体
/// <summary>
/// 实体转表
/// </summary>
/// <typeparam name="T">泛型</typeparam>
/// <param name="list">对象</param>
/// <returns></returns>
public static DataTable ToDataTable<T>(this IList<T> list)
{
    Type elementType = typeof(T);
    var t = new DataTable();
ˆ