一个ssh有选择的自动登录Shell

Written by ray on 2007/08/31 09:36
对于机房有多台服务器的管理人员来说,每次ssh登录某台主机都要输入一段很长的命令,很是麻烦,不如写个脚本可以自动选择的登录,其中还包括ssh密钥管理。
#!/bin/bash
#
#################################
# Purpose: SSH AUTO LOGIN
# Author: lilith , E-Mail ( XXX AT gmail DOT com)
# Date: 2007
#################################
#
#################################
OPTIONS="Route:ray@192.168.101.254 Diskless:allen@xxx Printer:root@192.168.101.118 Blog:root@192.168.101.196 Mail:ray@xxx Samba:root@192.168.101.136 Universe:root@192.168.101.238"
select opt in $OPTIONS
do
        if [ -z $opt ];then
                echo "Nothing done...Exiting"
                break
        fi
        opt=`echo $opt | awk -F : '{print $2}'`
        ssh -X $opt
        break
done

exit 0

Linux下制作iso方法4则

Written by ray on 2007/08/30 09:05


× dd if=/dev/cdrom of=xxx.iso
× cp -r /directory xxx.iso
× cat /dev/cdrom > xxx.iso
× mkisofs -a -l -J -L -r -o filename.iso /directory

Tags:

一个检查ADSL地址的脚本

Written by ray on 2007/08/23 15:06
主要功能是获取ADSL自动重拨后新的IP地址
思路定时检查当前地址,并与原来的地址做比较,如果不一样就发邮件给我,一样就什么也不做。
这思路有点傻,原来想的是既然是ADSL自动重拨,那在这个时候发邮件给我那是最好的,但没有实现

#!/bin/bash
#
#################################
# Purpose: Check ADSL IPADDRESS
# Author: Allen.Zheng , E-Mail ( allenzheng DOT sh AT gmail DOT com)
# Date: 2007/08/23
#################################
#
#################################

ifconfig  ppp0 | grep Mask | awk -F ":" '{print $2}'| awk '{print $1}' > ./ipaddress_last

if [ -n "`diff ipaddress_old ipaddress_last`" ];

then

ifconfig  ppp0 | grep Mask | awk -F ":" '{print $2}'| awk '{print $1}' > ./ipaddress_old

sendEmail -f ADSL-IPaddress-report@xxx.com -t 我的邮箱 -u "ADSL-IPaddress-Report" -o message-file=ipaddress_last

else

echo "I\`m ok"
fi


在crontab里定时执行这个文件。
Tags: , ,

让Opera显示淘宝的图片

Written by ray on 2007/08/22 17:26
Opera一直是我首选的浏览器,除了网银要用IE外(不是IE好用,而是中国网银太烂,只支持IE,浦发的网银已经支持firefox了),基本都是用Opera的,Opera有很多人性化的地方,许多以IE为内核的浏览器的功能都是模仿Opera,Opera才是鼻祖,cool
不过Opera在浏览淘宝的时候不能显示宝贝的图片,总是显示服务器超时,非常不爽。
在网上还是找到了高人写的js脚本,顺便推广一下。grin

// ==UserScript==
// @name Show images - Taobao.com

// @author somh
// @ahmore@gmail.com
// @include http://auction1.taobao.com/auction*
// @20:41 2006-9-6

// ==/UserScript==

var h=window.location.href;

var sUrls="taobao.com/auction";
var iShown=0;
if(h.indexOf(sUrls) != -1) {
window.addEventListener('load',function(e){
   try {

    if(!iShown){
     var p = document.getElementById('FlashArea');
     var z = document.getElementById('ZoomInLink');
     var iUrl = "";for (var i = 0; i < imageUrl.length; ++i) { var code = imageUrl.charCodeAt(i); iUrl += String.fromCharCode(code ^ (i % 5)); }
     iUrl=picServer+"/"+iUrl;
     iObj=new Image();
     iObj.src=iUrl;
     z.href=iUrl;
     x=p.parentNode;

     x.removeChild(p);
     p=document.createElement('img');
     x.appendChild(p);
   
     document.styleSheets[0].insertRule("img.iMover { border: 1px solid #FF6600; padding: 1px; cursor: hand }", 0);
     document.styleSheets[0].insertRule("img.iMout     { border:1px dotted; padding:1px;cursor: pointer}", 0);
     loadImage=setInterval(function(){
      if(iObj.width>0 && iObj.height>0){
       p.src=iUrl;
       aw=350;ah=350;w=iObj.width; h=iObj.height; r=w/h;
       if(w>aw)w=aw;h=w/r; if(h>ah)h=ah;w=h*r;
       p.width=w;p.height=h;p.className="iMout";p.title=z.innerText;
       p.setAttribute("onclick","window.open(this.src);");
       p.setAttribute("onmouseover","this.className=\'iMover\';");
       p.setAttribute("onmouseout","this.className=\'iMout\';");
       delete iObj;
       clearInterval(loadImage);
       iShown=1;
      }
     },10)
    }
   }catch (e){}
},true);

}

手动去除WLM(MSN)里广告的方法

Written by ray on 2007/08/19 17:17
现在用MSN(现在的叫WLM)的非常多,尤其是上班族,公司一般都是禁用QQ,允许用MSN的,但是现在MSN广告越来越多了,还是些视频广告非常占资源,有碍观瞻。有2个方法可以解决:
1.装msn shell 能去广告、加表情、还能多开,不过还是觉得占资源,有时还莫名其妙的崩溃,非常不爽,被我抛弃了。
2.手动修改原版,如下:

引用
用Resource Hacker打开msgsres.dll。

1.去除界面上的图片广告:位置4004-923
查找文本:ID=Atom(SSConstrainer)
将前面的layoutpos=top改为layoutpos=none

2.去除对话框下的文字广告:位置4004-920
查找文本:
<element id=atom(adbannercont) layout=filllayout()>

替换为:
<element layoutpos=none>


Resource Hacker 百度一下,可以在网上找到。

看看效果,整个世界清净啦~~

点击在新窗口中浏览此图片



Tags: , ,
分页: 3/5 第一页 上页 1 2 3 4 5 下页 最后页 [ 显示模式: 摘要 | 列表 ]