Skip to content

Instantly share code, notes, and snippets.

@fibasile
fibasile / docker-compose.yml
Last active September 25, 2019 14:35
Docker compose file for a Gitlab instance with Fablabs.io login
# Fill in your fablabs.io app_id and secret from the fablabs.io developer console
# set the callback_url as http://yourhost/users/auth/fablabs/callback
# if you replace localhost with a public hostname, comment out the let's encrypt line
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'localhost'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://localhost'
@fibasile
fibasile / gist:5403374
Last active November 21, 2022 20:14
getting CPU usage in macosx
#include <sys/sysctl.h>
#include <sys/types.h>
#include <mach/mach.h>
#include <mach/processor_info.h>
#include <mach/mach_host.h>
processor_info_array_t cpuInfo, prevCpuInfo;
mach_msg_type_number_t numCpuInfo, numPrevCpuInfo;
unsigned numCPUs;