How to setup a redundant NFS server with DRBD and Heartbeat in CentOS 5

How to setup a redundant NFS server with DRBD and Heartbeat in CentOS 5

This tutorial will guide you through the entire process of setting up a highly available NFS server.  To proceed, you must have the following: 1. 2 servers with similar hard disk setup (These will be used to create a redundant nfs server) 2. atleast 1 server where the nfs share will be mounted. 3. Static [...]

Read full storyComments { 4 }
Error: Too many open files

Error: Too many open files

Couple days ago, I ran into this error on CentOS 5.2.  To my understanding this error can occur on all flavors of linux. This totally caught me by surprise as I had never seen this before.  I had just finished installing awstats and wanted to run an update for the first time.  The logs were [...]

Read full storyComments { 0 }
How to Reset the MySQL Root Password

How to Reset the MySQL Root Password

Follow the steps below if you have forgotten your mysql root password and wish to reset it. 1.  Create a text file with the following information in it. UPDATE mysql.user SET Password=PASSWORD(‘NEW_PASSWORD’) WHERE User=’root’; FLUSH PRIVILEGES; Replace “NEW_PASSWORD” with your desired mysql password.  Save the file to /etc/mysql-pass-reset 2.  Stop MySQL /etc/init.d/mysqld stop 3.  Start [...]

Read full storyComments { 0 }
How to Install ThinkorSwim in Linux

How to Install ThinkorSwim in Linux

Here are the quick an easy steps on how to install TOS in Linux (Debian Distro). First you will need to setup Java on your computer so lets go ahead and do that. Open up the console and login as super user. su Now that we have full privileges, lets edit the sources.list file so [...]

Read full storyComments { 2 }
Using CSS to Center Vertically and Horizontally

Using CSS to Center Vertically and Horizontally

Centering items using CSS is actually very easy.  If you want to center a picture horizontally then just use the following code in your CSS file. IMG.centered { display: block; margin-left: auto; margin-right: auto; } What the above CSS code does is center an image between the left and right margins automatically. Whenever you insert [...]

Read full storyComments { 0 }
Automatically Add WWW to All Your URLs

Automatically Add WWW to All Your URLs

It is always a good idea to pick one format for your website URL and stick with it.  If you want to make sure all your URLs have a “www” in front of them then paste the following code at the top of your “.htaccess” file. Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_URI}\\/%{HTTP_HOST}/www. ^/+(.+/)?[^.]*[^/]\\(/)([^w][^w][^w][^.].*/(www\.)¦.*)$ [OR,NC] RewriteCond [...]

Read full storyComments { 3 }
How to Change Autoincriment Value in MySQL

How to Change Autoincriment Value in MySQL

If you have a attribute in your table that automatically increments itself for every new row, you can change what the next value is very easily. You can do so by either of the two following ways. 1. Change the autoincrement value with a simple sql query. ALTER TABLE {table name} AUTO_INCREMENT = {some number}; [...]

Read full storyComments { 0 }
Understanding Linux File Permissions

Understanding Linux File Permissions

File permissions in Linux are actually pretty easy to understand and modify.  To check the permissions on a file just navigate to the directory and use the following command to list the files and their details. ls -l As you can see, the first piece of information on each line are the permissions.  There are [...]

Read full storyComments { 4 }
Prevent search engines from crawling and indexing your website

Prevent search engines from crawling and indexing your website

All search engines have automatic web crawlers that are constantly browsing the internet in order to keep their search results up to date.  Unless you specifically configure your website to disallow them, they will eventually find you and list you in their search results. To disallow these crawlers(robots) from crawling your website, just create a [...]

Read full storyComments { 0 }
How to get information about your php installation

How to get information about your php installation

When creating php programs, not only is it important to know which version of php is running on your server but also which modules are compiled with your php installation. To check what modules are installed, simply type the following code in a php file and load the file in your browser. phpinfo(8); If you [...]

Read full storyComments { 0 }