存档

‘Other Scripts’ 分类的存档

在bash中使用变量中的大于号来重定向

2009年12月2日 Galaxy 没有评论

http://stackoverflow.com/questions/1592859/how-to-supply-many-argv-and-outputredirection-with-one-bash-var

How to supply many argv and outputredirection with one bash var ?
In file a.lst:

in1.a in1.b > out1.a 2> out1.b
in2.a in2.b > out2.a 2> out2.b

In do.sh:

CLI=$(sed -n -e "1 p" a.lst)
perl a.pl $CLI

I want to run like perl a.pl in1.a in1.b > out1.a 2> out1.b, how can I make it work ?


$ARGV is populated with every argument. What doesn’t work is the outputredirection – Vinko Vrsalovic Oct 20 at 7:03

I can’t test it here, but it looks like using eval will work, so:

eval perl a.pl $CLI

阅读全文…

分类: Other Scripts 标签:

[ZT]Understanding the TLS Renegotiation Attack

2009年11月6日 Galaxy 没有评论

又是由于服务器支持更多功能(client-initiated renegotiation)而引发的漏洞。
所以说,安全性和易用性,不能两全啊。

不过,偶还是觉得vsftp比Serv-U好……

http://www.educatedguesswork.org/2009/11/understanding_the_tls_renegoti.html
http://extendedsubset.com/Renegotiating_TLS.pdf
https://svn.resiprocate.org/rep/ietf-drafts/ekr/draft-rescorla-tls-renegotiate.txt

Understanding the TLS Renegotiation Attack
By EKR on November 5, 2009 12:51 PM
阅读全文…

分类: Other Scripts 标签: ,

Grid Engine 的sh的一些tip

2009年8月31日 Galaxy 3 条评论

BGI的集群是用Grid Engine 6.0u8,入乡随俗,啃之。
http://wiki.gridengine.info/wiki/index.php/Simple-Job-Array-Howto
http://wiki.gridengine.info/wiki/index.php/StephansBlog
http://gridengine.sunsource.net/documentation.html
http://search.cpan.org/~tharsch/Schedule-DRMAAc-0.81/Schedule_DRMAAc.pod

先转载第一个吧(其实另3个没啥好转的,第四个计划以后啃):
阅读全文…

[ZT]用邮件发送表单来替代博客留言本功能

2009年7月27日 Galaxy 没有评论

恩,那些排名靠前的博客才需要,但,也算比较好玩的吧……
这是针对留言本的,不是针对回复。要不谁受得了。
原文是ASP的,现在没空转PHP,就直接转了。


http://www.williamlong.info/archives/1874.html

关闭博客留言本功能

  今天,将我博客的留言本功能关闭了,而使用一个邮件发送表单来替代,用户留言将直接发送到我的个人信箱中。

  之所以关闭这个“留言本”,其中一个原因是该页面在Google搜索“留言本”的页面排名太靠前,结果大量垃圾留言通过程序自动在该页面发布,黑帽SEO搜索“留言”和“留言本”的目的,就是为了找到页面来发垃圾链接,所以我的留言本就终日收到这些人的连番轰炸。

  关闭“留言本”更直接的原因是,前几天有人在留言本发了多条销售非法物品的广告,而这些“有害信息”留言差点让我的服务器被拔了网线,可见这些发送垃圾链接的家伙实在是害人啊。

  因此我有必要将这个留言本功能进行一定的改造,通过邮件的方式发送,而不直接在留言页面显示。

  将留言发送到Gmail还有一个好处,就是可以进行分类和过滤,我将接受留言的地址设置一个标签,然后用过滤器直接存档,对于垃圾留言,Gmail还能自动对垃圾邮件进行过滤。

  以下是该发送邮件功能的ASP代码。

< %
if request.form("email")<>""  then
 if instr(request.form("email"),"@")>0 then
  mail "email@gmail.com" , request.form("subject") , request.form("body")
  response.write "邮件发送成功!我们将尽快处理!"
  response.end
 else
  response.write "邮件地址“" & request.form("email") & "”错误,发送失败!"
  response.end
 end if
 response.end
end if
sub mail (mailto , mailsub , mailbody)
 dim jmail
 set jmail = server.createobject("jmail.message")
 jmail.silent = true
 jmail.logging = true
 jmail.charset = "utf-8" 
    tmprecipient=mailto
    do 
        if instr(tmprecipient,";") <> 0 then
            tmprecipient1 = left(tmprecipient,instr(tmprecipient,";")-1)
            tmprecipient=right(tmprecipient,len(tmprecipient)-instr(tmprecipient,";"))
            jmail.addrecipient tmprecipient1
        end if   
    loop while instr(tmprecipient,";") <> 0
    jmail.addrecipient tmprecipient 
 jmail.fromname = request.form("sender")
 jmail.from = request.form("email")
 jmail.replyto = request.form ("email")
 jmail.subject = mailsub
 jmail.htmlbody = mailbody
 jmail.priority = 1
 jmail.send("127.0.0.1")
 jmail.close()
