How to capture full web page as image

There is a free mozilla firefox addon which can be used for this, checkout ScreenGrab here.

I found it to be very useful especially when loading a lengthy web page.

How to move large sql file to new server

Normal method that I do:

1. From phpmyadmin, click on database, export, save as file, then download the file into my computer.

2. On new server, from phpmyadmin, import, browse to the file downloaded from #1

That is fine for small file. Even though it says 50Mb is OK, but it will depends on the connection speed as well. I tried 27Mb and it’s not working.

So I tried another method:

1. From cpanel on old server, click to backup wizard, click backup, pick mysql databases, select the table, then the download will start.

2. Using my FTP client, upload the *.gz from Step 1 to a folder on my new server. Any folder.

3. Login to SSH, use this command:

gzip -d database_file_name.gz

So it turns to:
database_file_name.sql

4. Then use this command to restore database:

mysql -u user -p new_database_name < database_file_name.sql

Please note that new_database_name is created in advance using phpmyadmin on new server.

Facebook ‘like’ button for wordpress

Adding Facebook ‘like’ button may not be as difficult as you may think. I added it manually without a plugin and only need to update 2 theme file. Before that, I would like to mention that, adding the ‘like’ button be it XFBML or an iframe, it is very straight forward;

1. No need to update the <head> part of a document

2. No need to create Facebook application

I wrote it down because I read a lot of articles asking people to do both of things above, while in fact I did it here on this blog without those. I am not sure why, perhaps Facebook does upgrade the method and it cut down half of the hassle in adding a simple ‘like’ button.

So, let’s digging.

You just need to update 2 files which are single.php, and footer.php. Before that, please get the ‘like’ button code here, I suggest the XFBML and not the iframe, becuase XFBML is so flexible and you don’t need to supply your post permalink for each of the ‘like’ button.

1. Get the ‘like’ button code here. Just hit ‘get code’ and choose XFBML. It will be something like this:

<script src=”http://connect.facebook.net/en_US/all.js#xfbml=1″></script><fb:like show_faces=”true” width=”450″>

</fb:like>

2. Open single.php (Dashboard>Appearance>Editor), find a line something like this;

<h2><?php the_title(); ?></h2>

Enter the code after that line.

3. Open footer.php, find this line

</body>

Just enter this code before that line:

<div id=”fb-root”></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: ‘your app id’, status: true, cookie: true,
xfbml: true});
};

(function() {
var e = document.createElement(‘script’); e.async = true;
e.src = document.location.protocol +
‘//connect.facebook.net/en_US/all.js’;
document.getElementById(‘fb-root’).appendChild(e);
}());
</script>

Yes I did not fill up ‘your app id’ and it’s working.

Good luck.

Greenshot for print screen

This is a quick bookmark on a free tool for rectangle screen capture. Convenience for use.

http://getgreenshot.org/downloads/

How to upgrade your wordpress and not getting blank page

First of all, you really need to read this manual. I have never do, that’s why I never get my wordpress automatic updates work for me. As long as I see the new version on top of the dashboard, I will click on update now and end up in frustration because it just hanging there and no result or error messages. And I will go back to the normal manual upgrading.

Now, to make the auto upgrade works, just disable all your plugins, hit the upgrade wordpress button. You will get your blog updated to latest version and don’t forget to activate the plugins back.

Easy.

Creating external WordPress Page

There are times when we need to create a fresh blank page for our WP which does not contain any header, footer or sidebar. Just put this PHP line:

require_once(‘./wp-blog-header.php’);//same folder with WP main files

Example:

<?php
require_once(‘./wp-blog-header.php’);
query_posts(‘showposts=5′); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<h2><a href=”<?php the_permalink(); ?>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”><?php the_title(); ?></a></h2>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>

Streamyx Modem/Router Passwords

Just in case if anyone is looking, here are the default passwords for some known models:

ZTE ZXDSL 831

Username: ADSL

Password: expert03

Billion ADSL Router

Username: admin

Password: password

Innacomm W3400V

Username: tmadmin

Password: tmadmin

How to share your web on Facebook (and get the thumbnail image working)

Wow..I spent hours trying to figure out why the thumbnail on the Facebook sharer screen does not show up. I might be still coding it, until I decided to create a dummy page and fill that page with only the basic thing needed by Facebook.

So normally you will have this link on your site, so when people click on it they will be prompted to confirm:

http://www.facebook.com/sharer.php?u=your_url&t=your_web_title

No matter what argument “t” is passing, I observed that Facebook will ignore it. It will instead will read the TITLE in the HEAD of your document.

Now what about the thumbnail? It’s the [link rel="image_src"] that matter. Facebook will read this line and have the thumbnail show up to whatever file that you give.

This is the basic code:

<html>
<head>
<title>test page</title>
<meta name=”Keywords” content=”my keywords” />
<meta name=”Description” content=”my description” />
<link rel=”image_src” href=”http://link to your image” />
</head>
<body>
<a name=”fb_share”></a>
<script src=”http://static.ak.fbcdn.net/connect.php/js/FB.Share”
type=”text/javascript”>
</script>
</body>
</html>

Best Raya Gift Ever – Thanks Exabytes!

I was on leave for Hari Raya since last week. My Kampong is such a peaceful, remote settlement, and the GSM network is not that good – so I missed most of the calls, and “Selamat Hari Raya” wishes SMS’s.

So you know what will happen when you switch on the phone after few days break, yes the non-stop beeping of alerts and notices of missed-calls, messages & incoming emails.

But what made me smile all day long yesterday is the only one email message from Exabytes – announcing the winner of Try & Win VPS Campaign. I felt so honored to be selected as the 1st prize winner! Thanks a million to Exabytes, this is the second time I won something with Exabytes. The first one was in somehere in 2007… it was not really a winning, but a lucky draw I can say. I’m still using the Altec Lansing speaker Exabytes gave me until now.

To Exabytes team, thank you for the good service that you have provided, I wish you the prosperity and good businesses. To this article readers, if you are looking for a good hosting company in Malaysia – it’s Exabytes. Well I don’t simply write this because they give me a Netbook, but honestly I think they deserve a recommendation. Good luck!

Download MP3 Lagu Hari Raya

Bagi yang masih tercari-cari tempat untuk download lagu-lagu MP3 sempenan Hari Raya Aidilfitri ini, boleh mencuba youtubemama.com… caranya mudah:

Buat carian “hari raya” di YouTube, contoh seperti ini.

Kemudian right click, dan copy link location. Kita cuma mahu tahu alamat video.

Di youtubemama.com, paste alamat itu dan mula mendownload MP3.