This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"syscall" | |
"unsafe" | |
"golang.org/x/sys/windows" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class RobustPDO extends PDO | |
{ | |
/** Call setAttribute to set the session wait_timeout value */ | |
const ATTR_MYSQL_TIMEOUT = 100; | |
/** @var array */ | |
protected $config = []; | |
/** @var bool For lazy connection tracking */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from twisted.web import server, resource | |
from twisted.internet import reactor, defer | |
from pprint import pprint | |
import base64 | |
class DummyServer(resource.Resource): | |
isLeaf = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function for setting up precompiled headers. Usage: | |
# | |
# add_library/executable(target | |
# pchheader.c pchheader.cpp pchheader.h) | |
# | |
# add_precompiled_header(target pchheader.h | |
# [FORCEINCLUDE] | |
# [SOURCE_C pchheader.c] | |
# [SOURCE_CXX pchheader.cpp]) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# compile iptables from source and install to /usr/local | |
mkdir -p /tmp/iptables | |
wget "http://www.netfilter.org/projects/iptables/files/iptables-1.4.21.tar.bz2" -qO- | tar --strip-components=1 -C /tmp/iptables -xvj | |
cd /tmp/iptables | |
./configure | |
make | |
make install | |
# set alternatives | |
sudo alternatives --install /sbin/iptables iptables.x86_64 /usr/local/sbin/iptables 100 \ |
NB: The following examples where done on Puppet Enterprise 3.0 running on Centos 6. Should be similar for open source versions, except for some file locations.
The easiest way to snoop around in de actual PuppetDB postgres database is using the command prompt. You have to be the peadmin user though. Couldn't get it working just under root.
[root@master bin]# sudo su - pe-postgres -s /bin/bash
-bash-4.1$ /opt/puppet/bin/psql
psql (9.2.4)
Type "help" for help.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* inspired from ngx_http_log_module.c:ngx_http_log_request_time() */ | |
static ngx_int_t | |
ngx_http_request_time(ngx_http_request_t *r, | |
ngx_http_variable_value_t *v, | |
uintptr_t data) { | |
ngx_time_t *tp; | |
ngx_msec_int_t ms; | |
tp = ngx_timeofday(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://gist.github.com/Chandler/fb7a070f52883849de35 SEE HERE | |
# MIT License | |
# Copyright (c) 2016 Chandler Abraham | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights |