From e6ae8a00d75d70e19050b3209f59bb05ea685362 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 7 Dec 2012 23:06:17 +0100 Subject: pattern/README -> ENTERPRISE_PATTERN add to pattern : 'litterate programming' and 'Enterprise Expect' --- ENTERPRISE_PATTERN | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 ENTERPRISE_PATTERN diff --git a/ENTERPRISE_PATTERN b/ENTERPRISE_PATTERN new file mode 100644 index 0000000..4e41770 --- /dev/null +++ b/ENTERPRISE_PATTERN @@ -0,0 +1,84 @@ +Enterprise Patterns +================== +Stellt sicher, dass das richtige passiert, egal was gemacht wird + +Enterprise Loop +--------------- + +Enterprise Exception Handling +----------------------------- +ggf ersetzbar durch enterprise loop. + + +Enterprise Installation +----------------------- + +Rebooting +---------- + +Enterprise Einschalter (eon) +---------------------------- +Device that turns something on as soon as possible. + +Supernintendo Pattern +--------------------- + +Enterprise Root +--------------- +scripts which need root access but are called with lower privileges. The Enterprise Root Pattern provides a Solution for this issue by calling the script itself as sudo. + +if test "${nosudo-false}" != true -a `id -u` != 0; then + echo "we're going sudo..." >&2 + exec sudo "$0" "$@" + exit 23 # go to hell +fi + // enterprise ist, wenn ... trotzdem matcht + +Enterprise Shutdown +------------------ +Mittel der Wahl um einen Shutdown zu erzwingen + +Bsp: das Not-Aus in der Maschinensicherheit + +Enterprise Deep Copy +-------------------- +Bsp: var copy = JSON.parse(JSON.stringify(source)) + +Enterprise Thinking +------------------- +Prozess um auf Enterprise Patterns zu kommen + +Bug-Driven Development +--------------------- + +Source-based Documentation / Help +--------------------------------- + + #! /bin/sh + if echo "$*" | grep -q '\(^\| \)-h\( \|$\)'; then + cat "$0" + fi + # [more code] + + +Literate Programming +-------------------- +Omit all the comments. + +Litterate Programming +--------------------- +Write throw-away code and it will become production code + +Enterprise Expect +----------------- +Because you always know what you want, `expect(3)` script code can be replaced +by a `subshell and pipe` pattern : + + + ( echo "$username"; sleep 1; echo "$password"; sleep 1; echo "cp old new" ) | telnet + + +painload example: `//retiolum/bin/announce_pubkey` + + + -- cgit v1.2.3