Monday, March 15, 2010

Some more thinking part 3 - or, the really I need to write it down thread!

We were discussing items like code which can be written by machines and such (in the last post). Note : this may necessarily not be true, it may be just a kick to get you linked to this page...Jokes apart. A machine can't know the code it will execute before it executes it, right? Or, better said, a machine can't know any code before it analyzes it. But, of course, we are talking about problem-solving in here, so why the heck would a program need to analyze a software (which actually handles the problem-solving by itself) to solve a specific problem? Back at you : how does the software know it solves the specific problem anyway? The answer is as simple and clear as you can (as most of the time you get it in Software engineering) get : it doesn't.
So what can you make out of it?
Consider : you have a machine, then you have a piece of code, which the machine has never executed before. How can the machine know what that same piece of code does, if not by executing it? Whilst the concept of virtualization comes to mind, that might not be a feasible solution to the problem, considering all the side-costs it brings with it; for an example, anti-virus software share the same type of issue, but address it at a higher level, by analyzing codebyte-patterns. A virtual machine would be way to costy.

On the other hand, even if a machine would analyze some code, it would still need to execute it (even if in a protected / virtual environment) to understand the effects of every single instruction.

It seems the answer is simple : there is no way for a machine to completely know what a source code does without executing it.

Tuesday, March 9, 2010

ESXi and Cron

Many people say ESXi doesn't come with cron.
Well, that is not necessarily the case.
A cron table for the user root is located under /var/spool/cron/crontabs/root.
The way to do it is the dirty way : through vi.

NOTE : Most likely, this crontab is automatically deleted on shutdown.
This has not been tested, but it is likely to work. IF somebody manages to test it, please let me know.
You probably want to keep a copy of it in the /bootbank/oem.tgz archive. Note also that the OEM tgz gets decompressed at root level, which means you also have to compress the full path to your files. Decompress the archive to a temporary directory (say, /tmp/oemarch/), create the same directory path (/var/spool/cron/crontabs) under this temp dir and copy the crontab ("root") from the /var/spool/cron/crontabs location to this new temp folder. Recompress everything and replace the old oem.tgz archive with this new one.