126 gists results Add gist
netnr/ LinkAsMd.js 2019-09-09 07:18
页面链接转成Markdown
var links = document.links, i = 0, md = [];
for (var len = links.length; i < len; i++) {
    var link = links[i];
    md.push("[" + link.innerHTML.replace(/\[/g,'\\[').replace(/\]/g,'\\]') + "](" + link.href + ")");
}
console.log(md.join('  \n'))
查看详情
netnr/ ssh-vc 2019-08-13 22:49
查看SSH暴力破解记录
# /var/log/ 目录下 secure 开头的日志文件

# 查看哪些IP破解你SSH密码以及次数
cat /var/log/secure | awk '/Failed/{print $(NF-3)}' | sort | uniq -c | awk '{print $2" = "$1;}'

# 登录失败的记录
grep -o "Failed password" /var/log/secure|uniq -c

# 登录成功的记录
grep "Accepted " /var/log/secure | awk '{print $1,$2,$3,$9,$11}'
查看详情
netnr/ dead_link_detection.js 2019-08-09 22:08
检测页面所有链接,找到死链(如导航页面维护清理失效的链接)
var dld = {
    //跨域代理
    proxyServer: ['https://cors.eu.org/', 'https://api.netnr.eu.org/link/', 'https://netnr.zme.ink/api/v1/Proxy?url='],
    proxyIndex: 0,
    proxyGet: (link) => {
        let ps = dld.proxyServer[dld.proxyIndex++];
        if (dld.proxyIndex >= dld.proxyServer.length) {
            dld.proxyIndex = 0;
        }
        return `${ps}${encodeURIComponent(link)}`;
查看详情
netnr/ ln 2019-08-06 21:11
ln -s 软链接(小写 L)
# 创建软链接,ln -s 真实目录 软链接目录
ln -s /package/mysqldata /var/lib/mysql

# 修改软连接属主
chown -h mysql:mysql /var/lib/mysql

# 误区:软链接是创建的,就意味着软链接文件不可以在创建之前存在
# 类比:win快捷方式
# 删除:rm就可以,但源文件不受影响
# 指向:可指向文件、目录
查看详情
netnr/ git-clone-ss 2019-07-29 17:34
git clone 使用 SS socks5代理
# 已经有了SS

git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080

# 取消
git config --global --unset http.proxy
git config --global --unset https.proxy

# 只对github进行代理
查看详情
netnr/ firewall-cmd-iptables 2019-07-25 14:59
centos 防火墙的启动、停止
systemctl status firewalld  # 查看firewall服务状态
systemctl start firewalld   # 启动
service firewalld restart   # 重启
systemctl stop firewalld    # 关闭
systemctl disable firewalld # 开机禁用
systemctl enable firewalld  # 开机启用

firewall-cmd --zone=public --permanent ... # 指定区域、永久的命令

firewall-cmd --list-all # 查看防火墙规则
查看详情
netnr/ zip-tar 2019-07-18 07:17
Linux 上常用的压缩/解压工具,介绍了zip、tar的使用
# 【zip 打包】
# -r 表示递归打包包含子目录的全部内容,-q 表示安静模式,-o 表示输出文件
zip -r -q -o tmp.zip  /tmp
# 使用 du 命令查看打包后文件的大小
du -h tmp.zip

# 【unzip 解压缩】
# 将 tmp.zip 解压到当前目录
unzip tmp.zip
# 使用安静模式,将文件解压到指定目录
查看详情
netnr/ barrage.js 2019-06-06 00:10
弹幕,斗鱼弹幕临时解决方案
/*
 *  barrage 弹幕
 *  
 *  2019-06
 *  netnr
 */

(function (window) {

    var bar = function (obj) {
查看详情
netnr/ wsl 2019-05-11 13:03
Windows Subsystem Linux(WSL)安装
# 教程链接
https://docs.microsoft.com/zh-cn/windows/wsl/install-manual

# 使用开发人员模式
设置》更新和安全》开发中选项》开发人员模式

# 添加 Windows 应用程序
# 适用于 Linux 的 Windows 子系统,或 PowerShell 执行命令安装
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
查看详情
netnr/ aegis 2019-05-09 10:13
centos卸载阿里云盾服务
# 查看开机启动的服务名
chkconfig --list

# 一般情况下阿里云盾的服务是aegis
# 停止服务
service aegis stop

# 删除服务
chkconfig --del aegis
查看详情

链接