From 9190cd774aa62d028f13d6ea1633994f6c3a0465 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 19 Jul 2011 16:42:05 +0200 Subject: util make-data-url: initial commit NAME make-data-url - create a "data" URL scheme item SYNOPSIS make-data-url [file...] DESCRIPTION The make-data-url is a best efforts generator of "data" URL scheme compatible items as described by RFC 2397. Each file is read, analyzed, and printed as single-lined "data" URL to stdout. OPERANDS The following operands shall be supported: file A pathname of a file. The content of each file is printed as single-lined "data" URL to the standard output. The mime-type of the file's content gets guessed by the file utility. STDIN None INPUT FILES Input files can be any file type. ENVIRONMENT VARIABLES The following environment variables shall affect the execution of make-data-url: None. ASYNCHRONOUS EVENTS Default. STDOUT Each line shall contain a "data" URL item for the respective file operand. STDERR The standard error shall be used only for diagnostic messages. OUTPUT FILES None. EXTENDED DESCRIPTION None. EXIT STATUS The following exit values shall be returned: 0 The program has terminated. CONSEQUENCES OF ERRORS Default. The following sections are informative APPLICATION USAGE Default. EXAMPLES Test your backup scheme: sudo rm -fR /home RATIONALE None. FUTURE DIRECTIONS None. SEE ALSO RFC 2397, file BUGS None, this is enterprise-grade software and behaves exactly as specified. AUTHOR KREBS COPYTIGHT Copytight (c) 2011, KREBS. This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. COPYRIGHT Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operatingg Systems Interface (POSIX), The Open Group Base Specification Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Deal with it! --- util/bin/make-data-uri | 7 +++++++ util/bin/make-data-url | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100755 util/bin/make-data-uri create mode 100755 util/bin/make-data-url (limited to 'util') diff --git a/util/bin/make-data-uri b/util/bin/make-data-uri new file mode 100755 index 00000000..a9d014e6 --- /dev/null +++ b/util/bin/make-data-uri @@ -0,0 +1,7 @@ +#! /bin/sh +set -euf +for path; do + type="`file -bi "$path"`" + data="`base64 -w 0 "$path"`" + echo "data:$type;base64,$data" +done diff --git a/util/bin/make-data-url b/util/bin/make-data-url new file mode 100755 index 00000000..a9d014e6 --- /dev/null +++ b/util/bin/make-data-url @@ -0,0 +1,7 @@ +#! /bin/sh +set -euf +for path; do + type="`file -bi "$path"`" + data="`base64 -w 0 "$path"`" + echo "data:$type;base64,$data" +done -- cgit v1.2.3 From e1abfa2bbe5fcc2c893d36153ed421a30ee8d07e Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 20 Jul 2011 22:40:22 +0200 Subject: util krebsdate: initial commit --- util/bin/krebdate | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 util/bin/krebdate (limited to 'util') diff --git a/util/bin/krebdate b/util/bin/krebdate new file mode 100755 index 00000000..b2aa02d2 --- /dev/null +++ b/util/bin/krebdate @@ -0,0 +1,10 @@ +#! /bin/sh +set -euf + +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 + +date --date="`ssh krebs 'date --rfc-3339=s'`" -- cgit v1.2.3 From aeb24e9e3ba4591e86beaa20b1c18a06786bda73 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 20 Jul 2011 22:49:15 +0200 Subject: util make-data-uri: rm legacy code --- util/bin/make-data-uri | 7 ------- 1 file changed, 7 deletions(-) delete mode 100755 util/bin/make-data-uri (limited to 'util') diff --git a/util/bin/make-data-uri b/util/bin/make-data-uri deleted file mode 100755 index a9d014e6..00000000 --- a/util/bin/make-data-uri +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh -set -euf -for path; do - type="`file -bi "$path"`" - data="`base64 -w 0 "$path"`" - echo "data:$type;base64,$data" -done -- cgit v1.2.3 From 7b24979bf77a319a827bb3f92298002b2942c315 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 22 Jul 2011 11:48:08 +0200 Subject: util google.suggest: initial import --- util/bin/google.suggest | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 util/bin/google.suggest (limited to 'util') diff --git a/util/bin/google.suggest b/util/bin/google.suggest new file mode 100755 index 00000000..9bde17dc --- /dev/null +++ b/util/bin/google.suggest @@ -0,0 +1,8 @@ +#! /bin/sh + +uri="http://google.com/complete/search?output=json&q=$*" + +curl -sS "$uri" | sed -n ' + s:^window.google.ac.h(\|)$::gp +' +echo -- cgit v1.2.3 From 18a2123b50d5e71da251b5ee2902608fba7ef935 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 24 Jul 2011 20:15:22 +0200 Subject: rm kvutils and move anonbox.net to proper place --- util/bin/anonbox.net | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 util/bin/anonbox.net (limited to 'util') diff --git a/util/bin/anonbox.net b/util/bin/anonbox.net new file mode 100755 index 00000000..d038cd0a --- /dev/null +++ b/util/bin/anonbox.net @@ -0,0 +1,57 @@ +#! /bin/bash +#### anonbox.net [--check] +#### anonbox account creator +set -euf + +## +script_begin_date="`date --rfc-3339=ns`" + +## +GET() { + wget --quiet --no-check-certificate -O- https://anonbox.net/en/ +} + +## retrieve data +eval "$(${GET-GET} | + sed -rn ' +s^

