Thursday 26 May 2011

Exclude certain string pattern from grep

If we want to exclude a file while grep, we can --exclude=<filename>.
For excluding a directory we can use --exclude-dir=<directory name>.
But if we want to exclude a string pattern from grep how we will do it? For example, in my source code I want to see where all the define ART_BUILD is used. When I grepped it, I got ART_BUILD_NUM also in the grep result. I want exclude it from the result. How I will do it?

Well, I coudn't find direct solution for it. But, I got th result using the following command.
grep -nr <pattern to grep>  . | grep -v <pattern to be excluded>

I don't know whether a better solution is present or not. But served the purpose

How to fix Skype crash 26-May-2011

Skype was crashing in my system yesterday(26-May-2011) onwards. I just fixed it by removing
In Ubuntu:
/home/<username>/.Skype/shared.xml.
In windows xp:
c:\Documents and Settings/<username>/Application Data/Skype/shared.xml
In win 7:
Win 7: C:\Users\%username%\AppData\Roaming\Skype


Next time when you start skype it may ask whether you agree to the Skype End User Licence Agreement. Just say "I agree" and it should work fine

Monday 23 May 2011

host key and Virtual Box (how to Alt-Tab out of virtual box)

From the host OS, if you Alt-tab into the virtual box it will work as usual. But if you do Alt-tab inside virtual box, switching will happen between the windows opened inside that. This is because the keyboard is controlled by the virtual machine now. Just pressing the host key without hold returns control back to the host OS. All the key presses after that will go to the host itself. So, if you want switch out of virtual press host key once and then Alt-Tab. Check this link. for more information.