avatar

Andres Jaimes

Compiling and Debugging Oracle's Pro*C files in OS-X / Xcode

Part of my work as a Web/UNIX developer includes maintenance and development of tools using Oracle’s Pro*C. In text interfaces, VIM is a pretty decent tool for creating source code and their companion make files. If you created the right make file, compiling is also a breeze. However things get kind of tricky when you have to debug. Oh my! This can be a difficult task. Many may say that there’s nothing like gdb, but come on guys, even you can’t deny the beauty of a visual debugger.

Oracle Snippets

This post will be updated with snippets for Oracle. I hope you find it useful.  1. Change the default date format Most useful snippet of the year! 😉 ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY HH24:MI:SS'; select sysdate from dual; 2. Escape single quotes and ampersands on strings Single quotes: select 'D''Angelo''s' from dual; Ampersands: SET DEFINE OFF; 3. Adjust page width and size set pagesize 1000 set linesize 100 4.

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. nano /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: cd mkdir mongo-php-driver cd mongo-php-driver curl https://codeload.github.com/mongodb/mongo-php-driver/zip/master > mongo-php-driver-master.zip Unzip it unzip mongo-php-driver-master.zip cd mongo-php-driver-master You need _phpize _to build the module. You can install it from the remi repository: wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -Uvh remi-release-6.rpm yum --enablerepo=remi install php-devel Configure and build phpize ./configure make all sudo 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 yum install mongo-10gen mongo-10gen-server  Configure MongoDB You can configure Mongo by editing the following file: /etc/mongod.conf Set Mongo to autostart on system boot: chkconfig mongod on Start Mongo service mongod start Stop Mongo