Ruben Laguna's blog

Feb 22, 2015 - 6 minute read - shm posix

POSIX / System V Shared Memory vs Threads Shared Memory

I’ve been playing around with POSIX Shared Memory and I decided that I should write a bit on the different options when it comes to shared memory. So this is going to be a bit of a comparison between shared memory with POSIX Threads, POSIX Shared Memory objects but also a random collection of facts. Also I guess I should begin stating my main source of information: The Linux Programming Interface by Michael Kerrisk.

Feb 10, 2015 - 2 minute read - lua gamedev

Review of Learning Game AI Programming with Lua

I was approached by Packt Publishing to checkout a new book they published called Learning Game AI Programming with Lua by David Young. They gave me a copy of the ebook and I agreed on taking a look. I should say that when I read the title I though it will be a book about Game AI in the sense of finding your way in a maze, and stuff like that.

Feb 5, 2015 - 1 minute read - security

Compute AES CMAC using OpenSSL/libcrypto

When I googled on how to perform the AES CMAC calculation using OpenSSL/libcrypto I couldn’t find any code example. I was no even sure that there was support for it of libcrypto so I downloaded the OpenSSL sources and dig into them until I found crypto/cmac/cmac.c. From there it was obvious that there is support for CMAC and that it follow the *{Init,Update,Final} pattern found in EVP api. So I give it I try and I’m sharing the basic source code here for later reference:

Jun 10, 2014 - 3 minute read - linux

SSH Port forwarding through multiple hops [.ssh/config]

Anybody that have to work with lab at work knows the pain of connecting to them. Usually labs don’t have direct connectivity to the “regular” network and to connect to them involves a series of jumps though different machines. Just SSH connectivity is painful in those scenarios let alone port forwarding. Fortunately you can setup your ~/.ssh/config in such a way that will automate most of it, if not all.

Dec 9, 2012 - 6 minute read - lua

Accessing C++ objects from Lua

Continuing the post about lua integration with C++. Now to more serious stuff. Let’s try to write a wrapper for a std::list<int>. Imagine that you have a std::list<int> in your C++ that you want to share with the Lua enviroment. So both C++ and Lua can access the list.