avatar

Andres Jaimes

Installing Java 1.6 on CentOS 6

Java 1.5 is the default Java version you get when you ask yum to install it on CentOS. However, several applications need 1.6 in order to run. Just follow the next steps to install it. Remove Java 1.5 1yum remove java-1.5-* Install the rpmforge repository 1cd 2rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt Check if you have a 32 or 64 CentOS version 1uname -a For 32 versions (i686) download and install the following repository

WordPress Snippets

As a WordPress developer I have collected / created / curated many snippets that I’ve used in my projects. I hope you find them useful.  General HTML / WordPress tags Get your template’s directory 1<link href="<?php echo get_template_directory_uri(); ?>/style.css" rel="stylesheet" media="screen"> Check if this is the home page 1<?php if (is_home()) { ... } ?>  Remove the wp_generator tag in the Head section of your HTML I recommend you to add this line for security reasons.

iptables snippets

iptables is the default firewall you see on any linux computer. It works by allowing (ACCEPTing) or denying (DROPing) connections to the local computer. There are basically three scenarios you can deal with: INPUT: Connections generated from a different computer targeting yours; for example, when you run a web server on your computer and others want to connect to it. OUTPUT: Connections generated from your computer targeting other computers; for example, when you open a web page or open a remote ssh session.

How to connect to MySQL from a remote server

In few words, you have to configure MySQL to allow remote connections, create a user for connecting and setup your firewall to allow it. You don’t have to do this if you are only connecting from a local application like WordPress. You need root permissions to perform the following commands.  Configuring MySQL Edit the MySQL configuration file. 1nano /etc/my.cnf Allow connections from all your network interfaces by commenting out the following line:

Installing MongoDB/PHP Driver on CentOS 6

Since the module is not included with the default PHP installation, you have to download it from the official repository: 1cd 2mkdir mongo-php-driver 3cd mongo-php-driver 4curl https://codeload.github.com/mongodb/mongo-php-driver/zip/master > mongo-php-driver-master.zip Unzip it 1unzip mongo-php-driver-master.zip 2cd mongo-php-driver-master You need _phpize _to build the module. You can install it from the remi repository: 1wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 2rpm -Uvh remi-release-6.rpm 3yum --enablerepo=remi install php-devel Configure and build 1phpize 2./configure 3make all 4sudo make install Make sure the installation directory is the same as the PHP extension directory by running:

Installing MongoDB on CentOS 6

The first step is to configure the repositories. Create the following file /etc/yum.repos.d/10gen.repo with the following contents: For 32-bit systems: [10gen] name=10gen Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686 gpgcheck=0 enabled=1 For 64-bit systems: [10gen] name=10gen Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 gpgcheck=0 enabled=1 Install Mongo 1yum install mongo-10gen mongo-10gen-server  Configure MongoDB You can configure Mongo by editing the following file: 1/etc/mongod.conf Set Mongo to autostart on system boot: 1chkconfig mongod on Start Mongo 1service mongod start Stop Mongo

Unresponsive iOS7 beta 2 touch screen

Since I installed iOS7 beta 2 version, my touch screen started to go unresponsive from time to time. After a couple hours of internet research this is what I found: iPhone unresponsiveness is mainly caused by notification messages being sent behind the lock screen. For example, when your battery reaches 20% you get a notification on your screen. There is a bug that may send those messages behind the lock screen giving you as a result an unresponsive screen – your iPhone is waiting for a response, but since you do not see the window because it is behind the lock screen, then you cannot respond… and well, you know.

Installing the PHP/MongoDB extension on Mac OSX 10.8

Installing PHP/MongoDB extension is a two steps task on OSX: Install the autoconf tool required for compiling the extension Install the Mongo extension You have to install autoconf in order to avoid the following error: 1Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. 2 3ERROR: `phpize’ failed Enough talk, hands on work…  Step 1. Install the autoconf tool Download the latest source version: