Ubuntu 14.04, Mariadb 10.1, and lib_mysqludf_sys install issues

https://github.com/mysqludf/lib_mysqludf_sys

apt-get install libmariadbclient-dev libmariadbclient18
git clone https://github.com/mysqludf/lib_mysqludf_sys.git
cd lib_mysqludf_sys/

After I did the clone and moved into the directory I tried to run make as the readme stated, but was presented with the following error

gcc -Wall -I/usr/include/mysql -I. -shared lib_mysqludf_sys.c -o /usr/lib/lib_mysqludf_sys.so
/usr/bin/ld: /tmp/ccHf1tzc.o: relocation R_X86_64_32 against `.rodata’ can not be used when making a shared object; recompile with -fPIC
/tmp/ccHf1tzc.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [install] Error 1

With that being said I started researching and found that adding -fPIC to the gcc command like so and it installed with out error

gcc -fPIC -Wall -I/usr/include/mysql -I. -shared lib_mysqludf_sys.c -o /usr/lib/mysql/plugin/lib_mysqludf_sys.so

Lastly you run the following command and it will be added into MySQL

mysql -u root -p < lib_mysqludf_sys.sql

http://crazytechthoughts.blogspot.com/2011/12/call-external-program-from-mysql.html
DELIMITER @@

CREATE TRIGGER Test_Trigger
AFTER INSERT ON MyTable
FOR EACH ROW
BEGIN
DECLARE cmd CHAR(255);
DECLARE result int(10);
SET cmd=CONCAT(‘sudo /path/to/script/bash.sh ‘,’2nd command’);
SET result = sys_exec(cmd);
END;
@@
DELIMITER ;

Installing sshpass on OS X

I recently came across ansible and decided to give it a go, actually kind of upset that I never came across it before as I can already imagine quite a few cases when it could have come in handy and saved me a lot of time when it came to running the same command across multiple servers.

I went about installing ansible by using Homebrew which I have installed on my MacBook Air but soon noticed that I was not able to run commands against all the servers since sshpass was not installed on my machine. I figured the easy route would be to use Homebrew and just install it, but just searching for sshpass with Homebrew I was presented with the following error message. Continue reading Installing sshpass on OS X

Installing HipHop Virtual Machine

I recently read an article about how you can install HipHp Virtual Machine (HHVM) for a 2x+ speed boost on your site.  The newest version of WordPress works 100% with HHVM, but unfortunately some of the plugins out there don’t. I decided the pros out weighed the cons and decided to install HHVM on my development server.  Outlined below are the steps for installing it on your own.

wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
echo deb http://dl.hhvm.com/ubuntu saucy main | sudo tee /etc/apt/sources.list.d/hhvm.list
sudo apt-get update
sudo apt-get install hhvm
sudo /usr/share/hhvm/install_fastcgi.sh
sudo update-rc.d hhvm defaults
sudo /etc/init.d/hhvm restart
sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60

Continue reading Installing HipHop Virtual Machine