埃及国家区号:0020(+20)
Egypt Standard Time (GMT+02:00) 开罗 东二区
北京是东八区,太阳从东面升起,也就是埃及比北京慢6个小时
埃及夏令时:
4 月最后一个星期四 23:59:59.999
9 月最后一个星期四 23:59:59.999
该时段内埃及时间向前拨一个小时,变为GMT/UTC +03:00
也就是0点变成1点,和北京时差变为5个小时。
ps:曼谷时区
国家区号:+66(泰国)
GMT+07:00
比北京慢一个小时,不实行夏令时。
Sep 13 2008
埃及国家区号:0020(+20)
Egypt Standard Time (GMT+02:00) 开罗 东二区
北京是东八区,太阳从东面升起,也就是埃及比北京慢6个小时
埃及夏令时:
4 月最后一个星期四 23:59:59.999
9 月最后一个星期四 23:59:59.999
该时段内埃及时间向前拨一个小时,变为GMT/UTC +03:00
也就是0点变成1点,和北京时差变为5个小时。
ps:曼谷时区
国家区号:+66(泰国)
GMT+07:00
比北京慢一个小时,不实行夏令时。
Sep 12 2008
vista本来就是多语言核心,MUI包就可以直接转换,但是很不厚道,这个功能只有windows旗舰版才能用,如果是home家庭版的只能用LIP语言包,这种语言包是需要父语言的,比如西班牙语的父语言是英语,英语的操作系统就可以直接用LIP包安装西班牙语,问题是繁体中文或者简体中文谁是父语言呢,哈哈,这个问题就涉及到太多东西了,所以它们是没有父语言的,也就没有LIP包了。
那么vista home之类的版本怎么从繁体转换到简体呢,只要Vistalizator这个软件帮忙,去掉系统限制就好了。
大概就是下载简体的MUI包(微软),然后下载Vistalizator,解压,使用Vistalizator安装MUI包,重启完成
使用上没有什么问题,不过windows update的时候可能会有问题,哈哈
Sep 11 2008
第二次去吃,第一次是400多,这次竟然1000多,没吃出什么区别,可能是那条星斑贵吧。。。不过刷老板的卡就是爽。另外发现苹果醋还是挺好喝的,酸酸甜甜。不过上次在超市买的好像是酸得要死。。。
Sep 10 2008
以前也一直想找这样的小软件,定时提醒一下要休息眼睛了,要起来动动了,可是一直都没找到,那些什么桌面日历啊定时闹钟啊之类的都没有实现这样的功能,其实就是一个倒数和提醒的功能。。。
一天无意中逛网站的时候看到一款,下载来用了一个星期,貌似还不错,推荐一下
EyeDefender
http://www.eterlab.com/eyedefender/
免费的软件,汉化貌似跟不上更新,反正很简单的英文应该看得懂。
现在我的设置是每45分钟休息2分钟,idle无动作5分钟就reset重新计时,休息的时候播放自带的视觉训练,开机自动启动,就是有时候弹出来吓一跳,习惯了就好,哈哈
Sep 10 2008
Mysql性能测试工具集
Here is the list of MySQL benchmarking tools that were discussed during the “Benchmarking tools” session today.
It could have been nice if the speaker included sysbench and DBT-2 or DBT-5 as well. May be we can expect it for next year
Sep 10 2008
Sep 09 2008
crontab的时候sudo经常会碰到这个情况,其实修改一下sudo的配置就好了
vi /etc/sudoers (最好用visudo命令)
注释掉 Default requiretty 一行
#Default requiretty
意思就是sudo默认需要tty终端。注释掉就可以在后台执行了。
Sep 09 2008
刚才招商证券的打电话过来,一年前在他那里开户,说发现我账户套牢的比较严重。。。说有什么需要建议的话可以找他们商量下,我瀑布汗,直接说继续持有,不管,他就说这种想法都比较极端。。。汗啊汗,就算现在斩仓,这个熊市都找不到什么可以投资的了,直接放在这里算了,郁闷得很。
Sep 08 2008
这几天在研究mysql集群
主要就是replication和cluster两种模式
cluster主要数据都必须放在内存里面,没这么大内存,不玩。。。
replication这个模式通过binlog同步,很久很久以前用过,比较成熟,在前端加一个proxy做load balance性能应该还过得去,明天详细测试一下。
研究的时候发现另外一个东东,就是DRBD,分布式块设备,貌似比分布式文件系统更底层,块设备做了任何更改都可以反映出来,就是一个使用网络的raid-1,会不会比bin log 同步更快呢,值得研究,先记录一下。
DRBD® refers to block devices designed as a building block to form high availability (HA) clusters. This is done by mirroring a whole block device via an assigned network. It is shown as network raid-1- DRBD.
In the illustration above, the two orange boxes represent two servers that form an HA cluster. The boxes contain the usual components of a Linux™ kernel: file system, buffer cache, disk scheduler, disk drivers, TCP/IP stack and network interface card (NIC) driver. The black arrows illustrate the flow of data between these components.
The orange arrows show the flow of data, as DRBD mirrors the data of a high availably service from the active node of the HA cluster to the standby node of the HA cluster.
Sep 05 2008
400多台服务器,一个个加会死人的,发现原来那个猪头全部都加了sudo su,就是不用输密码就可以su,写个脚本遍历服务器加用户算了。。。
padduser.sh
#!/bin/bash
auth_user=hjlong
auth_key=./id_rsa
iplist=./iplist.sample
gpass=./random.pl
new_user_name=ssmax
new_user_pass=1234321
new_user_key_file=./pub
new_user_auth=`$gpass $new_user_pass`
new_user_key=`cat $new_user_key_file`
if test -f $iplist; then
for host in `cat $iplist`; do
link=(`echo $host | awk -F’:’ ‘{print $1,$2}’`);
command=”
if test ! -d /home/$new_user_name; then
useradd -m -p ‘$new_user_auth’ $new_user_name;
else
echo user $new_user_name exist;
fi
if test -e \`grep $new_user_name /etc/sudoers 2>&1\`; then
echo $new_user_name ‘ALL=NOPASSWD: ALL’ >> /etc/sudoers;
fi
if test -d /home/$new_user_name; then
cd /home/$new_user_name
if test ! -f .ssh/authorized_keys; then
mkdir .ssh
echo $new_user_key >> .ssh/authorized_keys
fi
chmod 700 .ssh
chmod 600 .ssh/*
chown -R $new_user_name:$new_user_name .ssh
fi
exit
”
ssh -t -t -o “StrictHostKeyChecking no” -o “ConnectTimeout 5” -p ${link[1]} -i $auth_key $auth_user@${link[0]} 2>&1 “sudo -S su – ” <<EOF
$command
EOF
#echo `ssh -t -t -o “StrictHostKeyChecking no” -o “ConnectTimeout 5” -p ${link[1]} -i $auth_key $auth_user@${link[0]} 2>&1 <<“$command” | sed “s/^/$host –/”`;
done
fi
················································································
生成密码的perl,符合unix crypt和特殊的种子
random.pl
#!/usr/bin/perl
###########################################################
# Written by ssmax
# 31 August, 2008
###########################################################
# This function generates random strings of a given length
sub generate_random_string
{
my $length_of_randomstring=shift;# the length of
# the random string to generate
my @chars=(‘a’..’z’,’A’..’Z’,’0′..’9′);
my $random_string;
foreach (1..$length_of_randomstring)
{
# rand @chars will generate a random
# number between 0 and scalar @chars
$random_string.=$chars[rand @chars];
}
return $random_string;
}
#generate linux password
my $random_string = ‘$1$’.&generate_random_string(8);
print crypt(shift, $random_string);
几个尚未解决的地方,如果用户没有sudo,很麻烦,就变成半自动了,要手工输入密码
本来用sudo -S su – <<EOF
标准输入来做,怎么都可以自动下去的,但是debain会弹出not a tty的错误,redhat就无问题,很郁闷。
ssh那段基本上是试了几百次才试出来的。。。唉。