Pages

Mount Missing USB Drive On Windows 7

This is very useful info to mount missing USB Drive you just reformated or repartitioned.

Simply do the followings:

  • Right click on your Computer icon under the Start menu and select Manage
  • Select Disk Management
  • Find the missing Disk
  • Right click and choose "Change Driver Letter and Path"




Source: Find Your Missing USB Drive in Windows 7 & Vista

Reformat and repartition USB Flash Drive From Windows OS

You can do this in DISKPART in Windows:
  1. Open an command prompt using Administrator rights.
  2. Run DISKPART
  3. list disk
  4. Note the disk number that corresponds to your USB drive (it should be obvious going by size)
  5. select disk X where X is the number from step 4
  6. list partition - There should be two, numbered 0 and 1, each about 7 GB
  7. select partition 0
  8. delete partition
  9. select partition 1
  10. delete partition
  11. create partition primary
  12. exit
  13. exit
  14. In Windows, go to Computer and try to open the disk. It will ask you to format it.
  15. Format it with the default settings and give it a name if you want.
It should now a single, unified partitioned drive.

Stop WordPress Crash From Brute Force Attack On WP-LOGIN.php

Just few days ago, my VPS at Hostgator has horrible crash. No matter how many time I restart the container, the memory usage is always reaching 101% and the server die.

After 2 hours struggling with the tech support, they finally told me that my server is under brute force attack. The hackers or bots are trying to hit on one of the WordPress website's wp-login.php file.

So WordPress was trying to do query to check the login and password. This process took over 100% CPU usage and try to hit on MySQL too many times. So the server went to cooling down mode.

There is no easy way to block those IPs. So the temporary solution is to stop the bot from hitting the wp-login.php file and summiting the login and password by password protecting the wp-loginl.php page. So it will prompt to enter extra login and password before login to WordPress.

This process add an extra file look up at Apache level.

Here is how it works.

  1. Setup a hidden .wpadmin file above your website root. It's usually under /home/[username]/
  2. Run SSH tool like putty.exe login to your web server as root.
  3. execute the commentline: htpasswd -c .wpadmin [login name]
  4. It will prompt you to enter password
  5. Once you set the file you will need to add few lines of code to .htaccess file for each one of your WordPress installation

ErrorDocument 401 "Unauthorized Access"
ErrorDocument 403 "Forbidden"
<FilesMatch "wp-login.php">
AuthName "Authorized Only"
AuthType Basic
AuthUserFile /home/[username]/.wpadmin
require valid-user
</FilesMatch>

Shared SSL SuPHP 500 Error Fixed

It took me hours and finally figure out what went wrong after install cheap GoDaddy SSL on shared IP on VPS at Hostgator.

Issues: I bought the SSL certification and install on my VPS, which already have 2 dedicated IP (2 other SSL already installed). So my only option is to install the new SSL on the shared IP. While install the SSL, WHM tells me to install the SSL as nobody due to the IP is shared IP.

After restarting the Apache after installing the SSL, the HTTPS works fine on any file that is NOT PHP. When I load the WordPress, it shows me the 500 server error.

It took me hours to figure the Shared SSL with nobody user group is conflicting with suPHP due to the permission.

Solutions:
The idea of fixing this is to assign the SSL certification from nobody to the right cpanel user that owns the add-on/parked domain name.  So here are the steps:

Remove Weebly Promotion Link At Bottom

Do you run a free website at Weebly, which is one of the most popular company that offer free web hosting? Weebly offers a very robust web publishing platform for everyone to setup their website easily. Weebly is one of the site that people love to earn passive income with it.



As much as I love Weebly, I got people asking me how I remove the Free Web Site By Weebly promotion link at the bottom of the site? Honestly, I do NOT recommend you do so without upgrading your services at Weebly. Weebly offers the best free web builder and it costs them money to continually offer the great services. I recommend you to upgrade your site to remove the link.


3 Must Have Features On Tumblr Blog

I know this is a Google Blogger blog, but I am also running few other automated blog on Tumblr. Tumblr is a great blogging platform, but it is lacking some good features like WordPress had.

Here are 3 must have features to put on your Tumblr blog.

1. Redirect 404 page not found error to a random page. 

2. Tag Cloud with different color.
 
3. Related blog post with thumbnail.


It will be nice to show page like that on Tumblr. This is how you do it.

Adding Previous And Next Post Link On Tumblr

