代码片段

Bash

按关键字关闭进程:

ps -ef | grep xxx | grep -v grep | awk '{print $2}' | xargs kill -9

JavaScript

// 提取页面所有链接路径
function AllUrls() {
    var links = new Array();
    for (var i = 0; i < document.links.length; i++) {
        var url = document.links[i].href;
        if (url.startsWith("http")) {
            links.push(url);
        }
    }
    return links;
}

// 提取所有页面脚本路径
function AllScripts() {
    var scripts = new Array();
    for (var i = 0; i < document.scripts.length; i++) {
        var script = document.scripts[i].src;
        if (script.startsWith("http")) {
            scripts.push(script);
        }
    }
    return scripts;
}

// 提取页面所有样式表路径
function AllStyleSheets() {
    var styleSheets = new Array();
    for (var i = 0; i < document.styleSheets.length; i++) {
        var styleSheet = document.styleSheets[i].href;
        if (styleSheet.startsWith("http")) {
            styleSheets.push(styleSheet);
        }
    }
    return styleSheets;
}

// 提取页面所有图片路径
function AllImages() {
    var images = new Array();
    for (var i = 0; i < document.images.length; i++) {
        var image = document.images[i].href;
        if (image.startsWith("http")) {
            images.push(image);
        }
    }
    return images;
}

// 提取页面域名
function Domain() {
    return document.domain;
}

// 提取页面标题
function Title(){
    return document.title;
}

Firewalld

开启80端口

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

查看已开启的端口

firewall-cmd --zone=public --list-ports
%d 博主赞过: