1. Shunit2, Unit Testing for Shell Scripts

    Thu 17 December 2009

    This may be of interest to people who are as stupid as I am and write elaborate shell scripts instead of using a proper scripting language such as Python or Ruby. No I am deliberately not mentioning Perl here.

    Anyway, testing is always an issue. With PPSS, I encountered many times that some change broke something in another place. Testing if some change screwed things up manually is just tedious and a pain.

    As any person who is semi-serious about programming should have done already, I started to write some unit tests. For bash scripts, there is this unit test framework called Sunit2. It takes some effort to write tests. But once you have written some tests and witness how the tests that passed before now fail after you changed some code is priceless. Because often, you would not have found the issue before a long time.

    Tagged as : Uncategorized
  2. Google DNS - What to Think of It?

    Thu 03 December 2009

    Google now provide an open DNS service. At first I was scared that they use their service to get information about users.

    However, their privacy statement tells us that no personal identifiable information is stored for longer than 48 hours. The permanent logs do not contain such information. The most notable information that is stored permanently is the requested domain. The other thing is that they record the location of the request on the city level. And even that info is only stored for two weeks. After that, only a small random sample of info is stored for permanent storage.

    The main question is now: who do you trust more: Google or your ISP.

    To be honest, I think I trust Google more than my ISP. I don't think my ISP adheres to the same privacy policy.

    Tagged as : Uncategorized
  3. Convert Dos File to Linux Format Wit Vim

    Thu 03 December 2009

    If you have some file that has been saved on a (Win)do(w)s host you may notice that all lines end with ^M.

    To fix this, you can use the tool dos2unix. If however this tool is not at your disposal, you may have a problem. If vim is available, you do not have a problem:

    The trick is to delete all occurances of ^M with this line:

    :%s/ctrl-v ctrl-m//g

    This will look like:

    :%s/^M//g

    Just save the file and you're done.

    Tagged as : Uncategorized

Page 10 / 23