Tag: How To

Memcache is a powerful tool to share objects across servers and it is used by several big sites including Facebook, Yahoo and many more. The best part about using memcached on your server is that you can cut down on your database queries significantly and store commonly used objects in memory and share it across multiple servers.

If you use WordPress on a multi-server setup, you can easily cut down on DB queries by up-to 50% by implementing memcached. If you are interested in knowing how to implement memcached on your server, here is a tutorial. The assumption is that you are using Ubuntu, if not, the installation steps might change.

How To Install Memcached And Configure It

Step 1: Install memcached using the command given below

sudo apt-get install memcached

Step 2: After you have installed memcached you will have to configure it through a .conf file, to do that use the command given below

vi /etc/memcached.conf

Step 3: In the configuration file you will find few parameters, you can ignore the -d, -u and logfile parameters and leave it as default. However, change the -m, -p and -i parameters to suit your servers. The -m parameter specifies the memory that will be allocated to memcache. The -p parameter specifies the port that memcached will run on and the -l (ell) parameter specifies the IP address the memcached server will run on. You will need to change the -l (ell) parameter value from 127.0.0.1 to a local or global IP address of your server. This is necessary because your memcached server will be accessed by outside servers and using 127.0.0.1 will not work then.

Once you have done that run the following command.

service memcached restart or /etc/init.d/memcached restart

Using Memcached With WordPress

Once you have setup your memcached server, it is time to now setup WordPress to use memcached to store your objects. To do that, head over to http://wordpress.org/extend/plugins/memcached/ and install the memcached plugin for WordPress. Unlike other plugins, you will have to drop this file into the wp-content directory and not the plugins directory.

You will have to install additional plugins for your server to make use of this plugin, namely PECL memcache extension which can be downloaded from http://pecl.php.net/package/memcache.

Now comes the part where you will actually tell WordPress to use memcached as an object storing mechanism. To do that, open the wp-config file and add the line below to it.

The array is used to define multiple memcached servers which can be used for your site. Please make sure to edit the name/ip of the server and the port before you save the file.

That’s it. Now just refresh your cache and WordPress should start storing the objects in memcache and will access your database very sparsely. Do let me know if you have any problems or difficulties in setting this up through your comments.

To implement the Ubuntu font on your website or webpage, head over to this page and click on the link which says "Use this font". On this page you will find code and instructions to use the Ubuntu font on your website. Just copy over the code to your webpage and you can specify your font as "Ubuntu"

Google Web Fonts also has several other fonts which can be used on any websites or webpages, head over to http://www.google.com/webfonts to browse the entire collection.

Recently one of my friends downloaded an app and found out that it contained a file with a .db extension. She did not know how to open the file and asked my help. Since I have dealt with .db files previously, I was able to quickly point out to her on how to open a .db file.

The .db file could also be a Windows thumbnail cache file which stores thumbnail images for Windows Explorer’s thumbnail view. The Windows thumbnail cache file will always have a name called thumbs.db.

Additionally, .db files are database files created in popular lightweight database SQLite. The .db files can be created by several applications including Firefox, Google Chrome, Opera and other apps to store information. To open files with .db extensions which are not named thumbs.db, you will need to download the SQLite Database Browser.

The SQLite Database Browser can be downloaded from http://sqlitebrowser.sourceforge.net/. Once you download and extract the software, double click on the executable name SQLite Database Browser. After that follow the steps given below.

Step 1: Click on File -> Open and select the .db file you want to open.

Step 2: If the file is a proper SQLite Database, you will be able to view the database tables and structure in the SQLite Database Browser as shown above.

Sometimes when you open a .db file, you might see an error saying that the file is not a SQLite Database. In those cases, you can try and open the file in a text editor to view it’s contents. If you are running windows, you can also try to open the file with Microsoft Access. Remember that thumbs.db is not a database file and cannot be opened using the above software.

Every once in a while you may download files which may have extensions that you may never have heard of. In such cases, you might be shown a dialog by windows to use a web service to find the appropriate software to open or view the file.

One of our readers downloaded a WBMP file recently and was wondering how to open it. First of all, a file with WBMP extension uses an image format called Wireless Application Protocol Bitmap Format. It is an optimized image used for mobile devices.

The WBMP file cannot be opened using regular image software or image tools and requires a special viewing tool. In order to open or view the WBMP file, you can download a software called XnView. Once you have downloaded the software, you can easily open and view the WBMP file with it.

