TL;DR: How do you call a tolopogy where you have virtual machine inside virtual machine inside another virtual machine? Virtual machine inception.
I need to help to setup facilities for a kernel seminar. Each participant must have a virtual machine. This VM provided by the company that organizes the seminar.
The company sent me this VM. It was made in newest VMware player. For some reason, after googling a lot, and following few guides, I couldn’t add it to my old ESXi server. I guess VMware didn’t make this software back compatible.
So instead, i took an easy way out. I created a VM, and installed several VMs inside the 1st VM. I am limited to 8 cores for the 1st VM. So I cloned this one also.
I decided to call this setup “virtual machine inception”. As this reminded me of the movie “inception”, where the protagonist goes into a dream, and within the dream goes into another dream.
I saw this picture on Instagram on page of some guy that teaches python
I assume that what this guy meant is that python fits best for some kind of applications than c, and for some kind of applications c fits better than python, and not that c generally sucks compared to python.
Linked list, is a dynamic data structure in c to store data. This post is cheat sheet to myself, for every time I need to build a linked list. This is not necessary the correct way of creating the linked list, but this is my way.
Name : LinkedList.c
Author : Tim Goldshmit
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
puts("!!!Kick this into gear!!!");
struct my_list temp;
// create the root or the first node
struct my_list root;
memset (&root,0,sizeof(struct my_list));
struct my_list *p;
the .h file
* Created on: Oct 6, 2019
* Author: timg
// struct my_list *head;
struct my_list *prev_node;
struct my_list *next_node;
struct my_data mydata;
int add_to_list(struct my_list *current_list,struct my_list *new_entry);
int free_all(struct my_list *any_entry);
int remove_n_from_list(struct my_list *entry_to_remove,int n);
#endif /* MYLINKEDLIST_H_ */
The .c file
* Created on: Oct 6, 2019
* Author: timg
* Add to the end if the list
* current_list - any member of the list
* new_entry - data to enter. the pointers do not matter, it only copies the data
int add_to_list(struct my_list *current_list,struct my_list *new_entry)
//In case not at the end of the node. Move to the last node
struct my_list *new_node=(struct my_list*)malloc(sizeof(struct my_list));
memset (new_node,0,sizeof(struct my_list));
* Remove node number n from the list.
* To remove current node, in the list send address of the
* node to the function with n=0
int remove_n_from_list(struct my_list *entry_to_remove,int n)
if (entry_to_remove->prev_node==NULL && entry_to_remove->next_node!=NULL)
else if (entry_to_remove->next_node==NULL && entry_to_remove->prev_node!=NULL)
else if (entry_to_remove->next_node!=NULL && entry_to_remove->prev_node!=NULL)
* Frees all of the memory of the linked list
int free_all(struct my_list *any_entry)
// get to the first node
// free nodes one by one
struct my_list *temp;
TL;DR: use this program to track if a host up or down using ping.
Sometimes for some kind of a check, I need to ping a host for a lot of time and see when the ping wasn’t successful. The familiar ping program doesn’t fit that purpose. Ping’s lines will scroll back, and if at some point ping will be unsuccessful, there is no way to know when it happened.
I searched google for a program that will log pings and tell when they were successful and when they were not. Found some for free and some programs that costs money.
I created a simple python script that will do just that. In addition I compiled the script to executable file for windows.
The program will ping destination and print the time when the ping was successful or not. After that it will print every time the destination changes it’s status. Output example:
./pinger.py -s 10.0.2.31
system 10.0.2.31 up at 2018-04-02 10:37:05.976400
system 10.0.2.31 down at 2018-04-02 10:37:19.039902
system 10.0.2.31 up at 2018-04-02 10:37:26.063647
The program source code and executable file can be downloaded from my github page.