Windows

启动远程桌面

powershell -exec Bypass "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/moonlightwatch/remote-scripts/master/powershell/EnableRDP.ps1')"

Start-Service Termservice
Set-NetFirewallRule RemoteDesktop-UserMode-In-TCP -Enabled True
Set-NetFirewallRule RemoteDesktop-UserMode-In-UDP -Enabled True

关闭远程桌面

powershell -exec Bypass "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/moonlightwatch/remote-scripts/master/powershell/DisableRDP.ps1')"

Stop-Service Termservice
Set-NetFirewallRule RemoteDesktop-UserMode-In-TCP -Enabled False
Set-NetFirewallRule RemoteDesktop-UserMode-In-UDP -Enabled False

Linux

按名称关闭进程

ps -ef | grep 名称 | grep -v grep | awk '{print $2}' | xargs kill

JavaScript

提取页面内的链接

function GetLinks() {
    var urls = new Array();
    var links = document.links;
    for (var i = 0; i < links.length; i++) {
        urls.push(links[i].href);
    }
    return urls;
}

数据库操作

PostgreSQL 设置时区

ALTER DATABASE [你的数据库名] SET timezone TO 'Asia/Shanghai'

发表评论

正在加载 Emoji