Tag: open

  • Is recent IT talk just a show of hands

    I recently attended Oracle Events at Westin Hotel here in Ebisu. My topic of interest was to see what’s the future for a product we’re using that now has been acquired by Oracle.

    Quite interestingly the first session from a senior, hi-ranking Oracle official failed to woo me. I mean, c’mon. Just piggybacking on stuff that’s so prevalent nowadays with Apple doesn’t really make a case for Oracle to progress ahead. Big words were just thrown out on every page, every sentence. I sometimes wonder do these guys actually value much as far as the company is concerned. Oracle seems to be calling their new (but nothing novel) buzz as “Oracle Experience” to demonstrate an end to end service to their customers. Every experience you know about purchasing a thing is the exact same thing Oracle wants to offer?

    Just what is the customer these days? A lump of flesh, an idiot, or a baby who needs your constant attention, and love to continue using your product? Much recently, the Apple has garnered alot of attention, craze, hysteria within the so call consumer market. Now everyone wants to try it out – suddenly everyone’s got ‘it’.

    The Oracle Event was a prelude to their sudden attention to their customers. Surprisingly, I didn’t come across a single presentation that meant anything for the ‘customer’. Every statement was proclaimed as seen from where Oracle stands. At times I felt trouble just bearing the innate nonsense these guys keep churning about every keynote presentation they make.

    Make a genuinely good product that last forever, satisfy what the customer needs, and …

    just stay out of the way for f*k’s sake.

  • Brainteasers

    1. How many degrees angle between hour, minute hand when time is 3:15?
      7.5°
      360° full circle, therfore (360°/12 hrs) = 30° /hour.
      At 3:15,  minutes hand points to the 3, hour hand is ahead of 3 by 1/4th (15/60),  which is 7.5° apart. (30°/4)=7.5°
    2. Why are manhole covers round?
      – Round covers can be easily rotated
      – It’s easier to dig a circular hole
      – Round castings are easier to machine using a lathe
      – Easier to manufacture than custom-made covers
    3. How will you generate random number between two given numbers
      Assuming n1, n2 random number between them would be n1 + Math.random() * (n2 – n1)
    4. How will you sort a million integers?
      Split them into meaningful subsets, sort each subset, merge subset back
      http://neopythonic.blogspot.com/2008/10/sorting-million-32-bit-integers-in-2mb.html
    5. How many windows will be open in a 100 window room if you go around  a 100 times toggling each window you come across? All windows are closed initially.
      100 windows,  all closed.
      1st round, you toggle all windows i.e. all windows are opened
      2nd round, you close all even-numbered windows – 2, 4, 6, …
      3rd round, you open, close odd numbered winodws – 3, 6, 9,…
      So after 100 times, windows open are windows who have been toggled odd number of times. For e.g. consider window 12, round 1 will make it open, 2 will make it closed, 3 will make it open, 4 closed, then directly 12 will make it open. Consider again, window 20 – 1 (open), 2 (close), 4 (open), 5 (close), 10 (open), 20 (close). Consider 7 – 1 (open), 7 (close). So window 12 got touched 5 times, window 20 got touched 6 times, window 7 touched 2 times.
      So, in order to find “open” windows between 1-100, we have to find number having “odd” number of factors, which means numbers who have one repeated factor i.e.  factor by same factor gives the number e.g. 16 has 1, 2, 4, 8, 16 – open window. It has 4 which means 4×4= 16. Consider 20 has 1, 2, 4, 5, 10, 20. No factor is repetitive.
      Therefore, let us find numbers which are below 100, but are having square products, similar to 4×4 = 16 starting with 1, which gives 12=1, 22=4, 32=9, 42=16, 52=25, 62=36, 72=49, 82=64, 92=81, 102=100
      So open windows are 1, 4, 9, 16, 25, 36, 49, 64, 81, 100 = 1o open windows
    6. A party of four travelers comes to a rickety bridge at night. The bridge can hold the weight of at most two of the travelers at a time, and it cannot be crossed without using a flashlight. The travelers have one flashlight among them. Each traveler walks at a different speed: The first can cross the bridge in 1 minute, the second in 2 minutes, the third in 5 minutes, and the fourth takes 10 minutes to cross the bridge. If two travelers cross together, they walk at the speed of the slower traveler. What is the least amount of time in which all the travelers can cross from one side of the bridge to the other?
      Obvious (but incorrect)
      Incorrect answer

      Not  so obvious (correct answer)
      Correct answer

    7. Next…

    A party of four travelers comes to a rickety bridge at night. The bridge can hold the weight of at most two of the travelers at a time, and it cannot be crossed without using a flashlight. The travelers have one flashlight among them. Each traveler walks at a different speed: The first can cross the bridge in 1 minute, the second in 2 minutes, the third in 5 minutes, and the fourth takes 10 minutes to cross the bridge. If two travelers cross together, they walk at the speed of the slower traveler.

    What is the least amount of time in which all the travelers can cross from one side of the bridge to the other?

  • https in 5 easy steps

    Simple 5 step guide to setting up https with your own self-signed certificate
    Prerequisites: Apache2, Ubuntu Server

    1. Generate local keypair
      /usr/bin/openssl genrsa -des3 -out {your domain name}.key 3072
    2. Create self-signed certificate
      /usr/bin/openssl req -new -key {your domain name}.key -x509 -out {your domain name}.crt

    3. Configure your host on port 443 to use the certificate
      <VirtualHost {your ip}:443>
      ...
      SSLEngine on
      SSLCertificateFile {path where certificate is}/{your domain name}.crt
      SSLCertificateKeyFile {path where key file is}/{your domain name}.key

      SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
      ...
      </VirtualHost>
    4. Optional: If you do not want to enter key password each you restart Apache, you can embed the password in key itself.
      /usr/bin/openssl rsa -in
      {path where key file is}/{your domain name}.key -out {path where key file is}/{your domain name}.key.nopass
      Remember to update your Apache configuration to use the new file
      # SSLCertificateKeyFile {path where key fileis}/{your domain name}.key
      SSLCertificateKeyFile {path where key file is}/{your domain name}.key.nopass
    5. That’s it view it. Restart your apache to load the new configuration. And try accessing your url with https://

    If you receive a certificate warning, simply accept it, and proceed. Congratulations, your communication is now encrypted, and safe from prying eyes!

    Self-signed certificate

  • Interesting alternatives to databases in opensource

    I stumbled upon this url. The list of various options on databases is pretty amazing.

    http://www.webresourcesdepot.com/25-alternative-open-source-databases-engines/

    It’s a definite read. I never knew so many existed.

  • SSH : Forwarded connection refused by server: Administratively prohibited [open failed]

    Change localhost to 127.0.0.1 and it should work. 🙂

    If that doesn’t solve it, problem might be in sshd_config or authorized_keys2 – Metawerx Wiki: SSHTunnelTroubleshooting.

  • Server upgraded to new Ubuntu 9.04 server

    The website is up, and running on a brand new OS – Ubuntu 9.04 Server. Supercool to configure, has pre-configured LAMP, OpenSSH out-of-the-box.
    Using the UFW was too easy than messing with iptables, or routing.
    Feeling great having refreshed up my home server with a mature OS.