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 the net and the combo below worked on MacBook Pro.

fn+command+v

Yeah, I know it’s a kinda bummer because it’s just one key on PC( Windows, Unix and Linux). But that’s how Apple is. Also, I’m not sure if it works for iMac. I heard there’s another key combination.

Incoming search terms:

  • shift insert mac
  • insert on macbook
  • insert macbook
  • shift insert
  • linux shift insert
  • insert in macbook
  • macbook shift ins
  • shift insert in mac
  • shift insert in unix
  • shift insert macbook

Facebook Like Box Not Working [solved]

For some reason, the code being generated inside Facebook developer does not work. Actually, the problem is on the profile_id parameter which is not recognized by the likebox.php. Instead, id should be used.


<iframe src="http://www.facebook.com/plugins/likebox.php?id=[YOUR_PAGE_ID_HERE]&width=298&connections=10&stream=false&header=true" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:298px; height:290px"> </iframe>

If still that doesn’t work, then you can use the legacy code as below.

<iframe src="http://www.facebook.com/connect/connect.php?id=[YOUR_PAGE_ID_HERE]&connections=10&stream=0&locale=en_US" allowtransparency="true" style="border: medium none; width: 300px; height: 240px;" scrolling="no" frameborder="0"></iframe>

I tried both and they all worked as expected.

Source:

http://forum.developers.facebook.net/viewtopic.php?id=56454&p=1

Incoming search terms:

  • facebook like box not working
  • like box not working
  • wordpress facebook like box not working
  • facebook likebox not working
  • facebook like box not working 2011
  • facebook like box not showing
  • facebook likebox allowTransparency="true"
  • facebook likebox scroll problem
  • FacebookLike Box Not Showing
  • https://www facebook com/connect/connect php?id= height

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 'InnoDB' is disabled.
110514 14:04:22 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
110514 14:04:22 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110514 14:04:22 [ERROR] Unknown/unsupported storage engine: InnoDB
110514 14:04:22 [ERROR] Aborting

Initially, I thought the problem was on the mysql_upgrade part because that’s the first error that appears on the log. Apparently, that’s just a warning message because the service still managed to proceed to the next step which is for the InnoDB. And based on the log, it failed to start and actually aborted. So that’s where I should concentrate my investigation/trial-and-error.

Solution

I opened /etc/my.cnf and comment out skip-innodb and then restart mysqld. It fixed the problem and mysql managed to start. I then proceeded with the mysql_upgrade which is unrelated to the error.

Another solution for this is to set the default storage to other than InnoDB. However, I haven’t tried that myself.

Incoming search terms:

  • mysql daemon failed to start
  • mysql daemon failed to start centos
  • Unknown/unsupported storage engine: InnoDB
  • mysql failed to start
  • mysql upgrade failed
  • unknown/unsupported storage engine: innodb centos
  • mysql daemon failed to start after update
  • mysql upgrade 5 1 to 5 5 mysql daemon failed to start
  • mysql start failed log
  • mysql restart failed

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 PHP version
php -v

Expected result should be like below

PHP 5.3.6 (cli) (built: Mar 19 2011 08:30:07)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

*** NOTE ***
Though webstatic stated that the repository is created for CentOS 64bit, it still worked for my 32-bit installation.

Source:

http://www.webtatic.com/packages/php53/

Incoming search terms:

  • webtatic php 5 3
  • centos 5 7 php 5 3 repo
  • php53 centos webstatic
  • repo webstatic
  • repository php 5 3 9 on centos 6
  • update php 5 1 to 5 3 centos 64bit
  • update php 5 3 webstatis
  • update php to 5 3 centos 64 bit
  • upgrade php 5 3 centos64
  • use webstatic php webtatic

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.

To be clear, here’s the screenshot.

[Read more...]

Incoming search terms:

  • Input truncated to 1 characters
  • input truncated to 1 characters error
  • sql input truncated to characters
  • input truncated to 1 characters oracle
  • input truncated to 1
  • input truncated to one character
  • input truncated to 4 characters
  • input truncated to 10 characters in oracle
  • input truncated to 1 characters sql
  • Input truncated to 1 characters pl/sql means

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 fact that I did not need to install any new software (like WinXP PowerTools). The stock Mac OSX already has this tool.

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. Open the Finder
2. Click/Tap on the file you want to rename
3. Press Enter.

The filename will become editable and you can change it the way you like it. You can see the actual comment here.

Before I found that post, I actually opened the terminal and hack it from there. Yes, it is silly. Labor pains.

Incoming search terms:

  • how to rename file mac os
  • mac os how to rename a file
  • mac rename file
  • macbook pro 2011 change name file
  • naming files in mac
  • rename file mac os x
  • rename file MacBook pro 2011
  • rename files in mac os

Oracle MERGE command

Oracle MERGE command was added in 9i but I only learned about it lately. This command is sometimes referred to as UPSERT because in one statement, you can both update and insert records into a target. Based on the matching condition, MERGE can update existing records if a match is found or insert new record if not. Prior to 9i, we need separate sql statements or a PL/SQL program to do this.

[Read more...]

Incoming search terms:

  • oracle merge statement
  • merge oracle
  • oracle merge
  • oracle merge statement in loop
  • oracle merge statement tech on the web
  • oracle merge statement when not matched then print message
  • oracle merge tech on the net
  • oracle merge when matched then insert
  • oracle user if in merge statement
  • pl/sql merge log

Oracle PL/SQL Continue Statement in Loops

The CONTINUE statement is very handy feature when programming with loops in Oracle PL/SQL. Basically, it lets you skip to the next iteration of your loop (i.e., next record in the cursor loop). Unfortunately, it was only added in 11g Release 1 (11.1). This is stated in the Language Reference of that version.

Below is the example.

SQL> DECLARE
2 x NUMBER := 0;
3 BEGIN
4 LOOP — After CONTINUE statement, control resumes here
5 DBMS_OUTPUT.PUT_LINE (‘Inside loop: x = ‘ || TO_CHAR(x));
6 x := x + 1;
7
8 IF x < 3 THEN
9 CONTINUE;
10 END IF;
11
12 DBMS_OUTPUT.PUT_LINE
13 ('Inside loop, after CONTINUE: x = ' || TO_CHAR(x));
14
15 EXIT WHEN x = 5;
16 END LOOP;
17
18 DBMS_OUTPUT.PUT_LINE (' After loop: x = ' || TO_CHAR(x));
19 END;
20 /

[Read more...]

Incoming search terms:

  • pl/sql continue
  • continue oracle
  • pl/sql loop continue
  • continue in oracle
  • continue in oracle pl sql
  • plsql for loop continue
  • pl sql for continue
  • pl sql continue
  • oracle sql loop dbms_output put_line
  • oracle pl/sql continue

Run SQL Script via SQL*Plus via Prompt

If you want to run an SQL script via sqlplus in the shell prompt, the command is as below.

sqlplus user/pass@connect @scriptname

Don’t forget that there should be an exit command at the end of the sql. Otherwise, the sqlplus will not exit and just stop running until you manually call exit.

Now, if the SQL script does not have exit at the end, you’ll have to do the following.

echo exit | sqlplus user/pass@connect @scriptname

This is another trivial thing that can be easily forgotten.

Incoming search terms:

  • sqlplus does not return
  • sql script name in shell script exit from sql prompt
  • sqlplus -s << end in shell script
  • sqlplus does not call script
  • execute sql script in shell
  • sqlplus invoke shell script
  • sqlplus no exit on end of script
  • sqlplus prompt exit
  • sqlplus run sql script
  • script sql *plus