While trying to creating a new Automated Tumblr site for AdSense Passive income, I found many of the Tumblr template do not have the Previous and Next post link included. This means the visitor won't be able to check out your previous or next post easily. To lower the bounce rate and increase the click through rate on your website, adding previous and next post link is one of the easiest way to keep visitor stay longer on your site.

So I found out the solution to add previous and next post link on the Tumblr site.

{block:PermalinkPagination}
    {block:PreviousPost}  < a href="{PreviousPost}" class="menu_item pagination_link">« Previous< /a>{/block:PreviousPost}
    {block:NextPost}  < a href="{NextPost}" class="menu_item pagination_link">Next »< /a>{/block:NextPost}
{/block:PermalinkPagination}

Simply put the above code to the  place, where you want to show the pagination link on the single post page. 

Easy SEO Title Fix On Tumblr Blog

One of the biggest problem on Tumblr is the SEO. You put up a blog and post all your thoughts and photos. You end up have duplicated title tag on Google search result.

So here is the quick fix. It will generate different title tag based on the page and content.

Ideally, we want the index page showing site title and page #. We also want to show page summary as title on single page regardless what content type you post. Please note the photo, video and voice page will not have regular PostTitle, but they all have PostSummary (if you enter any text). On tag and search page, I also want to show the search query, tag and the page number.

This will unique title tag on every single page on your Tumblr site.
< title>{block:IndexPage}{Title} {/block:IndexPage}{block:PermalinkPage}{block:PostSummary}{PostSummary}{/block:PostSummary}{block:PermalinkPage}{block:TagPage}Everything About {Tag}{/block:TagPage}{block:SearchPage}The Truth About {SearchQuery}{/block:SearchPage} : Page {CurrentPage}< /title>

Wala! Make sure you also remove the white space after the < symbol.

You need change the text for Tag page and search page to use your own terms. 

You can see it in action on my truth blog.

Turn Tumblr Blog Into AdSense Income Stream

Tumblr is one of the most popular blog platform on the planet. It already pass WordPress as the #1 most used blogging platform. Tumblr is so easy to use and can easily adding new content through their API or mobile app. However, there are many people doing it wrong.

What I want is to insert the 468x60 AdSense banner into my second post on the home page and on the single post page. I also want to add 300x350 square banner on the right side bar. The most important think is to skip the loop by inserting the following two tags. See attached image. 
{block:PermalinkPage} - Insert code on the single post page
{block:Post2} - Insert content only on the second post on the home page.

Codeigniter Shows Blank Page PHP + MySQL + Apache + Windows 7

Recently, I started a new development on one of my laptop running Windows7. I install PHP 5.3.6, Apache 2.2, MySQL 5. I move all the source code that was previously developed based on CodeIgnitor 1.7.

Problem

It shows blank page when I load the site on my laptop's localhost. 

Solution

Well. The solution is farily easy. If Codeigniter can not detect the mod_mysql module in PHP when the page is loaded, it doesn't return any error message.
  • So you need to make sure you enable the mod_mysql in your PHP.ini file.
  • Also make sure your .htaccess file is redirect correctly, if you are using Search Engine Friendly URL. Make sure mod_rewrite module is enable in your Apache httpd.conf file.

It's just that easy! A simple check will save you lots time. 

Blank Page With URL Parameter fb_xd_fragment

I am still not sure why it causes the page to display blank content when someone hit the site with the Facebook social plugin and URL parameter fb_xd_fragment.

Here is the temporary fix to display the content, however, it will disable the Facebook widget.

Problem:
I found this occurring on one of my sites using AddThis - and it affects ALL browsers, not just Internet Explorer. Haven't figured out exactly how or why it happens but the Facebook frame manages to set the parent's element to display: none.
Solution:

Add the following lines to your main style file.

html { 
    display: block !important;
}
Read the original post!

Magento Shows No Product and Categeory

Magento E-Commerce Community Edition
It took me 20 minutes to figure out why the products and categories don't show up on the front page of the Magento e-commerce store.

  • The product has to be in stock, enabled and has positive inventory quantity.
  • Make sure the category is under the "Default Category"

It's important to make sure every configuration values is set correctly. Magento is a powerful e-commerce system. Without setting the values and configuration right, the site won't function correctly.

Magento 500 Server Error After Installation

Magento E-Commerce Community Edition
This is a simple solution for Magento shopping cart software. After install the Magento software on the server, it generates 500 server error.

The solution is to change the file permission for index.php file to 755.

That's it!

Disable Administrator Login on Windows7 Welcome Screen

