Archives:

c++ pass default shared_ptr reference as nullptr 5/5 (1)

First of all, shared_ptr can be a nullptr.  Nothing wrong passing a null shared pointer. In fact, a null shared pointer is an actual Null Object, which means that it’s designed exactly for those kinds of uses.   but if we want to pass the share_ptr as default nullptr reference, we need to put a const • Read More »


srtp and h.235.6 secure rtp No ratings yet.

SRTP RFCs and h.235 is Not an easy read. Here is my very high level beriefing: AES Encryption (1) AES is the foundation for both srtp and h.235.6 secured rtp AES is symmetric encryption,  it takes those two as input key + IV:  128/192/256-bits length key , ( + optional Initialized vector or counter) src input:    • Read More »


rabbitMQ exchanges, queue , routing keys, bindings No ratings yet.

RabiitMQ implement the  AMQP protocol. written in Erlang. it is a quite useful message broker or message middleware. It works like this:   sender or receiver can create different type of Exchanges. Sender of course will send message to exchange. The receiver will create a queue, and binding to the exchange. The Exchange will route • Read More »


cmake how to build debug version No ratings yet.

Some of projects use cmake,  usually we can build like: mkdir build && cd build cmake .. camke –build . it usually a release version.   we as developer need debug version, some doc said cmake –build [–config Release] . that seems indicate if want a debug version we do: make –build –config Debug . but • Read More »


SIP Register and Kamailio AoR No ratings yet.

The RFC 3262 said: https://tools.ietf.org/html/rfc3261#section-10 The To header field contains the address of record whose registration is to be created, queried, or modified. That means TO contains AoR, and it should be some sort of sip uri. Normally we will see display name part in front of the sip uri. So if we send sip • Read More »


quick sort No ratings yet.

Quick sort High level code are quite simple ( divide/conque, recursively partition the array): void quickSort(int arr[], int low, int high) {     if (low < high)     {         /* pi is partitioning index, arr[p] is now            at right place */         int pi = partition(arr, low, high);         // Separately sort elements before         // partition and after partition • Read More »


Heap and Heapsort No ratings yet.

Heap/Heapsort is not difficult to understand when you reading online articles/watching online videos, but without using it everyday, it is quite easy to forget the evil details. Here are some notes to help memorizing this. (1) Min/Max heap, is a  a Complete Binary Tree with its parent nodes smaller or greater than its two children. a A • Read More »


openstack 5/5 (1)

I spent several days to install openstack on debian 8 at one testing box with two NICs. Finally got a basic working system! It has with a controller node running neutron, glance and horizon, a compute node using KVM. To get much speed, one KVM VM is created as a controller node on that box, at the same • Read More »


docker No ratings yet.

Finally I got some chances to package one application using docker, here are some useful commands docker images: docker build –rm -t my_tag docker_dir ( with Dockerfile) docker images , docker rmi ( remove docker image) docker containers docker run -d –publish 9080:80 –publish 1022:22 –name container_name –restart always –voloume host_dir:container_dir -e HOST_UID=$(id -u) $tag • Read More »


Go Language vs C/C++ 3/5 (2)

I have spent several days on Go. It is a little more similar to C, not C++. As it has no class concept, only structure.  Also it has pointer ( but no pointer arithmetic), interface. Also it has slice, map, go routine( for multi-thread) which make it unique. Overall it is could be a good language. Here • Read More »