127.0.0.1 typically refers to loopback local-only terminal 0.0.0.0 depending on the context, this typically instructs an application to listen on every available interface. Example: With following MongoDB configuration
|
net: port: 27017 bindIp: 127.0.0.1 |
Mongo… Read more »
Dynamically allocate array of 2 pointers to functions returning int and taking no argument.
|
int test1() {printf "test1"; return 0;} int test2() {printf "test2"; return 0;} int main(int argc, char* argv[]) { int (*(*f_arr))() = malloc(sizeof(int (*)()) * 2); f_arr[0] = &test1; f_arr[1] = &test1; } |
Statically allocate array of 2 pointers to functions returning int and taking no argument.
|
int test1() {printf "test1"; return 0;} int test2() {printf "test2"; return 0;} int main(int argc, char* argv[]) { int (*f_arr[2])() = {test1, test2}; return testRunner(f_arr, 2); } |
… Read more »
Nowadays I am using docker all the time. Yet sometimes I forget some switch or workflow. So to remember better and have it easily available, I decided to write down… Read more »
Create group for your user
Add user to group
|
usermod -G my_group my_user |
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 »
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 »
The problem Let’s say we have two scripts, /foo/bar/utils.sh
|
function do_something_useful { echo "Hello $1" } |
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 »
Command eval is builtin shell builtin, part of POSIX. In practice, eval takes a string as argument and evaluates that string as if you would typed it if it was… Read more »
Goal The goal of this blog is to describe steps to reach following state. I want to run CentOS7 box in Vagrant using VirtualBox Vagrant provider. I want to… Read more »
The problem Here is description of imaginary situation we want to solve. You have access via SSH to server server with hostname foobar-server. The foobar-server is running some service –… Read more »
It’s pretty common that you might want to change a configuration for a .jar or .war package. How bothering it is to unpack the archieve, find the file, do you… Read more »