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
# Sample CFEngine usage of the `ips` module. | |
# | |
# You should get something like the following: | |
# | |
# $ cf-agent -I -f ./TEST.cf -K | |
# 2014-01-31T16:43:01+0100 info: Executing 'no timeout' ... 'ips' | |
# 2014-01-31T16:43:01+0100 info: Completed execution of 'ips' | |
# 2014-01-31T16:43:01+0100 notice: R: Running a test | |
# 2014-01-31T16:43:01+0100 notice: R: Interface `lo` NOT detected, as it's not UP | |
# 2014-01-31T16:43:01+0100 notice: R: Interface `wlan0` detected UP |
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
Example processing using the `j2pp` preprocessor; | |
see: http://github.com/uzh/j2pp | |
Domain name: {{sys.domain}} | |
L2 addresses (list): | |
{% for hwaddr in sys.hardware_addresses -%} | |
* {{ hwaddr }} | |
{% endfor %} |
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 re | |
from markdown2 import markdown | |
link_patterns = [ | |
# issueNNN --> /help/issueNNN | |
(re.compile(r'\b(issue)\s*(\d+)\b'), r'/help/\g<1>\g<2>'), |
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
body common control | |
{ | |
inputs => { | |
"lib/cfengine_stdlib.cf", | |
}; | |
bundlesequence => { "test" }; | |
} | |
bundle agent test |
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
(de qq Args | |
(if (== Args NIL) | |
# `() -> NIL | |
NIL | |
# else, Args is a single-element list, extract body forms | |
(setq Body (car Args)) | |
(if (not (lst? Body)) | |
# `atom -> atom | |
Body | |
# else Body is a list that we must unpack |
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
#! /bin/sh | |
# | |
# Install Ansible on a Ubuntu LTS machine. | |
# | |
set -ex | |
export LC_ALL=C | |
sudo apt-get update |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
diff --git a/components/9990-select-eth-device.sh b/components/9990-select-eth-device.sh | |
index df00666..6bc67fd 100755 | |
--- a/components/9990-select-eth-device.sh | |
+++ b/components/9990-select-eth-device.sh | |
@@ -55,11 +55,22 @@ Select_eth_device () | |
case "${ARGUMENT}" in | |
live-netdev=*) | |
NETDEV="${ARGUMENT#live-netdev=}" | |
+ # net device could be specified by MAC address | |
+ hex="[0-9A-Fa-f][0-9A-Fa-f]" |
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 | |
# -*- encoding: utf-8 -*- | |
# | |
""" | |
Two simple functions for rendering a Unicode string using ASCII | |
characters only. | |
The only sensible applications are on words in a Latin-derived | |
alphabet (i.e., anything that could be rendered in a ISO-8859-* | |
character set); anything else will just be replaced by a string of |
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
(defun wrap-region-in (start-text end-text) | |
"Insert START-TEXT at the beginning of the currently active | |
region, and END-TEXT at the end of it." | |
(let ((start (min (point) (mark))) | |
(end (max (point) (mark)))) | |
(save-excursion | |
(goto-char end) | |
(insert end-text) | |
(goto-char start) | |
(insert start-text)))) |
OlderNewer