Skip to content

Instantly share code, notes, and snippets.

View petri's full-sized avatar

Petri Savolainen petri

View GitHub Profile
@rob-mosher
rob-mosher / hosts.conf
Last active July 3, 2019 13:52
Example: Icinga2 Monitor Windows Services
/*
* Add the following within the "object Host NodeName { HERE }" block
*
* Service names can be found in "services.msc" by right-clicking
* the desired service and selecting "Properties"
*/
vars.service_win_services["Service name 1"] = {}
vars.service_win_services["Service name 2"] = {}
vars.service_win_services["Service name 3"] = {}
@jaroel
jaroel / site.zcml
Created April 4, 2016 20:21
Minimal site.zcml to make my Plone 5 instance running without z3c.autoinclude.
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:meta="http://namespaces.zope.org/meta"
xmlns:five="http://namespaces.zope.org/five">
<include package="Zope2.App" />
<include package="Products.Five" />
<meta:redefinePermission from="zope2.Public" to="zope.Public" />
<!-- Load the meta -->
@joshbode
joshbode / LICENSE.md
Last active April 5, 2024 14:52
YAML Loader with include constructor (Python 3)

MIT License

Copyright (c) 2018 Josh Bode

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 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@pigeonflight
pigeonflight / deco-to-bootstrap3.xml
Created November 9, 2014 15:17
Transform Deco (Sunburst Theme) Grid to Bootstrap 3 grid #diazo
<replace content="//div[contains(@class,'cell')]/@class">
<xsl:attribute name="class">
<xsl:if test='contains(current(),"width-3:4")'>col-md-9</xsl:if>
<xsl:if test='contains(current(),"width-2:3")'>col-md-8</xsl:if>
<xsl:if test='contains(current(),"width-1:2")'>col-md-6</xsl:if>
<xsl:if test='contains(current(),"width-1:3")'>col-md-4</xsl:if>
<xsl:if test='contains(current(),"width-1:4")'>col-md-3</xsl:if>
<xsl:if test='contains(current(),"width-full")'>col-md-12</xsl:if>
</xsl:attribute>
</replace>
# Autobahn client with auto-reconnect capability
# Totally based on https://github.com/tavendo/AutobahnPython/blob/master/examples/twisted/wamp/beginner/client.py
import sys
from twisted.python import log
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from twisted.internet.protocol import ReconnectingClientFactory
from autobahn.twisted import wamp, websocket
from autobahn.wamp import types
@SEJeff
SEJeff / gist:5797270
Created June 17, 2013 14:24
Forcing splinter to download a file
cls.browser_prefs = {
# Silence the "Unresponsive script" dialogs
"dom.max_chrome_script_run_time": 600,
"dom.max_script_run_time": 600,
"browser.download.folderList": 2,
# We actually download CSV files from search results
# to verify the search functionality works as expected
"browser.download.dir": tempfile.mkdtemp(),
"browser.download.manager.showWhenStarting": False,
"browser.helperApps.neverAsk.saveToDisk": "text/csv,application/csv,text/plain",