Skip to content

Instantly share code, notes, and snippets.

@package {"iptables": }
class foo {
package {"fail2ban": require=>Package['iptables']}
}
class bar {
file {"rc.local": require=>Package['iptables']}
}
notice("IS_VIRTUAL: $is_virtual.")
env_setting { "GRUB_TIMEOUT":
file => "/etc/default/grub",
value => $is_virtual ? {
true => 0,
default => 5,
}
}
#!/bin/bash
set -e
pkgname=openldap
pkgdir="$PWD"/.pkg-openldap
pkgver=2.4.35-152-g494ca7d
pkgrel=2
makedeps=(libssl-dev libltdl-dev libdb-dev libsasl2-dev libperl-dev)
/net
└── switches
└── switch1
├── flows
│   └── f1
│   ├── action.ip_dst
│   ├── action.ip_proto
│   ├── action.ip_src
│   ├── action.mac_dst
│   ├── action.mac_src
#!/bin/bash
dev=/dev/disk/by-partlabel/$(hostname -s)-crypt-root
key=/boot/key
grubcfg=/boot/grub/grub.cfg
usage() {
local arg0=$(basename "$0")
cat <<-EOF
usage $arg0 add|rm [dev]
static Map<Long,RouteTable> calc_all_routes(Logger log, Graph graph)
{
// Initialize a new routing tables
Map<Long,RouteTable> new_tbl = new Hashtable<>();
Map<String, PathFinder> paths = new Hashtable<>();
for (String s : graph.vertices()) {
paths.put(s, new PathFinder(graph, s));
/**
* AVL hashmap
*
* This is used to map file descriptors from
**/
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
/**
* AVL hashmap
*
* This is used to map file descriptors from
**/
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/inotify.h>
#include <linux/fcntl.h>
@mmonaco
mmonaco / write-mime-multipart
Created September 29, 2012 05:24
write-multipart-mime
#!/usr/bin/python2
# largely taken from python examples
# http://docs.python.org/library/email-examples.html
import os
import sys
import smtplib
# For guessing MIME type based on file name extension
import mimetypes