文章列表
 
您正在查看 "编程" 分类下的文章

2010-09-08 23:46

#!/usr/bin/perl -w

#By xti9er

require LWP::UserAgent;
use LWP::Simple;
use Color::Output;
Color::Output::Init;

$|=1;

#----------------------------
#从配置文件中提取字符串
#----------------------------
my $inrulfile=shift||"inurl.ini";
my $countryset="";
open(INURL,$inrulfile) or die $!;
while($inurl=<INURL>)
{
chomp($inurl);
next if $inurl=~/^#/;
if($inurl=~/^country=(\w+)/i)

 
2010-05-20 17:30

从MS官方blog上看到一则很实用的脚本,用来远程唤醒系统

1、确认你的系统是否支持远程唤醒

#ethtool etho|grep ‘Wake-on’

    Supports Wake-on: pumbag

    Wake-on: g

g 表示已启动

2、编写脚本

########################

param($MacAddress)
echo "Wake up $MacAddress Now!"
[byte[]

 
2010-05-13 0:58

 
2010-03-18 13:36

很脑残的写了三遍,用三种语言

----------------------------C# -------------------------------

using System;
using System.Diagnostics;
using System.Security;
using System.Text;

namespace glog
{
    class Program
    {
        static void Main(string[] args)
        {
          

 
2010-01-15 2:01


$logs="security","Application","system";
for($i=0; $i -lt $logs.Length; $i++)
{
$ips=($i/($logs.Length))*100
$log=$logs[$i];
write-progress -id 1 -activity "<< 日志分析器 >>" -PercentComplete ($i+1) -CurrentOperation "$ips% complete" -Status "扫描中..."

$last=Get-EventLog $log -Newest 1
$max_id=$last.index
$all_log=Get-EventLog $log

for ($a=1;

 
2010-01-09 23:25

没啥技术含量,只是尝试用powershell作点东西。

powershell不仅仅是一个强大的shell。

####################################

$s='-'*70;
ps|foreach -process{
$nps=$_;
Get-Process -id $nps.id -module| foreach -process {
   $md=$_;
   if($md.BaseAddress -eq 268435456){
    echo $nps|select id,processname;
    Write-Host -ForegroundColor red $md.ModuleName;
    echo $md.

 
2010-01-06 11:31

昨日听说SEP(Symantec Endpoint Protection)升级出现BUG,把2010年1月5日判断成比2009年12月31日更早,出现删除了新版病毒库而更新为旧的09年病毒库的‘乌龙事件’。

没到今天,我的代码也出现了类似的 ‘乌龙事件’,我猜测SEP的代码中也是这个逻辑错误。

如果你用google搜索 获取系统时间的源代码,会发现大量的代码是这样写的

sprintf(nowtime,"%4d年%2d月%2d日%2d时%2d分",sysTime.wYear,sysTime.wMonth,sysTime.wDay, sysTime.wHour,sysTime.wMinute);

可事实

 
2009-11-06 9:34

话说这曾是某些兄弟不爽的一点,差点造成运营事故

现在可以安心使用了。

我自己改的 修改一处OSSEC的BUG

官方修补的

 
2009-10-25 0:19

 
2009-09-15 20:17

今天某群问监视某程序运行,先用linux shell脚本给他写了一段。结果他说是windows用... 于是想到了powershell

while(1){clear;ps "notepad";if($?){echo ok}else{echo err;run command};sleep 1}

监视多台服务器的进程

PS C:\> while(1){clear;'127.0.0.1','192.168.1.110' | foreach-object -process {echo [$_];tasklist /s $_ |findstr 'svch*'};sleep 1

 
   
 
 
文章分类
 
   
 
文章存档
 
     
 
最新文章评论
  

确实挺烦
 

不错,转走留念,嘿嘿
 

回复winsyk:曾经土豆约稿篇稿费的旧文
 

精彩。
 

畸形社会的衍生物。
   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu