Tip: 看不到本站引用 Flickr 的图片? 下载 Firefox Access Flickr 插件 | AD: 订阅 DBA notes -- ![]()
2008-08-05 Tue
展览的选址和时间几经周折,最后终于定在8月6日-8月26日,在干叶子茶料理(新华路359号 近定西路),BlogBus邀请大家去“品茗赏袋”。

1、杭州,某公共广告上反复播放着“一舟无痛人流医院”的广告,貌似很正规很大的医院,广告里一直最强调着的概念是 —— “安全”。
广告片尾留有联系方式,电话、和24小时值守的QQ号码。
我认为他们很了解自己的用户群:需求大、担心安全问题、害怕、不好意思、用QQ。
我认为他们很知道QQ的作用:典型客户都在用而且很依赖、不见面可以省去很多尴尬。
2、杭州,每个路口都有一个铁架搭的棚子。很多小区的灯箱下面其实都是灭蚊器。
因为:太阳很大,雨水很多。行人可以在此躲避,也避免了闯红灯。
因为:绿地很多的小区蚊子也很多。
我认为他们很了解自己的用户活动场景。
3、杭州,下午4点半到7点你几乎打不到车。因为这是出租车换班时间,而且这是下班高峰期。
不知道哪个缺心眼的要把换班时间设置到这个时候。据说是政府为了平衡出租车、公车之间的利益。
4、北京,首都机场,候机厅。
等待是一件最难熬的事情,这个时候抽烟是一个不错的选择。看到有人从吸烟室出来,我很纳闷——“打火机都被没收了,丫们怎么点烟的?”
进一吸烟后发现,原来机场准备好了被固定的烟斗。赶紧点上,爽哉!
我认为他们了解用户的需求。用什么功能无所谓,只要能满足这种需求。
有些非核心和常用功能怎么展现、是否突出给用户,无所谓。真的需要时,我自己会去找到这个功能。
5、北京,出门记得带身份证、暂住证、结婚证。良民证。
昨天有个客户单位的兄弟,下午过来干活,在我们这里的一台交换机莫名其妙配置貌似被人改了,enable口令也被人改了,估计是内部谁干活的时候不小心弄错了,否则也不会去改端口上的配置啊。
昨天下午回复了口令和配置,让他设置一个新口令,结果糊里糊涂设置了个enable口令,今天早上一看又是进不去,于是帮着回忆昨天的口令。
口令还是记得的,但就是不对,于是怀疑他当时拼写错误了,于是两个人又开始猜口令,尝试所有可能的拼写错误,我运气比较好,尝试记录如下:
Switch>en
...
Are you sick of your ISP’s DHCP and want more control? Maybe you have a crusty Windows DHCP server that is about to blow up from the latest virus of the month or a series of “magic” GUI clicks gone horribly wrong.
Do a little spring cleaning, and solve your network problems with open source software. Setting up a DHCP server with Red Hat Enterprise Linux 5 or Fedora is a piece of cake. In this article we’ll go over the basics of setting up DHCP, doing basic troubleshooting, and finally setting up static mapping DHCP.
1. Install DHCP.
yum install dhcp2. Turn on the service at boot.
chkconfig dhcpd on3. Start the the service.
service dhcp start
Whoops–you’ll get a message like this:
[root@mothership etc]# service dhcpd start Starting dhcpd: [FAILED]
That’s because the dhcpd.conf file in the /etc directory is empty. If you take a look at it, you’ll see a hint:
# # DHCP Server Configuration file. # see /usr/share/doc/dhcp*/dhcpd.conf.sample #
On Red Hat Enterprise Linux 5.2 you should see something like the following in /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample:
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option nis-domain "domain.org";
option domain-name "domain.org";
option domain-name-servers 192.168.1.1;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.0.128 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
}
This is a lot to digest, but we can break it down. I’m a big fan of doing the absolute minimum to get something started. For most users, you probably want to have a few static mapped IP addresses based on a MAC address, and then everyone else will get IP addresses from a range. To do this, copy from this file, and then paste the sample into /etc/dhcpd.conf.
Minimal DHCP config
authoritative;
ddns-update-style interim;
default-lease-time 21600;
max-lease-time 43200;
option routers 192.168.1.254;
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.10;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.120;
}
If you are a vim user, you should do this to paste it in:
:set paste
Then insert using “i”, and paste it in. This ensures a cut and paste that preserves formatting–a nice trick to know about in vim.
Minimal DHCP config explained line by line
You can man dhcpd.conf for a more thorough explanation, but here are some simple
explanations of the minimal DHCP configuration:
- authoritative;
Makes the DHCP server authoritative for requests. This is not set by default, but it needs to be configured to distribute IP addresses. This is to ensure that “rogue” DHCP servers are not set up willy-nilly by people who don’t understand how they work.
- ddns-update-style interim;
This line must be in the config for dhcpd to run. For more information, read the man page for dhcpd.conf.
- default-lease-time 21600;
max-lease-time 43200;These two lines set maximum and minimum times for a client to hold onto an IP address lease obtained from the dhcp server.
- option routers 192.168.1.254;
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.10; - subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.120;
}This final section is where subnet declarations go. In this declaration, we are saying that any client on the subnet 192.168.1.0 will get an IP address with the information we defined above, but they will only get an IP address in the .100 to .120 range. So you can’t get 192.168.1.121 or 192.168.1.99, but you can get any IP address in between.
These four lines are basic network configuration parameters that you would normally set if you had to manually configure an IP address. This is, in fact, one of the main points of DHCP. Note that the line that says domain-name-servers–this is where you tell the clients to grab information from DNS servers. If you set up your own caching DNS server to speed up name server lookups, then this would be the place to tell the DHCP clients about it.
Now you’re ready to alter your configuration to match your network, and then restart or start for the first time dhcp:
service dhcp start
Simple troubleshooting steps and tips For DHCP
If things didn’t go as you excepted–for example, the dhcp server didn’t start–you should do a bit of troubleshooting. DHCP can be very frustrating to fix. Here are a few things to check:
1. Configure DHCP to only listen on a specific interface. Being explicit is always a safe bet, so you can edit /etc/sysconfig/dhcpd and define the interface to listen on. For eth0, this would look like:
# Command line options here DHCPDARGS=eth0
2. Start the dhcp server in foreground mode:
dhcpd -f
This is handy because it will show you more verbose errors than you would normally get from /var/log/messages.
3. Watch the semi-colons. One of the most common mistakes in a DHCP config is to forget a semi-colon. You can usually see the line number with the problem if you start dhcpd in foreground mode.
4. Restart the server, or reload the config file to see changes.
It’s very common to make changes and then wonder why they aren’t working. You need to either reload or restart the dhcpd service. Just remember that if you do restart and you have a semi-colon missing, then you will stop the dhcpd service. Doing a reload is safer, as it will not reload a broken config.
5. Use version control to keep track of every change to /etc/dhcpd.conf
Using version control to manage your /etc/dhcpd.conf file is a huge win. As long as you keep the file updated with changes, you can revert in milliseconds back to a known good configuration.
Getting fancy with static mapping
One of the cooler things that DHCP does is mix dynamically distributed addresses from a pool, and assign static addresses based on a hardware address, or MAC address. This last feature is called static mapping DHCP, and it’s the best thing since sliced bread.
Why is static mapping DHCP so cool? It allows you to automatically configure a machine’s network configuration, even if the operating system is rebuilt from scratch, as DHCP assigns it a specific address based on the ethernet hardware. This means if you set it up in the DNS, you will always know the hostname and IP address of the machine.
For a network administrator, that’s great news. To make things even better, you can mix and match part of your subnet with static mapping and part of it with regular DHCP. This is what that would look like based on our previous configuration.
authoritative;
ddns-update-style interim;
default-lease-time 21600;
max-lease-time 43200;
option routers 192.168.1.254;
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.10;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.120;
host noah {
hardware ethernet 00:11:00:11:00:11;
fixed-address 192.168.1.121;
}
}
If you look at this “mapping” configuration, you’ll see tell it’s really simple. The normal pool of addresses is set to give out addresses between 100-120, and we gave our “static” address to 121, but only if it matches a specific MAC address. You can create hundreds of these stanzas and control a whole network this way.
Summary
In this article, we went over how simple it is to set up sophisticated DHCP configurations in Fedora and Red Hat. There are other items that we did not cover in this article that you may want to research on your own. The first is ddns-update, which allows DHCP to update DNS on the fly. It’s a great tool to have in the DHCP toolkit. Second, we didn’t cover DHCP relay agents, which allow a DHCP server to relay requests to DHCP servers on other subnets.
Linux DHCP is a low-cost alternative to proprietary network servers that depend on the user doing a series of GUI clicks. On the surface it may seem convenient to have a “wizard” setup your network for you. But it’s often better to tap into the power of an explicit operating system like Linux. It doesn’t get any more explicit than a few lines in a dhcpd.conf config file. DHCP on Linux is elegant, simple, and powerful. Sure, the lure of the “dark side GUI click” is strong, but true mastery of networking lies with another path.
About the author
Noah Gift is the co-author of Python For Unix and Linux by O’Reilly and the upcoming Google App Engine in Action by Manning. He is an author, speaker, consultant, and community leader, writing for publications such as IBM developerWorks, Red Hat Magazine, O’Reilly, and MacTech. His consulting company’s website is www.giftcs.com, and his personal website is www.noahgift.com. Noah is also the current organizer for www.pyatl.org, which is the Python User Group for Atlanta, GA. He has a master’s degree in CIS from Cal State Los Angeles, a B.S. in nutritional science from Cal Poly San Luis Obispo, is an Apple and LPI certified SysAdmin, and has worked at companies such as Caltech, Disney Feature Animation, Sony Imageworks, and Turner Studios. In his free time he enjoys spending time with his wife Leah and their son Liam, playing the piano, and exercising religiously.
最近想在子项目中试一下 darcs ,替代原来的 svn 。只是尝试一下。
之前都是在本地玩 darcs 的,没遇到多少问题。今天找了台 freebsd 的机器,做了一个集中的仓库。没想到遇到许多麻烦。
我的想法很简单,在集中仓库的机器上建一个专有用户,把几个项目相关人员的 key 都放进去,大家都可以通过 ssh 访问这台机器。那么所有人都可以方便的通过 darcs get/put/pull/push 操作仓库了。
从 freebsd 或 linux 上远程操作这个仓库都没有多少问题,问题出在 windows 上。windows 版的 darcs 在提交文件时,一旦 patch 过大,就很容易失败。弄了一天才把问题弄明白。
一开始怀疑是 darcs 版本不匹配,patch bundle 文件不兼容。因为 freebsd 上装的是 2.0.2 版,而 windows 上是 2.0.0 版的。提交失败时,总会报一句,
darcs failed: Malformed patch bundle: '[init' is not 'Context:'
貌似我的 init 这个 patch bundle 格式错误。尝试了老版的仓库格式还是依然存在。
google 了一下,有许多人遇到跟我一样的问题,但是没有人解答。我试着找 2.0.2 版的 windows 下编译好的 darcs 未果。想自己在 windows 下 build 一个出来,怎么弄都没搞定,放弃。转而去 freebsd 下自己 build 了个 2.0.0 版的 darcs ,可问题依旧。
我用 darcs send -O 生成 patch 文件,再用 scp 放到远程机器上,然后 ssh 登陆 darcs apply 一下却没有问题。确定不是版本不兼容问题。
通过修改 DARCS_SSH 设置了一个 bat 文件间接引导 ssh ,以此观察 darcs 如何调用 ssh 工作。发现,在 darcs push 的时候,其实就是在远程机器上运行了 darcs apply ,然后等待标准输入。这边通过 ssh 把 patch bundle 发送过去。
由于小的 patch bundle 没有问题,问题都出在文件太大的时候。让人怀疑是 windows 控制台的问题。胡乱改了一些 windows 控制台的属性,并反复测试,发现同样大小的 patch bundle ,有时候可以正常工作,有时候却不行。很难确定具体原因。症状就是:从 ssh 建立的管道发送过去的输入数据不完整。
最后,放弃使用 mingw 版的 darcs 以及 putty 带的那个 plink (ssh)工具;装了一个 cygwin 以及 openssh 。一切就正常了。另外,如果用 cygwin + putty 的 ssh 也有问题。
我估计很大可能出在那个 darcs 的 windows 包中带的 ssh.exe (其实就是 putty 的 plink.exe )这个工具上。windows 糟糕的管道设施或许也有责任。
哎,在 windows 上跑 *nix 的命令行工具就是问题多多啊。
随手记录下这失败的一天,希望可以帮助到遇到同样问题 google 到这里的人们。
顺便宣传一下 darcs ,虽然 windows 版很是折磨了我一次,但东西还是很好用的。如果你有 svn / cvs 的经验,很容易切换过去。下面列几条基本指令,前几条大约可以跟 svn 对应起来,但不完全一致。
darcs get == svn co darcs put == svn import darcs pull == svn up darcs push == svn ci darcs record == 本地提交 darcs send == 发送/生成 patch bundle darcs apply == 打上 patch bundle
darcs 是没有版本号的,工作理念跟 svn 很不一样,但是很人性,容易让人接受。推荐有兴趣的朋友试一试。
我们已经进入了奥运封网阶段了.
下午一到办公室,alan同学就要我请吃饭,想想最近兄弟们也比较辛苦,而且我也有接近30小时没有吃东西了,那就答应吧.那小子说去吃火锅,37度高温去吃火锅,创意还真有.
那就去吧,顺便问他叫了那些兄弟,最后一数,有alipay的DCBA,Brotherxiao,钟离,小付;taobao的流云,Ningoo,小占以及我们公司的我,alan以及lori,一共刚好10个大男人
想想很久没有见这些兄弟了,那一起吃饭就一起吃饭好了.
先是taobao的三个兄弟到了,他们给我们电话的时候我快到门口了,进去,然后我们6人开始等alipay的兄弟,厉害是厉害的,10个人战斗力超强,基本上吃的都一扫光.
不过10个DBA在一起,居然没有聊技术,难得呀.大家都随便扯淡扯淡.
到买单的时候,发生了特别的意外,本来是alan准备买单的,结果服务员说,招商银行的信用卡可以打折,然后DCBA同学说他有,但是由于要刷招商银行的卡才可以打折,最后变成了DCBA买单.
总体来说,吃的还是蛮爽的,就是Brotherxiao同学不肯喝酒,也不知道他咋的了,说是有咽炎,俺建议他最好能抽烟喝酒,你看我就没咽炎吗.另外,因为是DCBA买单,所以下次大家还有一次一起喝茶的机会,下次就肯定是alan同学买单了.
这次所有的人中,小付和小占都是从我们这个team中过去的,也算老熟人了,不过有意思的是,小付,小占和我在同一个team中,但是原来却属于三家公司的人.小占同学今天还接到猎头电话,询问我们这个team中都有谁,莫非我们这个team已经盛名在外了?
嗯,想要知道10个男DBA到底在一起聊了啥,吃了啥?这些信息是保密的,呵呵,谁出价高我就告诉谁,哈哈.
最近写了一个系统资源监控的脚本,想让它每次机器重启后也可以自动启动,决定放到inittab中去,于是写了一个脚本run.sh,执行的时候启动脚本,并且加入inittab,可是调试的时候发现sed对shell的变量引用一直无法替换,百思不得其解,后来得到几位高手指点,终于解决,还有两种解决方法。
问题描述:
命令是这样的
work_dir=/home/ractest
sed ‘/start_mon.sh/d
/init.crsd/ a\
h4:3:respawn:${work_dir}/scripts/start_mon.sh >/dev/null 2>&1
‘ /etc/inittab
想把work_dir替换,但是没成功。
sed “/start_mon.sh/d
/init.crsd/ a\
h4:3:respawn:${work_dir}/scripts/start_mon.sh >/dev/null 2>&1
” /etc/inittab
试过,报错
sed: command garbled: /init.crsd/ ah4:3:respawn:/home/ractest/ricky/atm_monitor/scripts/start_mon.sh >/dev/null 2>&1
在Solaris上不行,但是在Linux上是可以的,所以初步确定是sed版本的问题,但是在Solaris上怎么解决这个我呢?有如下两种方法:
方法一:使用单引号
单引号:
sed ‘/start_mon.sh/d
> /init.crsd/ a\
> h4:3:respawn:’${work_dir}’/scripts/start_mon.sh >/dev/null 2>&1
> ‘ /etc/inittab
方法二:使用双引号
sed “/start_mon.sh/d
> /init.crsd/ a\\
> h4:3:respawn:${work_dir}/scripts/start_mon.sh >/dev/null 2>&1
> ” /etc/inittab
经过测试,两种方法都可以成功。
记录之!
不可否认,Ajax技术的流行给网站带来了很大的改变,用户在使用网站的时候得到了比以往好上几倍的体验感受,而在这些改善当中,Ajax技术在注册表单上的应用带给用户的改善无疑占了很大一部分。然而并非只要在网站上应用Ajax技术就能改善用户体验,很多的网站由于Ajax技术的滥用或者使用不当,带来的效果往往是相反的。
注册表单做为网站的最基础应用之一,以往是用户所诟病最多的地方,因为用户不得不一次又一次的面临提交注册信息后服务器返回信息“用户名已被注册”或者“两次输入的密码不同”等困境,用户不得不在注册这一环节上接受一次又一次的失败挫折感。而随着Ajax技术的应用,注册表单的用户体验得到了颠覆性的改善。通过Ajax技术对注册表单填写项的实时检测,以判断用户输入的内容是否正确,用户已经不会在注册的时候遇到诸如提交注册信息后返回“用户名已被注册”之类的困境了。
在填写注册表单时,由于密码是不可见的,所以很多网站在注册时都会要求用户填写两次密码,以便确认用户不会因为误输入而把密码弄错。通过对输入内容的实时检测,Ajax程序可以判断出用户两次输入的密码是否相同,在这项应用的基础上,很多网站在用户输入密码的时候又加入了对密码强度的判断,以进一步保障用户的密码安全。
互联网上有无数个网站,几乎所有的网民都会在不同的网站注册用户,以便得到不同的服务。然而如何去记忆这数量众多的用户名与密码并将其与相应的网站对上号,成了用户头痛的一件事,很多的用户不能使用帐号登录网站并不是因为帐号或者密码被盗而是因为自己忘记了帐号或者密码。
因为用户有这种需求,所以出现了OpenID这个身份网址的平台,OpenID极大的方便了用户管理自己的信息,然而由于商业利益等因素在内,只有很少的网站支持OpenID平台,特别是国内的互联网更是只有极少一些网站支持OpenID平台。
所以一般情况下,用户会以一个相同的用户名跟密码去注册不同的网站,当然这是在环境允许(比如说用户名未被注册)的前提下的。这个用户名跟密码会是与用户相关的信息内容,因为这样便于用户记忆。不是特殊情况,用户一般不会轻易的更改这个用户名跟密码。
然而在注册表单中加入的密码强度检测这一功能,却很有可能改变用户的这一习惯,因此也更有可能造成用户忘记密码的概率上千。
如果用户在输入密码的时候,被系统告知密码强度为“弱”,那么用户不可能对此视若无睹。这就犹如一个“权威人士”告诉你,你家大门上的锁是很容易开的那种,你的心里自然会产生一种不安全的心理,为了让自己感到安心,于是你选择了换锁。而用户在输入密码的时候被告知强度为“弱”时也会有这个心理,于是有很大一部分用户为了让自己心里有安全感,选择了更换自己熟悉的密码,换成新的不容易记忆的密码只是为了让自己有一种安全感在心里。这无疑是加重了用户的记忆负担。
更有甚者,当用户输入的密码被系统判断为“弱”时,竟不能完成注册表单的提交!无疑这是一个很错误的行为。
事实上,由于密码强度是由各网站自己定义的,并没有一个统一的标准,所以很有可能在A网站注册输入密码时被告知强度为“中”,但在B网站注册时却被告知强度为“弱”,由此产生用户不得不去根据不同网站注册时系统告知的密码强弱去更改自己的密码。
密码强度检测本意只是为了给用户一个善意的提醒,希望用户对自己信息有更强的保护心理,但由于在注册过程中把密码强度检测提到一个比较明显的位置,所以“迫使”有些用户去修改自己熟悉的信息,从而增加用户的负担。
注册表单越来越精简,在精简的基础上,试着去减轻用户的负担。密码强度检测并不是没有需要,但不应该把它做为一个显眼的标准,更好的情形应该把其做为对用户注册时一个善意的提醒。
相关日志
Shared by Pahud
看來SSD for server還是不大成熟
PIXNET 買的兩顆用了不到半年的 Memoright SSD 最近一起故障了。
故障的狀況為出現 DMA Error。目前沒有掛點的 SSD 只剩下 Mtron 1000 系列。
Shared by 5+马化腾下军令状:腾讯网奥运报道要争流量第一 ,也就是说,心疼网三家中,明确号称要超越新浪了,也就是说要做“第一门户”了。
这则新闻够震撼
回味无穷
小马哥的策略很简单,就是“在完成各项准备后,腾讯测试的结果显示,奥运新闻推送至 3亿用户桌面的时间只需要短短的30秒,实现了真正意义上的第一时间传播”,说白了,就tmd弹窗嘛。。
现在我的感觉是每天都在吃方便面,今麦郎,因为每天我都要被弹很多次,不给钱成为会员的话,还没法屏蔽,以前曾经一段时间花钱买会员,就是为了Y不给我弹窗,后来算了,忍了。
因此建议马化腾直接收购今麦郎算了,这样就可以腾讯今麦郎,还是让葛优代言,吃今麦郎弹面,享受QQ弹窗,一边吃面一边看奥运。相关文章:
三英战吕布 心疼网挑搜狐 (2008-7-16 13:12:2)
发地震假消息 腾讯会不会受到新闻办制裁? (2008-5-12 17:28:21)
2008-08-04 Mon
2008-08-03 Sun
2008-08-02 Sat
AnySQL.net
DBA notes
Oracle & Starcraft
eagle's home
Give you some color to see see!
AnySQL.net English
Oracle Scratchpad
Oracle Life
OracleDBA Blog---Please enjoy the pain which is unable to avoid!
Uploads from dbanotes
Chanel [K]
xzh2000的博客
Oracle Security Blog
ERN空间
Eddie Awad's Blog
MySQL Performance Blog
The Tom Kyte Blog
Delicious/Fenng/oracle
AIXpert
O'Reilly Databases
Red Hat Magazine
DBASupport
DB2 Magazine 中文版
developerWorks 中国 : 技术文章 , 教程 AIX
Pythian Group Blog » Log Buffer
车东[Blog^2]
blue_prince
玉面飞龙的BLOG
此生 今世
人生就是如此
Orange Tiger 木匠 的 移民生活
生活帮-LifeBang
Hey!! Sky!
dba on unix
Oracle Notes Wiki
Brotherxiao's Home
柔嘉维则@life.oracle.eng
Fenng's shared items in Google Reader
jametong's shared items in Google Reader
缥缈游侠-logzgh
Tanel Poder's blog: Core IT for geeks and pros
DBA Tools
ilonng
yangtingkun
Oracle & Unix
Inside the Oracle Optimizer - Removing the black magic
Ricky's Test Blog
DBA@Taobao
存储部落
Think in 88
Alibaba DBA Team
Oracle Team @SNC
淘宝数据仓库团队
OracleBlog.cn
中国雅虎_站长天下_www.dbaleading.com_原创文章

