Blog

  • Read Input Without Echo in Bash

    I have a script that needs to be deployed in different environment as most scripts are. This script requires asking for userid, tnsname and password during deployment. I tried to use READ but it echoes the password on the screen as soon as I type it. So how can we hide the password? Here’s how.

  • Update Oracle Sequence Last Number

    I only realized this last week that direct update of the last number of the sequence. Or maybe I just don’t know so what I did was to create a workaround.

  • Automatically Convert Emails to NoSpam

    To prevent spam comments on one of the sites that I maintain, I send for approval any comment with at least one URL or email address in it. In that way, manual spammers will find no incentive on leaving comments on the site. At the same time, email addresses left by commenters will not be…

  • Shift-Insert in MacBook

    I use the terminal a lot be it in Mac, Windows or Linux. And it’s kinda frustrating in Mac for the lack of a dedicated insert key. Clearly, you’ll never think about small things until it’s gone. Copy-Paste function turned out to be an important feature. So I looked for the equivalent command/key combination in…

  • MySQL Fail To Start After Upgrade to 5.1 or higher

    I recently upgraded my MySQL in preparation for WordPress 3.2. The version I now have is 5.5.12. The upgrade finished without a hitch but when I tried to restart the service, the MySQL Daemon failed. Here’s the log of mysql (/var/log/mysqld.log) 110514 14:04:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 110514 14:04:22 [Note] Plugin…

  • Upgrading to PHP 5.3 for CentOS

    I wanted to try WordPress 3.2 beta but realized that it requires at least PHP 5.2 and I’m still with 5.1.6 (the one that comes with CentOS). Here’s what I got from the interwebs. Step 1: Get webtatic PHP 5.3 Repository rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm Step 2: Update PHP yum –enablerepo=webtatic update php Step 3: Verify…

  • Input truncated to 1 characters

    That pesky though harmless message “Input truncated to 1 characters” keep on appearing on one of my scripts and I can’t figure out what’s the problem. It turned out that the last line of my script is the slash (/). An extra new line is needed after the slash so that this message is suppressed.…

  • Resizing Photos in Mac OS X

    And then there’s another little bugger in my quest to . Here’s the steps I use now. 1. Open the image/photo in the Preview 2. From the top menu, Click on Tools–>Adjust Size 3. Enter the new dimension It is so damn simple…. if you know how. What I like most about it is the…

  • Renaming Files in Mac OS X

    Got a Macbook Pro the other week and I’m still familiarizing myself with the new OS. Well, OS X is supposed to be a simple and you bet it is. But how can I rename the files? Thanks to one commenter in Donncha’s comment, it turned out that it’s actually easy. Here’s the steps. 1.…