Category Archives: Programming

How to install or upgrade MongoDB on Ubuntu

By | December 29, 2015

Step 1: Add Mongodb to your sources.list.d (for Ubuntu 14.04) This allows you to get the latest files from mongodb.org when you run sudo apt-get install echo “deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list Step 2: Reload the local package database sudo apt-get update Step 3: Install MongoDB sudo apt-get install -y mongodb-org -y automatically… Read More »

True or false in C

By | December 26, 2015

A simple concept in the C language is the evaluation of a boolean expression with an if statement. But what if the condition is not a typical relational or boolean expression? In C, it is possible to write: if (x){ // if x is true or great than zero printf(“x is true/has a value/great than… Read More »

How does CPU memory work and what every programmers should know about memory

By | December 7, 2015

Came across this detailed paper “What Every Programmer Should Know About Memory” by Ulrich Drepper dated 21 November 2007. (http://www.akkadia.org/drepper/cpumemory.pdf) It is a long read but provides a wealth of background which explains some good fundamental concepts that are still valid today. Another article, http://marek.vavrusa.com/c/memory/2015/02/20/memory/ puts another “practical” spin on the original paper and is also… Read More »

My favourite error: exec_tty error: Cannot run program: Unknown reason

By | November 4, 2015

Well, almost my favourite, but it is pretty cryptic to say the least. All I was trying to do was run the default Hello World C program after a fresh install of Eclipse. (4.4 in this case) on Ubuntu 14.04 After a bit of searching, this post nailed it. http://stackoverflow.com/questions/11390163/running-ubuntu-eclipse-c-helloworld I was trying to execute… Read More »

How to run bash scripts in Mule ESB

By | September 29, 2015

Intro I wanted to figure out how to run bash scripts in Mule ESB so my first point of call? Google. Google returned a few useful results. Primarily: http://stackoverflow.com/questions/13039604/running-shell-scripts-from-mule-esb and http://mule.1045714.n5.nabble.com/Can-I-run-a-shell-script-from-Mule-Jython-td2658688.html Being new to this I couldn’t make out much but 2 things stuck out. Groovy and “ls”.excute(). Armed with these 2 clues, I tried… Read More »