Author Archives: stashell

Allocating arrays of function pointers in C

Dynamically allocate array of 2 pointers to functions returning int and taking no argument.

Statically allocate array of 2 pointers to functions returning int and taking no argument.

Read more »

Quick guide configuring SSH access and sudo for new linux user on CentOS server

Create group for your user

Add user to group

Change user’s password

Now let’s make this user sudoer. Create a new file /etc/sudoers.d/my_sudoers To configure specific user… Read more »

Elasticsearch and ToxiProxy as Docker containers with Docker toolbox

Toxiproxy is cool TCP proxy server shipped both as utility and Docker container. I’ve found it particularly useful for integration testing. You can simply run this dockerized proxy server in… Read more »

How to include one bash script in another

The problem Let’s say we have two scripts, /foo/bar/utils.sh

and script /foo/bar/main.sh, in which you want to use function do_something_useful from utils.sh. The common incorrect answer You can easily… Read more »

C# snippet : JSONify object

One of my most favorite C# snippet is following oneliner useful when quick debugging or checking on something is needed.

Which returns String containing JSON representation of arbitrary C#… Read more »