([[:alnum:]@.]+)

$\ + email="\1" ; p +s^

.*

$\ + uri="\1/" ; p +s^

([0-9]+)/([0-9]+)/([0-9]+) ([0-9]+):([0-9]+) ([ap]).m.

$\ + Y=20\3 ; \ + m=\1 ; \ + d=\2 ; \ + H=\4 ; \ + M=\5 ; \ + p=\6 ; p')" + +## make best-before-date RFC-3339-(seconds)-conform +case "$p" in + p) H="`echo $H+12 | bc`" ;; +esac +s=00 +z=+02:00 +best_before="$Y-$m-$d $H:$M$z" + +## +script_end_date="`date --rfc-3339=ns`" + +## +for key in email uri best_before script_begin_date script_end_date ; do + eval "val=\"\$$key\"" + echo "$key=\"$val\"" +done + +## +if echo "$*" | tr "$IFS" ' ' | egrep -q "(^| )--check( |$)"; then + file="/tmp/save-$email" + echo "file=\"$file\"" + echo >&2 + echo "# downloading email..." >&2 + while ! curl -ksS "$uri" | tee "$file" | grep .; do + sleep 10 + done +fi + +#### end of file. -- cgit v1.2.3 From 4376866fcab70eb27d3c07d268bec0fe9bfad6f1 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 30 Jul 2011 12:43:57 +0200 Subject: my-global-ipv4-addr: initial commit --- util/bin/my-global-ipv4-addr | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 util/bin/my-global-ipv4-addr (limited to 'util') diff --git a/util/bin/my-global-ipv4-addr b/util/bin/my-global-ipv4-addr new file mode 100755 index 00000000..305d3f80 --- /dev/null +++ b/util/bin/my-global-ipv4-addr @@ -0,0 +1,51 @@ +#! /bin/sh +# +# usage: my-global-ipv4-addr [URL] +# +# if URL is provided then fetch and parse it for IPv4 addrs +# else try all known urls +# +if test $# = 1; then + has() { type "$1" 1>/dev/null 2>/dev/null; } + parse() { + sed -rn 's/.*((1?[0-9][0-9]|2[0-5][0-9])\.(1?[0-9][0-9]|2[0-5][0-9])\.(1?[0-9][0-9]|2[0-5][0-9])\.(1?[0-9][0-9]|2[0-5][0-9])).*/\1/p' | grep . + } + get () { + # TODO get random valid user agent + if has curl; then + curl -m 1 -A Mozilla -sS "$1" 2>/dev/null + elif has wget; then + wget -T 1 -U Mozilla -O "$1" 2>/dev/null + else + echo 'Error 1: You are made of stupid!' >&2 + exit 23 + fi + } + + #addrs="`get "$1" | parse`" + #echo "$1:" $addrs >&2 + #echo "$addrs" + get "$1" | parse +else + + vote() { + sort | uniq -c | sort -r -n + } + winner() { + head -n 1 | awk '{print$2}' + } + + grep -v ^# | + sed -n '1,$p' | + xargs -P 42 -n 1 "$0" | vote | winner +fi< Date: Sun, 31 Jul 2011 01:17:28 +0200 Subject: randline: initial commit --- util/bin/randline | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 util/bin/randline (limited to 'util') diff --git a/util/bin/randline b/util/bin/randline new file mode 100755 index 00000000..cd9476e7 --- /dev/null +++ b/util/bin/randline @@ -0,0 +1,12 @@ +#! /bin/sh +# +# choose a line randomly. +# +set -euf + +lines="`cat`" +count=`echo "$lines" | wc -l` +random=`od -An -t u8 -N 8 /dev/urandom` +choice=`echo "$random % $count + 1" | bc` + +echo "$lines" | sed -n "${choice}p" -- cgit v1.2.3 From 7f5321696a2d6f3b8292ab3246f2374ba0334725 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 31 Jul 2011 02:16:15 +0200 Subject: randline: reimplemented --- util/bin/randline | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'util') diff --git a/util/bin/randline b/util/bin/randline index cd9476e7..75618664 100755 --- a/util/bin/randline +++ b/util/bin/randline @@ -1,12 +1,5 @@ #! /bin/sh -# -# choose a line randomly. -# -set -euf +# Author: tv,makefu +# Info: for old version see commit b9924 -lines="`cat`" -count=`echo "$lines" | wc -l` -random=`od -An -t u8 -N 8 /dev/urandom` -choice=`echo "$random % $count + 1" | bc` - -echo "$lines" | sed -n "${choice}p" +cat | shuf | head -n 1 -- cgit v1.2.3 From 5982f10c45d2deace34a4bc236475bea61638480 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 31 Jul 2011 02:16:15 +0200 Subject: randline: reimplemented --- util/bin/randline | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'util') diff --git a/util/bin/randline b/util/bin/randline index cd9476e7..051734c5 100755 --- a/util/bin/randline +++ b/util/bin/randline @@ -1,12 +1,3 @@ #! /bin/sh -# -# choose a line randomly. -# -set -euf -lines="`cat`" -count=`echo "$lines" | wc -l` -random=`od -An -t u8 -N 8 /dev/urandom` -choice=`echo "$random % $count + 1" | bc` - -echo "$lines" | sed -n "${choice}p" +cat | shuf | head -n 1 -- cgit v1.2.3 From 727cf3bbc6bfc08472fc6e0b3784d931ba3391f6 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 31 Jul 2011 02:33:49 +0200 Subject: translate.google: initial commit --- util/bin/translate.google | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 util/bin/translate.google (limited to 'util') diff --git a/util/bin/translate.google b/util/bin/translate.google new file mode 100755 index 00000000..50d37cc3 --- /dev/null +++ b/util/bin/translate.google @@ -0,0 +1,29 @@ +#! /bin/sh +set -euf + +A=Mozilla +url=http://translate.google.com/ + +{ + for arg; do echo "$arg"; done | sed -rn ' + s/^--(.*=.*)/\1/p;t + s/.*/text="${text+$text }&"/p;t + ' + cat< Date: Sun, 31 Jul 2011 02:36:09 +0200 Subject: translate.google: esnure query is ready --- util/bin/translate.google | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/bin/translate.google b/util/bin/translate.google index 50d37cc3..56cd7ee0 100755 --- a/util/bin/translate.google +++ b/util/bin/translate.google @@ -4,6 +4,11 @@ set -euf A=Mozilla url=http://translate.google.com/ +pwd="$(dirname "$(readlink -f "$0")")" + +# ensure query is ready +(cd "$pwd/../.." && git submodule update --init) + { for arg; do echo "$arg"; done | sed -rn ' s/^--(.*=.*)/\1/p;t @@ -11,7 +16,7 @@ url=http://translate.google.com/ ' cat< Date: Sun, 31 Jul 2011 03:22:00 +0200 Subject: translate.google: add all the submodules --- util/bin/translate.google | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/bin/translate.google b/util/bin/translate.google index 56cd7ee0..943675f4 100755 --- a/util/bin/translate.google +++ b/util/bin/translate.google @@ -6,6 +6,15 @@ url=http://translate.google.com/ pwd="$(dirname "$(readlink -f "$0")")" +for x in \ + "$pwd/../../submodules/github/tmpvar" \ + "$pwd/../../submodules/github/mikeal" \ + "$pwd/../../submodules/github/NV" \ + "$pwd/../../submodules/github/tautologistics" \ +; do + export NODE_PATH="`readlink -f "$x"`${NODE_PATH+:$NODE_PATH}" +done + # ensure query is ready (cd "$pwd/../.." && git submodule update --init) @@ -22,7 +31,6 @@ pwd="$(dirname "$(readlink -f "$0")")" -d "js=\${js-n}" \\ -d "prev=\${prev-_t}" \\ -d "hl=\${hl-en}" \\ - -d "ie=\${ie-UTF-8}" \\ -d "layout=\${layout-2}" \\ -d "eotf=\${eotf-1}" \\ -d "sl=\${sl-auto}" \\ -- cgit v1.2.3 From b67f8696e3f071522347206240300059e3bb9081 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 31 Jul 2011 04:16:20 +0200 Subject: translate.google: fix encoding --- util/bin/translate.google | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util') diff --git a/util/bin/translate.google b/util/bin/translate.google index 943675f4..1a1be6b6 100755 --- a/util/bin/translate.google +++ b/util/bin/translate.google @@ -33,6 +33,8 @@ done -d "hl=\${hl-en}" \\ -d "layout=\${layout-2}" \\ -d "eotf=\${eotf-1}" \\ + -d "ie=UTF-8" \\ + -d "oe=UTF-8" \\ -d "sl=\${sl-auto}" \\ -d "tl=\${tl-en}" \\ -d "text=\$text" \\ -- cgit v1.2.3 From eb463764aee76992bdbfa9e82c1fcd2e1ef6465f Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 5 Aug 2011 01:59:42 +0200 Subject: naturalvoices.att: initial commit --- util/bin/naturalvoices.att | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 util/bin/naturalvoices.att (limited to 'util') diff --git a/util/bin/naturalvoices.att b/util/bin/naturalvoices.att new file mode 100755 index 00000000..e329694f --- /dev/null +++ b/util/bin/naturalvoices.att @@ -0,0 +1,40 @@ +#! /bin/sh +set -euf + +A=Mozilla +baseURL="http://192.20.225.36" +url="$baseURL/tts/cgi-bin/nph-talk" + +pwd="$(dirname "$(readlink -f "$0")")" + +for x in \ + "$pwd/../../submodules/github/tmpvar" \ + "$pwd/../../submodules/github/mikeal" \ + "$pwd/../../submodules/github/NV" \ + "$pwd/../../submodules/github/tautologistics" \ +; do + export NODE_PATH="`readlink -f "$x"`${NODE_PATH+:$NODE_PATH}" +done + +# ensure query is ready +(cd "$pwd/../.." && git submodule update --init) + +{ + for arg; do echo "$arg"; done | sed -rn ' + s/^--(.*=.*)/\1/p;t + s/.*/text="${text+$text }&"/p;t + ' + cat< Date: Fri, 5 Aug 2011 21:20:13 +0200 Subject: wiki.firstpar: initial commit of galileo --- util/bin/wiki.firstpar | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 util/bin/wiki.firstpar (limited to 'util') diff --git a/util/bin/wiki.firstpar b/util/bin/wiki.firstpar new file mode 100755 index 00000000..df66f707 --- /dev/null +++ b/util/bin/wiki.firstpar @@ -0,0 +1,23 @@ +#! /bin/sh +set -euf + +A=Mozilla + +pwd="$(dirname "$(readlink -f "$0")")" + +for x in \ + "$pwd/../../submodules/github/tmpvar" \ + "$pwd/../../submodules/github/mikeal" \ + "$pwd/../../submodules/github/NV" \ + "$pwd/../../submodules/github/tautologistics" \ +; do + export NODE_PATH="`readlink -f "$x"`${NODE_PATH+:$NODE_PATH}" +done + +# ensure query is ready +#(cd "$pwd/../.." && git submodule update --init) + +query() { + node "$(readlink -f "$pwd/../../submodules/github/visionmedia/query")" "$@" +} +curl -sS -A "\${A-Mozilla}" "$1" | query 'p' 'first' | w3m -T text/html -dump -- cgit v1.2.3 From 7f431c4e2ae9aa14bb599b903d7e7b87aa239f56 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 5 Aug 2011 22:20:32 +0200 Subject: added galileo --- util/bin/galileo | 2 ++ util/bin/wiki.firstpar | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100755 util/bin/galileo (limited to 'util') diff --git a/util/bin/galileo b/util/bin/galileo new file mode 100755 index 00000000..8ca7d834 --- /dev/null +++ b/util/bin/galileo @@ -0,0 +1,2 @@ +#!/bin/sh +./wiki.firstpar http://de.m.wikipedia.org/wiki/::Random | xargs ./naturalvoices.att diff --git a/util/bin/wiki.firstpar b/util/bin/wiki.firstpar index df66f707..d2181f1b 100755 --- a/util/bin/wiki.firstpar +++ b/util/bin/wiki.firstpar @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash set -euf A=Mozilla @@ -15,9 +15,9 @@ for x in \ done # ensure query is ready -#(cd "$pwd/../.." && git submodule update --init) +(cd "$pwd/../.." && git submodule update --init) query() { node "$(readlink -f "$pwd/../../submodules/github/visionmedia/query")" "$@" } -curl -sS -A "\${A-Mozilla}" "$1" | query 'p' 'first' | w3m -T text/html -dump +curl -b redirect=seen -L -e http://de.wikipedia.org/wiki/$RANDOM -sS -A "\${A-Mozilla}" "$1" | query 'p' 'first' |w3m -T text/html -dump| cut -c -750 -- cgit v1.2.3 From d492547e762353c9b75cc9c0b7aca6f049695ef2 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 5 Aug 2011 23:57:18 +0200 Subject: util wikipedia: from DNS --- util/bin/wikipedia | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 util/bin/wikipedia (limited to 'util') diff --git a/util/bin/wikipedia b/util/bin/wikipedia new file mode 100755 index 00000000..cad0d8b1 --- /dev/null +++ b/util/bin/wikipedia @@ -0,0 +1,5 @@ +#! /bin/sh +set -euf +for w in "$@"; do + dig +short txt "$w.wp.dg.cx" +done -- cgit v1.2.3 From c22ae34b0183f63d2f319ff6a0b071efe73550c2 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 6 Aug 2011 00:05:05 +0200 Subject: util naturalvoices: enable symlink calls --- util/bin/naturalvoices.att | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') diff --git a/util/bin/naturalvoices.att b/util/bin/naturalvoices.att index e329694f..656a2c5e 100755 --- a/util/bin/naturalvoices.att +++ b/util/bin/naturalvoices.att @@ -29,7 +29,7 @@ done node "$(readlink -f "$pwd/../../submodules/github/visionmedia/query")" "\$@" } curl -sS -A "\${A-Mozilla}" \\ - -d "voice=\${voice-klara}" \\ + -d "voice=\${voice-`basename "$0"`}" \\ -d "txt=\$text" \\ -d "downloadButton=DOWNLOAD" \\ "$url" | -- cgit v1.2.3 From a22a7f66b99d76134b35d14a0ee96eea4b294400 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 6 Aug 2011 00:14:09 +0200 Subject: util naturalvoices: enable symlink calls --- util/bin/naturalvoices.att | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util') diff --git a/util/bin/naturalvoices.att b/util/bin/naturalvoices.att index e329694f..7955db63 100755 --- a/util/bin/naturalvoices.att +++ b/util/bin/naturalvoices.att @@ -5,6 +5,10 @@ A=Mozilla baseURL="http://192.20.225.36" url="$baseURL/tts/cgi-bin/nph-talk" +if test -h "$0"; then + voice="${voice-"`basename "$0"`"}" +fi + pwd="$(dirname "$(readlink -f "$0")")" for x in \ -- cgit v1.2.3 From c0230d4be08c6696365239e15efee82742cba25f Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 6 Aug 2011 20:08:33 +0200 Subject: util/bin/galileo: compliance to changed tts-behavior --- util/bin/galileo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/bin/galileo b/util/bin/galileo index 8ca7d834..854f1302 100755 --- a/util/bin/galileo +++ b/util/bin/galileo @@ -1,2 +1,3 @@ #!/bin/sh -./wiki.firstpar http://de.m.wikipedia.org/wiki/::Random | xargs ./naturalvoices.att +export voice=klara +./wiki.firstpar http://de.m.wikipedia.org/wiki/::Random | xargs ./naturalvoices.att -- cgit v1.2.3 From 28955fc830e526c0d49fbd299ba5500932d556ae Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 11 Aug 2011 01:22:53 +0200 Subject: util/auto/krebs: initial commit the auto/krebs utility is a tool to easily deploy the krebscode/painload on every machine. it will utilize the punani packet manager of krebs in order to install all the packets you want e.g. retiolum to join the 42::/16 network. The packet manager will use god mode in order to work correctly. --- util/auto/krebs | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 util/auto/krebs (limited to 'util') diff --git a/util/auto/krebs b/util/auto/krebs new file mode 100644 index 00000000..33b33668 --- /dev/null +++ b/util/auto/krebs @@ -0,0 +1,59 @@ +#! /bin/sh +# krebs autoinstall script +set -euf +# see punanin docs + +function bailout() +{ + exit 1 +} +function punani() +{ + return 0 +} + +function generate_config() +{ + # $1 - + [ -e $1 ] && exit 0 + cat >$1 < Date: Fri, 12 Aug 2011 19:21:10 +0200 Subject: auto/krebs: finish auto script krebscode now auto-installable via curl | sh --- util/auto/krebs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util') diff --git a/util/auto/krebs b/util/auto/krebs index 33b33668..eb6c25a8 100644 --- a/util/auto/krebs +++ b/util/auto/krebs @@ -50,6 +50,8 @@ function edit_config() rm $CONF printf "I hate you by the way..." bailout + fi + make -C $1 } punani -Ei git make KREBSDIR=${1-/krebs} -- cgit v1.2.3 From 113d54f5243f68be7620b22b5651400d07af36d2 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 30 Aug 2011 12:37:14 +0200 Subject: util hrefs: initial commit The hrefs util extracts hrefs from html-stdin... we could use query for this kind of extraction but hrefs is older and works already as fast as light.. not^_^ --- util/bin/hrefs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 util/bin/hrefs (limited to 'util') diff --git a/util/bin/hrefs b/util/bin/hrefs new file mode 100755 index 00000000..3a1a51de --- /dev/null +++ b/util/bin/hrefs @@ -0,0 +1,20 @@ +#! /bin/sh + +_hrefs() { + sed -n 's/href="\([^"]\+\)"/\n&\n/gp' | + sed -n 's/^href="\([^"]\+\)"$/\1/p'; } + +_add_prefix_to_relative_hrefs() { + sed '/^http:/!s^'"$1"''; } + +_main() { + case $# in + (0) _hrefs;; + (1) _hrefs | _add_prefix_to_relative_hrefs "$1";; + (*) + echo "bad command line: $0 $*" >&2; exit 23;; + esac; } + +set -euf +_main "$@" +#### end of file. -- cgit v1.2.3