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 ;

Install ddclient on OS X

DynDNS LogoThe DynDNS OS X client has always seemed a bit clunky to me and outdated so I was looking for another way to use DynDNS with out that client. Thinking back I remembered that I used ddclient on one of my linux boxes from the command line a long while ago so I started looking into how I could implement that on my Macbook Air. I saw that Homebrew had a ddclient package so I got to work. Continue reading Install ddclient on OS X