Monthly Archives: December 2015

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 »

How to rotate your screen in Ubuntu/Linux

By | December 4, 2015

I had a dedicated key for auto rotate on/off on my laptop which worked in Windows but in not Ubuntu. I’m glad because I got to learn a new command called xrandr. I remember this by thinking of x random r. It is really neat and I recommend you running these commands and experiment. These… Read More »