Feeds:
文章
评论

Posts Tagged ‘tips’

e.g.   sed -i ‘N; s/line1\n  line2/line1/’ /path/to/file

“N;” means multiline sed and “\n” means a NEW_LINE_CHAR

More example on http://www.thegeekstuff.com/2009/11/unix-sed-tutorial-multi-line-file-operation-with-6-practical-examples/

Advertisements

Read Full Post »

有的网页中给<input>加上了 autocomplete=off, firefox就不会记住用户输入的内容. 

要让 Firefox 记住任意网站密码:

1) Windows 用户:找到 C:\Program Files\Mozilla Firefox\components\nsLoginManager.js

2) 然后搜索 _isAutocompleteDisabled,将 "return true;" 修改为 "return false;"

  修改后, 如下图所示:

image

3) 重启Firefox.  以后更新到新版本的Firefox, 需要重新做相应修改

 

Firefox会弹出一个对话框, 询问是否将记住的旧密码修改为新密码, 一般我们都会选’修改’.

让Firefox自动修改新的密码:

1) Windows 用户:找到 C:\Program Files\Mozilla Firefox\components\nsLoginManagerPrompter.js

2) 查找  this._showLoginNotification(aNotifyBox, "password-change"

    将相关行注释掉, 并加上  "pwmgr.addLogin(aNewLogin);"  

  修改后, 如下图所示:

image

3) 重启Firefox.  以后更新到新版本的Firefox, 需要重新做相应修改.

 

Ref:

http://www.appinn.com/make-firefox-remember-any-password

http://superuser.com/questions/73444/firefox-remember-new-passwords-without-prompting

Read Full Post »

Symptom

The installation of Dircector 6.x failed (just hung there). Then re-run dirinstall.server, saying:

Installation Summary
——————–
Name Level Part Event Result
———————————————————————-
DirectorCommonAgent 6.x.0.0 ROOT APPLY FAILED
DirectorCommonAgent 6.x.0.0 ROOT CLEANUP SUCCESS
Installation of IBM Systems Director Server did not complete successfully.

And run “installp –C” can’t solve this issue.

Solution

  1. # smit maintain_software
  2. select Remove Installed Software
  3. enter name DirectorCommonAgent
  4. set preview to “no”, press ENTER, exit smit
  5. run “dirinstall.server

Get more info on IBM doc library.

Read Full Post »

Loggers may be assigned levels. The set of possible levels, that is DEBUG, INFO, WARN, ERROR and FATAL are defined in the org.apache.log4j.Level class.
If a given logger is not assigned a level, then it inherits one from its closest ancestor with an assigned level.

The root logger resides at the top of the logger hierarchy. It always exists and always has an assigned level.

The logger is the core component of the logging process. In log4j, there are 5 normal levels Levels of logger available (not including custom Levels), the following is borrowed from the log4j API (http://jakarta.apache.org/log4j/docs/api/index.html):
DEBUG – The DEBUG Level designates fine-grained informational events that are most useful to debug an application.
INFO – The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
WARN – The WARN level designates potentially harmful situations.
ERROR – The ERROR level designates error events that might still allow the application to continue running.

TRACE – The TRACE Level designates finer-grained informational events than the DEBUG
FATAL – The FATAL level designates very severe error events that will presumably lead the application to abort.
In addition, there are two special levels of logging available: (descriptions borrowed from the log4j API http://jakarta.apache.org/log4j/docs/api/index.html):
ALL -The ALL Level has the lowest possible rank and is intended to turn on all logging.
OFF – The OFF Level has the highest possible rank and is intended to turn off logging.

 

source:

Read Full Post »

HTML has many predefined entities, but XML has only five predefined entities:

  • &amp; (& or “ampersand”)
  • &lt; (< or “less than”)
  • &gt; (> or “greater than”)
  • &apos; (‘ or “apostrophe”)
  • &quot; (” or “quotation mark”)

“& #160;” is the decimal form of “& nbsp;” which represents a “Non-Breaking Space” in HTML/XHTML, whilst “& #xA0;” is the hexadecimal form.
“& #160;”  or “& #xA0;” definitely works in both HTML and XML. 

Ref:

Read Full Post »

When launching a rails 2.0 app, error occurs:

C:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:319:in `activate’: can’t activate activerecord (= 1.15.6), already activated activerecord-2.0.2] (Gem::Exception)

To fix this, simply uninstall old rails gem by executing:

gem cleanup

ref: http://www.ruby-forum.com/topic/137509

Read Full Post »