Posts

Showing posts from December, 2011

Replace String in Unix

To replace all instances of a string in a directory (subdirectories included) do:
Code: perl -e "s/FIND/REPLACE/g;" -pi.save $(find path/to/DIRECTORY -type f)
The above will make a backup temp file of your original 
If you do not want a temp file with the .save extension then do:

Code: perl -e "s/FIND/REPLACE/g;" -pi $(find path/to/DIRECTORY -type f) --------------------
Example:
You want to replace all instances of the word "design" with "dezine" in the directory /public_html/company/info

you can execute the command from document root as 
Code: perl -e "s/design/dezine/g;" -pi.save $(find public_html/company/info -type f) or you can execute the command from public_html/company/ (a directory above) as:
Code: perl -e "s/design/dezine/g;" -pi.save $(find info -type f) ------------------------------

The above commands will search all files (.gif, .jpg, .htm, .html, .txt) so you might see some error messages "Can't open *.gif", …

Changing Windows Account password using Outlook

http://theessentialexchange.com/blogs/michael/archive/2007/11/24/changing-user-passwords-with-outlook-2003-2007.aspx.
1) Call the helpdesk - the most likely scenario if you are not in a hosted environment2) Use the control panel - most Hosted Exchange providers provide a function on a user's control panel enabling the user to change their password, using the functionality in item (3). Most large companies will implement a similar capability for their users. Small companies will likely need to implement item (3) directly or their helpdesk will do it (as in item 1).3) Enable IISADMPWD - use KB 555071 to enable the use of a web page to allow changing the password of an active directory user.