Skip to content

Instantly share code, notes, and snippets.

@laindir
laindir / README.md
Last active August 29, 2015 14:20
puppet master fails to retrieve cached facts from yaml

I arrived at my current theory when I saw the message that the agent throws on this PuppetDB issue. This issue presents when the puppet master pulls the facts back from PuppetDB instead of using the facts provided by the node.

In my case, the puppet master is writing the node's facts out to the yaml cache, but then failing to load them back in.

Puppet is 3.7.3 (Puppet Enterprise 3.7.1)

@laindir
laindir / Makefile
Created October 8, 2014 17:05
An example of using interface types in C
CFLAGS=-Wall -Wextra -pedantic -ansi -g
main: file_logger.o string_logrecord.o
main.o: ilogger.h file_logger.h string_logrecord.h
file_logger.o: ilogger.h file_logger.h
string_logrecord.o: ilogger.h string_logrecord.h

Here's a heading

  • maybe
  • a
  • list
  • with
  • a
  • few
  • more
  • items
@laindir
laindir / iterate.c
Created August 28, 2013 18:33
Example of a coroutine/generator in C
#include <stdio.h>
#include "coroutine.h"
typedef struct
{
int max_x;
int max_y;
int state;
int x;
int y;
@laindir
laindir / coroutine.h
Created August 28, 2013 18:32
Simon Tatham/Tom Duff style coroutines
#ifndef COROUTINE_H
#define COROUTINE_H
#define start(state) switch(state) { case 0:;
#define finish default:; }
/*save state and return value*/
#define yield(state,value) do { state = __LINE__; return (value); case __LINE__:; } while (0)
#endif