Skip to content

Instantly share code, notes, and snippets.

@laindir
laindir / README.md
Last active Aug 29, 2015
puppet master fails to retrieve cached facts from yaml
View README.md

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 Oct 8, 2014
An example of using interface types in C
View Makefile
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
View gist:8172142

Here's a heading

  • maybe
  • a
  • list
  • with
  • a
  • few
  • more
  • items
@laindir
laindir / iterate.c
Created Aug 28, 2013
Example of a coroutine/generator in C
View iterate.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 Aug 28, 2013
Simon Tatham/Tom Duff style coroutines
View coroutine.h
#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