Gmail is no doubt one of the best email services out there, however, it does have an annoying feature which keeps adding email addresses as contacts when you email someone new. This can be quite a pain because your contact list will start growing with unnecessary contacts.

Google has been listening to feedback and has introduced a new feature where users can disable Gmail from adding new users you email to your contacts list.

To enable this feature, head over to the Gmail settings page and look for the option which says “Create contacts for auto-complete”. Now select the option which says “I’ll add contacts myself” and save the settings. Once you have enabled this feature Gmail will not add new contacts to your contacts list unless you do it manually.

Firefox 4 is definitely one of the best versions of Firefox I have seen over the last couple of years. Firefox is one of the browsers I use since it was launched, but there were a few features and annoyances which needed to be fixed. Some of these were high memory hogging, no easy sync of bookmarks, passwords or browser preferences, no feel of a modern browser, unnecessary UI clutter and so on.

Thankfully, the Mozilla team has learned that this is the age of cloud computing and have introduced some rich features in Firefox 4. This includes Firefox Sync, Site tagging, Instant search, smart folders, tab groups and more.

It’s always a good idea to first check your system requirements and the prerequisites of a software program before installing it on your operating system. This system requirements page at Mozilla details all the software and hardware requirements required for Firefox 4 to run on Windows, Mac or Linux.

Firefox 4 Installation Guide And Screenshot Tour

If you’re no geek and need step by step instructions for installing Firefox 4 on your computer, the screenshot tour by Howtogeek should be a good start.

Earlier today, we reported that Firefox 4 has just been released. Why do you need instructions to install the newest Firefox in Ubuntu? If you go into your Ubuntu Software Center, you’ll see that you more than likely have Firefox 3.6 installed, and it’s “up to date”. Naturally, they don’t add programs to the Software Center as soon as they are released. That would be foolish if there was something wrong with the new version. I don’t blame them for waiting at least a few days for the adventure seekers to provide some feedback.

There are three ways that I know of to add the newest Firefox to Ubuntu.

Facebook recently rolled out a new change to their user interface where they got rid of the Comment button and allowed users to comment by hitting the Enter key. However, this was a bit annoying to users who did not know about it and innocently hit enter to add a new line to their comment. When they did this, the comment was automatically posted. (Hint: use Shift + Enter to add a new line)

If you are someone who has been annoyed by this problem, there is a quick and easy fix to get back the old comment button on Facebook through a Greasemonkey script.

I use a lot of custom meta fields in WordPress posts for several reasons. They allow me to manipulate multiple posts without having to write code for a specific conditions.

However, of late, I came across a very annoying problem where custom meta fields were automatically deleted for some reason that was unknown to me. It was annoying me to no end because I had to manually go in and add those custom fields for the posts over and over again.

I didn’t have much time to figure out what is wrong and left in some debug code which would allow me to later on see how things were disappearing. Today, I checked those logs and found out the problem with the disappearing custom meta fields.

The problem was that, WordPress processes hooks for the edit_post, publish_post and save_post not just for editing the posts but also various other functions like while approving comments too, but the code in question always tried to find the $_POST variables and delete them if they didn’t exist. This was the mystery behind those disappearing post custom meta fields.

Solution For The Problem?

If you are not a developer, you are better off disabling those plugins and adding those fields manually using WordPress write interface. However, if you use a plugin you might lose additional functionality it provides. You could always send an email to the plugin developer asking them to make the appropriate changes.

If you are a developer, Mark Jaquith has a post which talks about avoiding such problems. You can read the post here and modify your plugin or theme to fix this issue.

This feature allows you to type a URL or title of the page and jump to an open tab instead of opening a new tab. Google Chrome does not have this feature in the current stable version. However, if you are using the development version of Google Chrome or Canary Build of Chrome, you can enable this feature in the browser.

To enable the Open Existing Tab feature in development or Canary build version of Chrome, open a new tab and type about:flagsand hit Enter. Now scroll down to the bottom of the page and Enable the feature Focus existing tab on open.

Once you have enabled this feature, Chrome will take you to an existing open tab instead of opening a new tab. This is definitely handy when you have several tabs open and don’t want to search for the tab you are looking for or open another unnecessary tab. Kudos to Mozilla for thinking of this feature.