]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
whole bunch of new snippets
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 2 Feb 2016 16:37:53 +0000 (17:37 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 2 Feb 2016 16:37:53 +0000 (17:37 +0100)
- aws elb snippets
- snippet-mode header
- org mode srcshtable and srcshlist

snippets/eshell-mode/aws-elb-describe-instance-health [new file with mode: 0644]
snippets/eshell-mode/aws-elb-describe-load-balancer [new file with mode: 0644]
snippets/eshell-mode/aws-elb-describe-load-balancer-attributes [new file with mode: 0644]
snippets/eshell-mode/aws-elb-get-list [new file with mode: 0644]
snippets/org-mode.org
snippets/org-mode/listsrcsh [new file with mode: 0644]
snippets/org-mode/results [new file with mode: 0644]
snippets/org-mode/tablesrcsh
snippets/snippet-mode/header [new file with mode: 0644]

diff --git a/snippets/eshell-mode/aws-elb-describe-instance-health b/snippets/eshell-mode/aws-elb-describe-instance-health
new file mode 100644 (file)
index 0000000..12ad403
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-elb-describe-instance-health
+# key: aws-elb-describe-instance-health
+# --
+aws --profile=${1:$$(yas-choose-value '("prod" "test"))} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} elb describe-instance-health --load-balancer-name ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
diff --git a/snippets/eshell-mode/aws-elb-describe-load-balancer b/snippets/eshell-mode/aws-elb-describe-load-balancer
new file mode 100644 (file)
index 0000000..30d1229
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-elb-describe-load-balancer
+# key: aws-elb-describe-load-balancer
+# --
+aws --profile=${1:$$(yas-choose-value '("prod" "test"))} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} elb describe-load-balancers --load-balancer-name ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
diff --git a/snippets/eshell-mode/aws-elb-describe-load-balancer-attributes b/snippets/eshell-mode/aws-elb-describe-load-balancer-attributes
new file mode 100644 (file)
index 0000000..a4921ba
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-elb-describe-load-balancer-attributes
+# key: aws-elb-describe-load-balancer-attributes
+# --
+aws --profile=${1:$$(yas-choose-value '("prod" "test"))} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} elb describe-load-balancer-attributes --load-balancer-name ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
diff --git a/snippets/eshell-mode/aws-elb-get-list b/snippets/eshell-mode/aws-elb-get-list
new file mode 100644 (file)
index 0000000..294ddc9
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-elb-get-list
+# key: aws-elb-get-list
+# --
+aws --profile=${1:$$(yas-choose-value '("prod" "test"))} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} elb describe-load-balancers --query "reverse(sort_by(LoadBalancerDescriptions, &CreatedTime)[].[LoadBalancerName, CreatedTime])" --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
index 36856f04eed63fcfc00d1c202b6a140a43b10261..8f670ddc771a89c8d07aa0826e42899ca8dfcab2 100644 (file)
@@ -3,12 +3,14 @@
 |--------------+-------------+------------------------------------------------------|
 | babel-sh     | babel-shell | skeleton to generate a sh file out of an org file    |
 | blog         | blog        | skeleton for a blog entry                            |
+| results      | :res        | add results parameter. for src block.                |
 | sqlmysql     | sqlmysql    | properties to connect to MySQL via org               |
 | sqlora       | sqlora      | properties to connect to Oracle via org and Perl DBI |
-| <sclient     | srcclient   | SRC snippet executable on a shell session            |
-| <srcsh       | srcsh       | SRC snippet with NAME and lots of parameters         |
-| <srcshtable  | srcshtable  | SRC snippet with org list for HOSTS loop.            |
-| <ssession    | srcsession  | create a shell session and connect to a host via ssh |
+| srcclient    | <sclient    | SRC snippet executable on a shell session            |
+| srcsh        | <srcsh      | SRC snippet with NAME and lots of parameters         |
+| srcshtable   | <srcshtable | SRC snippet with org table for HOSTS loop.           |
+| srcshlist    | <srcshlist  | SRC snippet with org list for HOSTS loop.            |
+| srcsession   | <ssession   | create a shell session and connect to a host via ssh |
 | table2       | table2      | create org table with name and Amount Summary        |
 | title        | title       | skeleton for TITLE                                   |
 |--------------+-------------+------------------------------------------------------|
diff --git a/snippets/org-mode/listsrcsh b/snippets/org-mode/listsrcsh
new file mode 100644 (file)
index 0000000..da59eaa
--- /dev/null
@@ -0,0 +1,17 @@
+# -*- mode: snippet -*-
+# name: listsrcsh
+# key: <srcshlist
+# If you want to reference the output in other src blocks you need a name.
+# --
+#+NAME: ${1:`(replace-regexp-in-string "[: ]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil nil nil t))))`}
+- $0
+
+${2:#+NAME: ${3:`(replace-regexp-in-string "[: ]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil nil nil t))))`-src}}
+#+BEGIN_SRC sh ${4::session ${5:client}} :var HOSTS=$1 :cache ${6:$$(yas-choose-value '("yes" "no"))} :results ${7:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
+  for i in \$\{HOSTS\}; do
+    echo "----------------------------------------"
+    echo \$\{i\}
+    echo "----------------------------------------"
+    ssh -x \$\{i\}
+  done
+#+END_SRC
diff --git a/snippets/org-mode/results b/snippets/org-mode/results
new file mode 100644 (file)
index 0000000..d216df9
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- mode: snippet -*-
+# name: results
+# key: :res
+# add results parameter to src block
+# --
+:results ${1:$$(yas-choose-value '("verbatim drawer" "table" "list" "silent"))} $0
\ No newline at end of file
index 5c6e149e6cf99d1d12bd7812e625f80ec001dbbb..5fc068f2bd9eb2589d277b46667a5dc0b471710c 100644 (file)
@@ -4,14 +4,14 @@
 # If you want to reference the output in other src blocks you need a name.
 # --
 #+NAME: ${1:`(replace-regexp-in-string "[: ]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil nil nil t))))`}
-- $0
+| $0 |
 
 ${2:#+NAME: ${3:`(replace-regexp-in-string "[: ]" "_" (replace-regexp-in-string "[][]" "" (replace-regexp-in-string ".*/" "" (org-display-outline-path nil nil nil t))))`-src}}
-#+BEGIN_SRC sh ${4::session ${5:client}} :var HOSTS=$1 :cache ${6:$$(yas-choose-value '("yes" "no"))} :results ${7:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
+#+BEGIN_SRC sh ${4::session ${5:client}} :var HOSTS=$1[,0] :cache ${6:$$(yas-choose-value '("yes" "no"))} :results ${7:$$(yas-choose-value '("verbatim drawer" "table" "list"))}
   for i in \$\{HOSTS\}; do
     echo "----------------------------------------"
     echo \$\{i\}
-
     echo "----------------------------------------"
+    ssh -x \$\{i\}
   done
 #+END_SRC
diff --git a/snippets/snippet-mode/header b/snippets/snippet-mode/header
new file mode 100644 (file)
index 0000000..8600ec2
--- /dev/null
@@ -0,0 +1,9 @@
+# -*- mode: snippet -*-
+# name: header
+# key: <header
+# --
+# -*- mode: snippet -*-
+# name: ${1:`(insert (buffer-name))`}
+# key: ${2:`(insert (buffer-name))`}
+# --
+$0
\ No newline at end of file