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
LoadPlugin "table" | |
<Plugin table> | |
{% for vm in running_vms.list_vms %} | |
<Table "/sys/fs/cgroup/memory/libvirt/lxc/{{ vm }}/memory.stat"> | |
Instance "{{ vm }}-memory" | |
Separator " \\n" | |
<Result> | |
Type gauge | |
InstancesFrom 0 | |
ValuesFrom 1 |
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 | |
import time | |
import signal | |
import sys | |
SIGS = dict((k, v) for v, k in signal.__dict__.iteritems() if v.startswith('SIG')) | |
def sighandler(signum, frame): | |
print 'Signal handler called with signal', SIGS[signum] | |
sys.exit(1) |
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
LoadPlugin curl_json | |
<Plugin curl_json> | |
<URL "http://localhost/fpm-status?json"> | |
Instance "fpm" | |
<Key "accepted conn"> | |
Instance "accepted_conn" | |
Type "http_requests" | |
</Key> | |
<Key "listen queue len"> | |
Instance "listen_queue_len" |
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
processor : 0 | |
vendor_id : GenuineIntel | |
cpu family : 6 | |
model : 2 | |
model name : QEMU Virtual CPU version 0.12.3 | |
stepping : 3 | |
cpu MHz : 1596.068 | |
cache size : 4096 KB | |
fpu : yes | |
fpu_exception : yes |
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
# Place in lookup_plugins/foo/mytest.py | |
from ansible import utils | |
class LookupModule(object): | |
def __init__(self, basedir=None, **kwargs): | |
self.basedir = basedir | |
def run(self, terms, inject=None, **kwargs): |
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
--- | |
- name: create logic volume | |
lvol: vg=$vol_group size=$vol_size lv={{ vol_name }} state=present | |
- name: check filesystem | |
command: tune2fs -l /dev/{{ vol_group }}/{{ vol_name }} | |
ignore_errors: True | |
register: result | |
- name: mkfs |
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
from flask import Flask, request | |
from flask.ext.sqlalchemy import SQLAlchemy | |
import unittest | |
app = Flask(__name__) | |
app.debug = True | |
db = SQLAlchemy() | |
db.init_app(app) |
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
import salt.config | |
opts = salt.config.minion_config('/tmp/foo') # Doesnt need to be present | |
opts['file_client'] = 'local' # I dont know if this is right. Not 'remote' | |
opts['cachedir'] = '/tmp/salt' # Needs to be writeable | |
d = { | |
'/tmp/bacon': { | |
'file': [ | |
'directory', |
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
varnishlog -c -m TxStatus:503 #Log client (not backend) requests that result in a 503 being returned to a client |
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
Connected to 172.16.137.140. | |
220 pyftpdlib 1.0.0 ready. | |
Name (172.16.137.140:daz): bad | |
331 Username ok, send password. | |
Password: | |
421 Service not available, remote server timed out. Connection closed. | |
ftp: Login failed | |
ftp> |