Posts

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 erro...

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 environment 2) 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.

How to remove the dreaded '^M' character in unix files

While there are lots of ways to go about solving the issue, two methods that I find to my liking are: 1. Using 'tr' tr -d '^M' < [input filename] > [output filename] e.g; tr -d '^M' < opx_LOD_GEN_110_003110000.ini > test3.txt 2. Using vi editor. :%s/(ctrl-v)(ctrl-m)//g Simply type in the above in your vi editor to get the desired effect. And note that you have to press 'ctrl' AND 'V' and later 'ctrl' AND 'm'. It's not the same as the '^' and 'M' character. Both of them worked for me. Details can be found here: 1) http://www.tech-bits.com/index.php?View=entry&CategoryID=6&EntryID=54 2) http://www.devdaily.com/unix/edu/un010011/

Oracle Locks - ORA00054

Most of the self-help website outthere would suggest that whenever you encounter the ORA-00054 error message; just go check the tables like DBA_BLOCKERS and the likes to weed out the root cause. Well for typical users like me, every time I run the command "select * from DBA_BLOCKERS" the only reply I get from the DB would be something like "object does not exist". Bummer. That is until I found out that you actually had to run a script for all of those "DBA lock"-related table to be created. Simply go to $ORACLE_HOME/rdbms/admin directory and run catblock.sql script. And owh yeah - you might need to have admin privileges for this to work.

What does “> /dev/null 2>&1″ mean?

Taken from http://www.xaprb.com/blog/2006/06/06/what-does-devnull-21-mean/ I remember being confused for a very long time about the trailing garbage in commands I saw in Unix systems, especially while watching compilers do their work. Nobody I asked could tell me what the funny greater-thans, ampersands and numbers after the commands meant, and search engines never turned up anything but examples of it being used without explanation. In this article I’ll explain those weird commands. Here’s an example command: wibble > /dev/null 2>&1 Output redirection The greater-thans ( > ) in commands like these redirect the program’s output somewhere. In this case, something is being redirected into /dev/null , and something is being redirected into &1 . Standard in, out, and error There are three standard sources of input and output for a program. Standard input usually comes from the keyboard if it’s an interactive program, or from another program if it’s processing the other pro...

MVNO: Through thick and thin

The below article was taken from Silicon.com. Click here to read the actual article. By Natasha Lomas, 27 October 2008 16:23 MVNO? That'll be an abbreviation - another pointless four letter one no doubt… Right and wrong. MVNO stands for mobile virtual network operator - and it refers to a rather intriguing slice of the mobile pie. I'm listening… Building and operating a mobile network is an expensive business, not least because it requires radio spectrum, so the number of mobile network operators (or MNOs) is limited to, at most, a handful per market. For instance, the UK market has five: 3, O2, Orange, T-Mobile and Vodafone. Spectrum does not come cheap. The auction for 3G licences in the UK - way back in 2000 - ended with five companies shelling out a whopping £22.47bn for the privilege of flogging third-generation services to Brits. So the requirement for large capital expenditure to set up a mobile network goes some way to explaining why actual networks are not 10-a-penny. ...

Hotbilling Concept

The below article was taken from Hot Billing Concept by Advanced Multimedia System Design . Prehistory Darwin teaches us that far ancestors of billing systems were simple log files, or record books. All they could do automatically was regular information storage, " The client dialed in at 19:00 and disconnected at 21:00 "; information retrieval was a less trivial procedure. When computers left the developers' pools and migrated to the commercial land, logs had to be taught to detect account overdraft automatically, not at the end of the month. Billing systems of the newer generation were reptile guardians, timing a given delay, " This is the first day of the rest of your life! ", and biting the connection off when the session timed out. But the evolution went on. Cold-blooded billing systems could prevent a single-user debit account with a constant dollars-per-minute rate from overdraft; they failed if faced a herd of users exploiting a single shared...