Here is the easiest way to disable the Administrator account login screen on Windows7 welcome screen. You have to make sure the current user has administrator access to run the dos command prompt. If you were having trouble fixing your computer's hosts file access denied issues due to the sypware or virus on your computer, you can find the answers here.

According to http://support.microsoft.com/kb/555910
To enable the build-in Administrator account, follow these steps:
1. Click Start, and then type cmd in the Start Search box.
2. In the search results list, right-click Command Prompt, and then click Run as Administrator.
3. When you are prompted by User Account Control, click Continue.
4. At the command prompt, type net user administrator /active:yes, and then press ENTER
5. Type net user administrator , and then press ENTER.
Note: Please replace the tag with your passwords which you want to set to administrator account.
6. Type exit, and then press ENTER.
7. Log off the current user account.

To revert do exactly the same thing but change
net user administrator /active:yes to
net user administrator /active:no

Stop Remote Comment Spam Bot on WordPress Blog

SPAM!
Image Source: SPAM Courtesy Of: MasterMan

If you are running WordPress blog, you may already suffer the lost of your valuable time on fighting for the remote comments submitted by the Remote Comment Spam Bot. It's a known issues with WordPress and there is a work around solutions.

Block WordPress Remote Comment Spam Bot


Your can Read Terence Chang's Living The Dream Lifestyle blog and find out the solution he improved that has stop the spam bot.

CodeIgniter image_lib bug in the image process loop

This bug has me scratch my head for hours and finally found the solutions to fix it.

In CodeIgniter, you can upload multiple images and do resize, crop and watermark stuff. It's cool that you can use one library to do many awesome stuff. However there is problem when using image_lib in the loop.

Problem:

I upload few image and want to loop through each one of them and resize them differently based on their original size. So I put the resize function in the loop. However, the dimension is based on the previous image.

For example. the first image is resized to 100x200. The second image should be resize to 50x100, but is resized to 100x200. The third one should be resized to 400x300, but is resized to 100x75.

In other words, the second image was resized using the dimension from the previous resized image based on the second image's longer side (W or H). The first image was resized to 100x200, so the second image was resized to 100x200 because the original dimension of the second image was 50x100 (Height is larger than width). So it take the first image's height to resize the second images. Crap!


Solutions:
In the image_lib in CodeIgniter, there is a function to clean the setting ($config). However, there is missing parameters in the function.

So I add two lines in the function clear().

$this->width = '';
$this->height = '';
Add the above two lines before closing the function.

Problem solved!

Facebook Social Plugin load page twice on Firefox and Google Chrome

There is weird issues with FireFox and Google Chrome. The page will be loaded twice, if Facebook Social Plugin such as LIKE button installed on your site.

There is a solution post on Terence Chang's blog!

Prevent Facebook Social Plugin to load page twice – CodeIgniter

iPhone is not recoganized on XP / Vista as Camera drive

In some case, the USB driver was not working right so iPhone is not recognized as camera drive or external storage drive.

Here are the step to make it works.

  1. Connect your iPhone by USB
  2. Open Windows Device Manager (right-click My Computer and select Manage). You may find your iPhone under “Universal Serial Bus Controllers” or possibly under “Portable Devices”.  At any rate if your phone can sync with iTunes it will be in there somewhere.  It should be called Apple Mobile Device USB Driver.
  3. Right-click and select “Uninstall” but don’t remove the files from the PC.
  4. Disconnect your iPhone and reconnect. You should see the iPhone showing as one of the camera drive or external storage.

In case you still not seeing your iPhone showing up. Make sure you have at least one photo in your Camera Roll.

Fix YouTube overlay issues with WordPress Menubar

Problem:
YouTube Video is covering up the menu bar. It's due to the flash play that has the top priority.
 
Solutions: 
Add the wmode=opaque parameter to the embed code. 

< object width="460" height="307" VIEWASTEXT>
 < param name="movie" value="src="YOUR_YOUTUBE_URL_HERE"">
 < param name="allowFullScreen" value="true">
 < param name="allowscriptaccess" value="always">
 < param name="wmode" value="opaque" />
 < embed src="YOUR_YOUTUBE_URL_HERE"
  type="application/x-shockwave-flash"
  allowscriptaccess="always"
  allowfullscreen="true"
  width="460"
  height="307"
  wmode="opaque">
 < /embed>
< /object>

iPhone Google Active Sync Stop working - Keep asking password

iPhone Google Active Sync keep asking to enter correct password. There is chance that the Captcha is locked. To unlock it visit the following site and enter the correct Google account.

https://www.google.com/accounts/UnlockCaptcha