Posts

Showing posts from March, 2016

Installing OCI8 on Ubuntu

If we want to use a database from PHP, we need to install OCI8 extension, which it will provide an API to the use of Oracle databases. Installing OCI8 on Ubuntu is not as easy as doing an apt-get, as it takes some SDK packages provided by Oracle and their distribution license prevents that can be included in Linux distributions. This means we will have to download and compile them ourselves.  Below is the steps to follow:  1. Install PEAR and PECL. sudo apt-get install php-pear 2. Download ''Oracle Instant Client''. We need at least the following packages 'Basic' and 'SDK'. 3. Unzip the files sudo mkdir -p /opt/oracle cd /opt/oracle sudo unzip instantclient-basic-linux-xxxxxxx.zip sudo unzip instantclient-sdk-linux-xxxxxxx.zip sudo mv /opt/oracle/instantclient_xx_x /opt/oracle/instantclient The 'X' should be replaced by the appropriate version. 4. Create symbolic links. cd /opt/oracle/instantclient sudo ln -s libclntsh.so....

Batch file to connect to an FTP and put a file

Recently I needed to create a batch file to back up a file on a FTP from another machine. It was not as trivial as might be expected initially, but once you've found out is pretty easy, I put it here in case someone finds it useful. You just have to create a file with execute permissions containing the following lines: #!/bin/bash ftp -n -v xxx.xxx.xxx.xxx << EOT user username password prompt put filename bye EOT