MySQL World Cities database installation

MaxMind offers a free cities database, the database contains more than 2.7 mil. locations, you can download it at MaxMind’s website. Once you have downloaded the compressed database, extract the file worldcitiespop.txt and invoke the MySQL client (preferably from the same directory where the worldcitiespop.txt file resides). Create the world database and the cities table [...]

Add or Remove a word from Firefox dictionary

Firefox profile directory

Lappy, touchpad, plugin, WordPress, vlog… and many other words are not (yet) recognized by Firefox, each time you use any of them Firefox will underline them in red, it would be better not to be bothered by these lines every time you write a “common” word which is not listed in the dictionary. Add a [...]

WordPress page navigation without using a plugin

wp page navigation

Here is a small… yes, a small function for displaying a paged navigation in your WordPress powered blog without using any plugin. The function is self-explaining, it accepts one optional parameter, the number of links to show without counting the previous and next buttons. The first, previous, next and last buttons text can be set [...]

HowTo: Connect to Hostmonster’s SSH with a private key

Note: I use Hostmonster, I can’t test elsewhere, but I think these steps will work for Bluehost too. I don’t understand why most tutorials on hostmonster and bluehost are incomplete, they have one of the best shared hosting service, one of the best support teams… but there knowledge base is not that shiny. Well, this [...]

WordPress LTR/RTL

rtl

Hello, I found your website on a WordPress forum. Currently I am rebuilding a website in wordpress that is in English and Farsi. I am using the Qtranslate and a theme called suffusion which supports RTL. The theme does come a rtl.css which moves everything to the right which is great. The problem I am [...]

PHP with IMAP on CentOS

I was playing with Drupal 6 and some UberCart ticket module when I came across an error message where Drupal told me that it needed the IMAP PHP extension to be installed. Because I’m a nice guy I will share this command with you: [me@it ~]# yum install php-imap Now it’s installed, proof: [me@it ~]# [...]

Error writing the value’s new contents (Windows Registry Editor)

I got this error when trying to change some configuration settings for my anti-virus (TrendMicro WFBS on Windows Server 2003) ‘Cannot edit LocalServerPort: Error writing the value’s new contents’ As usual, when something I don’t like happens on my computer or on other parts of my life, I ask my friend Google about it, the [...]

Get current URL in PHP

Here is a function for getting the URL of the page being processed in PHP, the function accepts one optional parameter $ignore_port_80 (boolean) to tell it whether it should ignore the port part of the url if the port used is 80: # Function function get_current_url($ignore_port_80 = true) { $is_https = $_SERVER['HTTPS'] === ‘on’; $show_port [...]

vsftpd: 500 OOPS: unrecognised variable in config file

Question When I start vsftpd on my CentOs machine I get this error: Starting vsftpd for vsftpd: 500 OOPS: unrecognised variable in config file:  anonymous_enable How can I fix it? Answer The option “anonymous_enable” is a valid vsftpd option, but as you can see on the error message, there is an extra white space before the [...]

MySQL statement terminators

There is the semicolon “;” that every one knows, and “\g” which is just the same: mysql > SELECT * FROM wp_links; mysql > SELECT * FROM wp_links\g Those are exactly the same, and will produce the same result, here is an example: mysql> select * from wp_links \g +———+———————–+————–+————+————-+—————+——————+————–+————+————-+———————+———-+————+———————–+ | link_id | link_url …