end sub
%>
<html>
<head>
<meta content="text/html; charset=gb2312" http-equiv="content-type">
<title>留言本-月光博客</title>
</meta></head>
<body class="single">
<form name="frmmail" method="post" action="<%= request.servervariables("url")%>" onsubmit="return checkvalue()">
<table border=0 cellspacing=2 height=150 width=600>
  <tbody>
  <tr>
    <td align=middle height=24 width=80>
      <div align=center>姓 名:</div></td>
    <td height=2 width=519><input type="text" size="60" name="sender"/> </td></tr>
  <tr>
    <td align=middle height=24 width=80>
      <div align=center>邮 件:</div></td>
    <td height=2 width=519><input type="text" size="60" name="email"/> </td></tr>
  <tr>
    <td align=middle height=24 width=80>
      <div align=center>主 题:</div></td>
    <td height=2 width=519><input type= "text" size= "60" name= "subject"/> </td></tr>
  <tr>
    <td colspan=2><div align=center>
 <textarea cols=82 name="body" rows=12 wrap=physical title="可以使用ctrl+enter直接发送邮件" onkeydown="javascript:if(event.ctrlkey && window.event.keycode==13){this.document.frmmail.submit();}"></textarea> 
    </div></td></tr>
  <tr valign=bottom>
    <td colspan=2>
 <input alt=发送 name=send type=submit value="发 送"/>
 <input alt=取消 name=cancel type=reset value="重 填"/>
</td></tr>
</tbody></table>
</form>
</body>
</html>

阅读全文…

分类: Other Scripts 标签: , ,

[foobar]为EIKO方案增加ReplayGain显示

2009年5月3日 Galaxy 没有评论

EIKO是foobar2000的界面配置,由dReamxis(天気雨)(负责风格设计)和Jensen(负责代码编写)共同制作。

文件都打包了,含源码(本来也没编译就是了)eiko_g.rar

DEFINE:
__DISPLAY_RG	$ifgreater(%el_width%,580,1,0)
 
GroupHeader:
$font(Segoe UI,11,bold)
$if($and($strcmp(%__DISPLAY_RG%,1),%replaygain_album_gain%),
	$ifequal(%replaygain_album_peak%,1,,$puts(p,/ Peak:%replaygain_album_peak%))
	$puts(text,Album Gain:%replaygain_album_gain% $get(p))
	$drawtextex($get(text),$get(xOffset),$div(%el_height%,2),$get(w),$div(%el_height%,2),$get(c),vcenter left end_ellipsis)
)
 
PopupBG:
// Background========================
$fillrect(,,,,255-0-255)
//$imageabs(,,,,%Img.Path%\pl_tip.png,)
 
// Group Tracks=======================
$if(%el_is_group%,
	$imageabs(,,,,%Img.Path%\pl_tip.png,)
	$puts(yOffset,$add($div($sub(20,$gettextheight()),2),1))
 
PopupTrack
// Codec Info2----------------------------
$puts(text,[$caps2(%channels%)][  %samplerate%Hz][  $info(bitspersample)bit]$ifgreater([%subsong%],0,,[  %filesize_natural%]))
$drawtextex($get(text),$get(margin),$get(yOffset),$get(w),20,$get(c),nowrap end_ellipsis)
$puts(yOffset,$add($get(yOffset),20))
 
//Replay Gain-----------------------------
$if(%replaygain_track_gain%,
	$font(%PL_FONT%,9,)
	$puts(text,Track Gain: %replaygain_track_gain%
	$if(%replaygain_track_peak%,$ifequal(%replaygain_track_peak%,1,,
		 / Peak: %replaygain_track_peak%
	))
	)
	$drawtextex($get(text),$get(margin),$get(yOffset),$get(w),20,$get(c),nowrap end_ellipsis)
,
	$drawtextex(- Replay Gain not presented -,$get(margin),$get(yOffset),$get(w),20,$get(c),nowrap end_ellipsis)
)
$puts(yOffset,$add($get(yOffset),20))
//End RG
 
$puts(w,$sub($get(w),28))
// Play Count----------------------------
 
TrackList
$ifequal($get(DisplaySep),1,
	$puts(w,$sub($get(w),2))
,)
 
// Galaxy
$if($and($strcmp(%__DISPLAY_RG%,1),%replaygain_track_gain%),
	$drawrect($add($get(xOffset),$get(w)),0,1,%el_height%,$get(sepc1),)
	$drawrect($add($add($get(xOffset),$get(w)),1),0,1,%el_height%,$get(sepc2),)
	$puts(w,$sub($get(w),6))
	$ifequal(%replaygain_track_peak%,1,,$puts(p,/ %replaygain_track_peak%))
	$puts(text,%replaygain_track_gain% $left($get(p),8))
	$drawtext($get(text),$get(xOffset),0,$get(w),%el_height%,$get(c),vcenter right)
	$puts(w,$sub($get(w),$max($gettextwidth($get(text)),34)))
	$puts(DisplaySep,1)
)
$ifequal($get(DisplaySep),1,
	$puts(w,$sub($get(w),2))
,)
// Galaxy
 
// Rating -----------------------------------------------------
分类: Other Scripts 标签:
Locations of visitors to this page