August 23, 2007
Isaac Milestone: Turns
Live Support Chat for your website
This guy also wrote some test code but it does not seem to function
http://www.boutell.com/newfaq/creating/support.html
August 13, 2007
Find best childcare in your area
Their toll free number is 1-800-424-2246
August 11, 2007
Free and Legal Music
2. http://www.goingware.com/tips/legal-downloads.html#websites
3. Search Engine http://search.creativecommons.org/#
4. http://www.piano-midi.de/chopin.htm
Cheap OKI C5150n Cartridge
Not tried it yet. Looks good.
Cheap ML 1710 Laser Toner at
http://www.tonerkits.com/ml1710-3.html#
VCD authoring tools and related
2. ISO Recorder (http://isorecorder.alexfeinman.com/isorecorder.htm)
3. GNU vcdimager
4. VCDGear (convert mpeg1/2 to bin/cue file and back) at (http://www.vcdgear.com/download.html)
August 8, 2007
How to copy table from Firefox to Excel
Step 1: Hold down the CTRL key and click just outside the boarder of your grid. Either just above the grid, or on one of the sides. The entire grid should become highlighted.
Step 2: CTRL+C
Step 3: Open Excel and hit CTRL+V. You should get the entire grid pasted and formatted the same way you see it in Firefox.
Here is a good URL to practice with http://www.w3schools.com/browsers/browsers_stats.asp
To Paste a subset of a table, you will need to paste one column at a time:
Step 1: Ctrl+drag over the column you want in Firefox (yes, 1 column at a time).
Step 2: Paste into Excel. It will paste as a row, not a column. Don't worry - we'll get back to this. Repeat Steps 1 & 2 for as many cols of data that you need.
Step 3: After you have all the data you need into Excel (in rows), select them all and copy. Now move a few cells down and choose "Paste Special" - you'll see a few new options now. Choose "Transpose" in that dialog. This will turn the rows into columns.
July 26, 2007
July 19, 2007
Eating Place
Z-Pizza: Los Alamitos & 405
macaroni grill: Los Alamitos & 405
美食林: Alondra, 牛肉饼,木须肉
大肚鱼:South & Pinoeer
July 17, 2007
vim multiple repeat command
Or simpler:
:g/PATTERN/-1d
or even more simpler
:g/PATTERN/d
can be used to delete all lines that match PATTERN
See help :g for more
Another post from VIM TIP #227
:v/./,/./-j
I'll break down this incredible collapse-multiple-blank-lines command for everyone, now that I finally figured out how it works.
First, however, I'll rewrite it this way to illustrate that some of those slashes have totally different meaning than others:
:v_._,/./-1join
Note that to delimit expressions like these, just about any symbol can be used in place of the typical slashes... in this case, I used underscores. What we have is an inverse search (:v, same as :g!) for a dot ('.') which means anything except a newline. So this will match empty lines and proceed to execute [command] on each of them.
:v_._[command]
The remaining [command] is this, which is a fancy join command, abbreviated earlier as just 'j'.
,/./-1join
The comma tells it to work with a range of lines:
:help :,
With nothing before the comma, the range begins at the cursor, which is where that first blank line was. The end of the range is specified by a search, which to my knowledge actually does require slashes. The slash and dot mean to search for anything (again), which matches the nearest non-empty line and offsets by {offset} lines.
/./{offset}
The {offset} here is -1, meaning one line above. In the original command we just saw a minus sign, to which vim assumes a count of 1 by default, so it did the same thing as how I've rewritten it, but simply with one character fewer to type.
/./-1
There is a caveat about join that makes this trick possible. If you specify a range of only one line to "join", it will do nothing. For example, this command tells vim to join into one line all lines from 5 to 5, which does nothing:
:5,5join
In this case, any time you have more than one empty line (the case of interest), the join will see a range greater than one and join them together. For all single empty lines, join will leave it alone.
There's no good way use a delete command with :v/./ because you have to delete one line for every empty line you find. Join turned out to be the answer.
This command only merges truly "empty" lines... if any lines contain spaces and/or tabs, they will not be collapsed. To make sure you kill those lines, try this:
:v/^[^ \t]\+$/,/^[^ \t]\+$/-j
Or, to just clean such lines up first,
:%s/^[ \t]\+$//g
July 3, 2007
Air Ticket Agent
| 纳美旅行社 (Oriental Tour & Travel) | 800-951-3391 866-783-1688 |
| Bravo travel | 1-626-280-9988 |
| 中旅国际洛杉矶 (China Travel Service LA Office) | 888-664-5678 626-576-9688 |
| 美国亚洲旅行社 | 626-350-6376 |
泉威旅行Champion Travel Service (626)854-1808
| 一帆国际旅游 ( Vanguard Int'l Travel) | 866-882-6888 718-886-8868 |
| 加州阳光 | 626-5882818 |
| 丽来 | 1-909-594-6899 |
| JNC | 626-573-8888 |
| polo tours | 800-822-7656 |
| J&C Travel, Inc. | 626-573-8888 |
| 捷胜国际旅游 ( Sunlight International Travel) | 866-838-6898 718-762-1800 |
| 来来 | 213-626-6118 |
| 蓝天 | 800-644-3615 |
Software
PDFTK: free PDF tools
PDFTK GUI: http://angusj.com/pdftkb/
PDF Viewer with comment capability: http://www.docu-track.com/home/prod_user/pdfx_viewer/
May 15, 2007
snmptrap command
syntax:
-v 1: version 1
-c public: use community string "public"
192.168.100.40: trap manager's IP address (trap destination)
1.2.3.4: enterprise (i.e. type of device/object generating trap, default to system ID in mib II, can be empty)
192.168.254.50: trap source IP address (device's IP address)
3: generic trap ID, they are:
- coldStart(0),
- warmStart(1),
- linkDown(2),
- linkUp(3),
- authenticationFailure(4),
- egpNeighborLoss(5),
- enterpriseSpecific(6)
0: specific trap ID, 0 when generic trap ID is not 6
'': system up time (timestamp)
You can also add "mib type value" to the end of the command to send them along with the trap
v2 trap:
snmptrap -v 2c -c public 192.168.100.40 "" 1.2.3.4.0
"": system Uptime (when given as empty "", the system finds itself)
1.2.3.4.0: trap OID
again, add "mib type value" to the end if you want.
v3 trap:
snmptrap -v 3 -a SHA -A 1234567890 -x DES -X 1234567890 -l authPriv -u myuser -e "123abc" 192.168.100.1 "" linkUp.0
---
Update (09/10/2013)
When running snmptrap command, and seeing warning message like:
read_config_store open failure on /var/lib/net-snmp/snmpapp.conf
is okay. The trap is still being sent.
To run a debug catch-all snmptrapd:
snmptrapd -Le -On -f -n
with the following just-one-line in /etc/snmp/snmptrapd.conf
disableAuthorization yes
-n: no DNS lookup
-f: no fork
-On: print numeric OID
-Le: log to standard error
April 27, 2007
Some Useful Links for Linux
http://www.debian.org/distrib/packages
SSH X11 forwarding details
http://www.hackinglinuxexposed.com/articles/20040705.html
April 6, 2007
March 20, 2007
March 11, 2007
怎么吃才能不胀气
何谓腹部胀气?
腹部胀气是 指肠子中有大量的气体,即所谓的「肠气」。一般来说正常人的肠子每天约有7~10公升的气体产生,这些肠气大部分会被人体重新吸收,只有一些气体会由身体 排出,如打嗝、放屁等。肠气所包含的气体有氮气、氧气、二氧化碳、氢气、甲烷等。通常肠气是无味的,只有不到1%的稀有气体(硫化氢、氨气)具有臭味。
胀气的临床表现
当怀孕妇女觉得腹部胀气时,会增加肠子的蠕动而有腹胀、腹痛、腹泻、大量排气、甚至恶心、呕吐、食欲不振等,有些甚至还会影响到睡眠品质。
胀气产生的原因
胀气产生的原因有两个,一是吞下的气体太多,另一个是大肠制造的气体太多。
1.吞下气体过多
肠子的气体约有90%经口吞入,正常人每天所吞下的空气大约有500~1000西西左右,空气中的主要成分为氧和氮,人体吞下空气到小肠时,氧气会被吸 收,而氮气则跑到大肠成为大肠气的主要成分。很多情况下,人体会不知不觉吞下空气,例如:嚼口香糖时、吃东西时狼吞虎咽、边吃东西边说话、喝汽水、可乐、 啤酒等碳酸性饮料时、或吃一些容易产气的食物等。另外,还有一些人紧张时会不自主的作出吞口水的动作,这些因素都会导致肠内气体的增加。
2.大肠制造气体太多
肠子会制造气体是因肠蠕动障碍,造成细菌对食物过度发酵,而产生大量的气体;或因为肠道中某种消化酵素有问题,而导致某种食物的消化不良,最常见的就是「乳糖不耐症」,也就是说,肠胃道无法消化乳糖所引起,这时只要不吃含乳糖的食物自然就不会有症状产生。
胃酸过多也会引起胀气,胃中过多的胃酸和胰液中和后会产生二氧化碳,而造成胀气、打隔。另外,肛门太紧排气较困难,和慢性便秘也会逐渐形成腹部胀气的现象。我们可经由直接分析体内气体含量比例,进而分析腹部胀气的原因。如果吞下太多气体,则肠中氮气与氧气的浓度会较高,如果是肠内细菌发酵所造成的胀气,则肠中氢气与氧气的浓度会较高。
易造成产气的食物
人体内因为缺乏消化寡糖类及多醣类等碳水化合物的酵素,所以在摄取这类食物后,在小肠中不被消化,到大肠中被肠内细菌分解利用,然后产生大量气体(二氧 化碳、氢气、甲烷)。这些可能导致腹胀的「产气食物」,包括:豆类、洋葱、茄子、地瓜、马铃薯、玉米、柑橘类水果、添加甜味剂(山梨糖醇)的饮料和甜点 等。
产气食物表
食物类别 产气食物
五谷类 玉米、洋芋、芋头、蕃薯、马铃薯、糯米类、糙米、杂粮
蔬菜类 洋葱、花椰菜、韭菜、包心菜、胡瓜、萝卜、茄子、甘蓝菜、大头菜、
扁豆、酸泡白菜、青葱
水果类 苹果、西瓜、香瓜、哈蜜瓜、苹果汁
豆类 豆干、豆腐、红豆、绿豆、黄豆、花生、豌豆
乳类 牛奶、乳制品
饮料类 汽水、养乐多、豆浆、可乐
其它 咖啡、浓茶、巧克力、油炸类、高糖类的甜点、胡椒粉、香料
营养师的叮咛
对于吃下产气食物,是否真会产生胀气?其实是以个人体质而有所差异。怀孕期间准妈妈可经由个人经验观察出哪些食物容易引起胀气,并避免食用这些食物。一般来说,除了尽量避免食用上述产气食物外,因肠胃胀气也可能是外界压力过大、情绪不佳所引起,因此,准妈妈们也要适当减轻生活上的压力,切勿紧张焦虑,并保持心情轻松愉快。
tips:改善准妈妈肠胃胀气!
1.避免暴饮暴食。
2.吃东西要细嚼慢咽,不要狼吞虎咽。
3.吃饭时要闭着口,以减少吞入过多的空气。
4.减少嚼口香糖、不要边吃东西边说话。
5.避免喝汽水、可乐等碳酸性饮料。
6.喝饮料时用吸管小口饮用。
7.避免摄取高油脂、高糖类的食物,如油炸类、甜食、巧克力等。
8.养成定期排便的好习惯。
9.尽量避免食用易产气食物。
10.适度运动,也可减少腹部胀气的产生。
February 27, 2007
番泻叶临床应用及其不良反应分析
| |||
February 23, 2007
CVS Binary Mode
Here is an example of how you can create a new file using the `-kb'
flag:
$ echo '$Id$' > kotest
$ cvs add -kb -m"A test file" kotest
$ cvs ci -m"First checkin; contains a keyword" kotest
If a file accidentally gets added without `-kb', one can use the
`cvs admin' command to recover. For example:
$ echo '$Id$' > kotest
$ cvs add -m"A test file" kotest
$ cvs ci -m"First checkin; contains a keyword" kotest
$ cvs admin -kb kotest
$ cvs update -A kotest
$ cvs commit -m "make it binary" kotest # For non-unix systems
December 19, 2006
Bind: Address Already in Use
Bind: Address Already in Use
Or How to Avoid this Error when Closing TCP Connections
Normal Closure
In order for a network connection to close, both ends have to send FIN (final) packets, which indicate they will not send any additional data, and both ends must ACK (acknowledge) each other's FIN packets. The FIN packets are initiated by the application performing a close(), a shutdown(), or an exit(). The ACKs are handled by the kernel after the close() has completed. Because of this, it is possible for the process to complete before the kernel has released the associated network resource, and this port cannot be bound to another process until the kernel has decided that it is done.
Figure 1
Figure 1 shows all of the possible states that can occur during a normal closure, depending on the order in which things happen. Note that if you initiate closure, there is a TIME_WAIT state that is absent from the other side. This TIME_WAIT is necessary in case the ACK you sent wasn't received, or in case spurious packets show up for other reasons. I'm really not sure why this state isn't necessary on the other side, when the remote end initiates closure, but this is definitely the case. TIME_WAIT is the state that typically ties up the port for several minutes after the process has completed. The length of the associated timeout varies on different operating systems, and may be dynamic on some operating systems, however typical values are in the range of one to four minutes.
If both ends send a FIN before either end receives it, both ends will have to go through TIME_WAIT.
Normal Closure of Listen Sockets
A socket which is listening for connections can be closed immediately if there are no connections pending, and the state proceeds directly to CLOSED. If connections are pending however, FIN_WAIT_1 is entered, and a TIME_WAIT is inevitable.Note that it is impossible to completely guarantee a clean closure here. While you can check the connections using a select() call before closure, a tiny but real possibility exists that a connection could arrive after the select() but before the close().
Abnormal Closure
If the remote application dies unexpectedly while the connection is established, the local end will have to initiate closure. In this case TIME_WAIT is unavoidable. If the remote end disappears due to a network failure, or the remote machine reboots (both are rare), the local port will be tied up until each state times out. Worse, some older operating do not implement a timeout for FIN_WAIT_2, and it is possible to get stuck there forever, in which case restarting your server could require a reboot.If the local application dies while a connection is active, the port will be tied up in TIME_WAIT. This is also true if the application dies while a connection is pending.
Strategies for Avoidance
SO_REUSEADDR
You can use setsockopt() to set the SO_REUSEADDR socket option, which explicitly allows a process to bind to a port which remains in TIME_WAIT (it still only allows a single process to be bound to that port). This is the both the simplest and the most effective option for reducing the "address already in use" error.Oddly, using SO_REUSEADDR can actually lead to more difficult "address already in use" errors. SO_REUSADDR permits you to use a port that is stuck in TIME_WAIT, but you still can not use that port to establish a connection to the last place it connected to. What? Suppose I pick local port 1010, and connect to foobar.com port 300, and then close locally, leaving that port in TIME_WAIT. I can reuse local port 1010 right away to connect to anywhere except for foobar.com port 300.
A situation where this might be a problem is if my program is trying to find a reserved local port (<>SO_REUSADDR, then each time I run the program on my machine, I'll keep getting the same local reserved port, even if it is stuck in TIME_WAIT, and I risk getting a "connect: Address already in use" error if I go back to any place I've been to in the last few minutes. The solution here is to avoid SO_REUSEADDR.
Some folks don't like SO_REUSEADDR because it has a security stigma attached to it. On some operating systems it allows the same port to be used with a different address on the same machine by different processes at the same time. This is a problem because most servers bind to the port, but they don't bind to a specific address, instead they use INADDR_ANY (this is why things show up in netstat output as *.8080). So if the server is bound to *.8080, another malicious user on the local machine can bind to local-machine.8080, which will intercept all of your connections since it is more specific. This is only a problem on multi-user machines that don't have restricted logins, it is NOT a vulnerability from outside the machine. And it is easily avoided by binding your server to the machine's address.
Additionally, others don't like that a busy server may have hundreds or thousands of these TIME_WAIT sockets stacking up and using kernel resources. For these reasons, there's another option for avoiding this problem.
Client Closes First
Looking at the diagram above, it is clear that TIME_WAIT can be avoided if the remote end initiates the closure. So the server can avoid problems by letting the client close first. The application protocol must be designed so that the client knows when to close. The server can safely close in response to an EOF from the client, however it will also need to set a timeout when it is expecting an EOF in case the client has left the network ungracefully. In many cases simply waiting a few seconds before the server closes will be adequate.It probably makes more sense to call this method "Remote Closes First", because otherwise it depends on what you are calling the client and the server. If you are developing some system where a cluster of client programs sit on one machine and contact a variety of different servers, then you would want to foist the responsibility for closure onto the servers, to protect the resources on the client.
For example, I wrote a script that uses rsh to contact all of the machines on our network, and it does it in parallel, keeping some number of connections open at all times. rsh source ports are arbitrary available ports less than 1024. I initially used "rsh -n", which it turns out causes the local end to close first. After a few tests, every single free port less than 1024 was stuck in TIME_WAIT and I couldn't proceed. Removing the "-n" option causes the remote (server) end to close first (understanding why is left as an exercise for the reader), and should've eliminated the TIME_WAIT problem. However, without the -n, rsh can hang waiting for input. And, if you close input at the local end, this can again result in the port going into TIME_WAIT. I ended up avoiding the system-installed rsh program, and developing my own implementation in perl. My current implementation, multi-rsh, is available for download
Reduce Timeout
If (for whatever reason) neither of these options works for you, it may also be possible to shorten the timeout associated with TIME_WAIT. Whether this is possible and how it should be accomplished depends on the operating system you are using. Also, making this timeout too short could have negative side-effects, particularly in lossy or congested networks.In Linux, issue the following command to set the timeout_timewait parameter to 30 seconds:
echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout
From: http://hea-www.harvard.edu/~fine/Tech/addrinuse.html
