Skip to content

Instantly share code, notes, and snippets.

View flit's full-sized avatar

Chris Reed flit

View GitHub Profile
@flit
flit / microtime.c
Last active May 8, 2020 17:38
Get the current time in microseconds in C.
#include <sys/time.h>
/**
* Returns the current time in microseconds.
*/
long get_microseconds(){
struct timeval currentTime;
gettimeofday(&currentTime, NULL);
return currentTime.tv_sec * (int)1e6 + currentTime.tv_usec;
}
@flit
flit / setup-vmware-image-with-static-IP.markdown
Last active October 10, 2018 19:59 — forked from pjkelly/setup-vmware-image-with-static-IP.markdown
VMWare Fusion 10 images with a static IP Address on macOS

How to setup your VMWare Fusion images to use static IP addresses on Mac OS X

Using a static IP address makes it a hell of a lot easier to ssh into your vm.

1. Determine the MAC address of your guest machine

Let's say you have a guest machine with the name foobar and you keep your guest machine images in ~/Documents/Virtual\ Machines/. To determine the MAC address for this VM, you can run:

cat ~/Documents/Virtual\ Machines/foobar.vmwarevm/foobar.vmx | grep ethernet0.generatedAddress