Tag: be

  • Amrita solving Rubik cube


    Can you believe what 11 month old babies are capable of?

  • Trip to Hasunuma beach – Videos

    This Sunday we went on a good sunny trip to Hasunuma beach in Japan. Enjoy our little daugther’s videos!

    How did you enjoy?

  • Trip to Hasunuma beach – Photos

    This Sunday we went on a good sunny trip to Hasunuma beach in Japan. Enjoy our little daugther’s photos!

  • Amrita turns 10 months, eating cherries

    Amrita now turns 10 months! Now she can already gobble down cherries – see how!

    Isn’t she simply beautiful?

  • Amrita at 4 months

    Our beautiful daughter, Amrita, at 4 months! I am impressed how beautiful she’s growing each day (perhaps takes this from her mother)

    We love you Amrita!

  • Run a job every first Sun of a month

    I came across an interesting cron issue recently. The requirement was to run a job every _first_ Sunday at 12:00PM of each month.

    After searching across various sites, skimming through cron manpages, I finally found the following one-liner

    0 0 1-7 * 0 <user> <job>

    Can you believe this simple solution? The reasoning is that Sun will be between 1 to 7th of each month. Once a Sun comes, the job will execute between 1st and 7th just once. After that any further Sundays will have a date greater than 7, and thus never execute!

    Sometimes, the simplest solution is the most elegant. BTW, I had read about many other complicated solutions, such as having your own logic to determine the day, apple script, bash script solutions. I was about to give up, when I hit the jackpot! 😀

  • Challenging Relativity

    This sure is mind boggling if you look each detail separately


    Original work can be seen on
    http://www.andrewlipson.com/escher/relativity.html

  • Amazing Robofrog

    Can you believe this?

  • PHP code obfuscation possible?

    Today at my project, I was faced with a simple question from the client – How do you ensure that your PHP code is not tampered?

    Honestly, I had no answer. 🙁

    The only ray of hope I thought was – Since PHP is interpreted, is there some compressing, or obfuscating tool out there that can help me?

    One possible solution I came across was encrypting your logic entirely so as unreadable to humans

    http://www.abhishektripathi.com/encrypting-footer-links-free-theme-developers-take-notice/

    Is this failsafe? Can it be still reverse engineered, and original source obtained to defeat the original purpose of protecting your code?

    Anyone to help out there?

  • Using Apache’s mod_rewrite on Windows

    I recently happened to experiment with Apache’s mod_rewrite, an excellent library to change your machine friendly (or perhaps program friendly?) web urls into user friendly urls.

    The steps to make mod_rewrite to work on Windows is-
    – Edit httpd.conf for Apache, and uncomment the following line
    # LoadModule rewrite_module modules/mod_rewrite.so
    -to-
    LoadModule rewrite_module modules/mod_rewrite.so

    – Next, under <Directory “{Your document root}“> change
    AllowOverride None
    -to-
    AllowOverride All

    – Restart Apache

    – Create a sample folder “rewrite” under {Your document root}, with the following files
    {Your document root}
     
    rewrite
        .htaccess
        details.php

    – What we will attempt now is to have a url like http://localhost/rewrite/details/shantibhushan to be automatically executed as http://localhost/rewrite/details.php?user=shantibhushan

    – Edit your .htaccess file as follows
    <IfModule rewrite_module>
     RewriteEngine on
     RewriteBase /rewrite/
     RewriteRule ^details/(.+)$ details.php?user=$1 [L]
    </IfModule>

    – The RewriteRule is the actual line where we specify what url is to be mapped to which actual url. ^details/(.+)$ takes a user friendly url /details/shantibhushan and extracts “shantibhushan” as $1. It then replaces $1 into details.php?user=$1 resulting in details.php?user=shantibhushan as the actual url.

    – Edit details.php as follows
    <?php
    $user= $_REQUEST[‘user’];
    print(“<h1>$user</h1>”);
    ?>

    – The above sample simply takes “user” from details.php?user={user} and shows it back.

    – Done! Try accessing http://localhost/rewrite/details/shantibhushan and you should see details.php getting called with parameter as “shantibhushan”

    TODO
    – Simply accessing details/ results in error, and rewrite rule doesn’t assume such a case. It can be handled by RewriteCond
    – First I wanted to have details:shantibhushan as the url, but this has a bug on Windows not allows : in path. It seems to work fine on non-Windows.
    – The example assumes Apache is running on port 80 on your machine.