summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorroot <root@krebs>2011-09-09 18:20:34 +0200
committerroot <root@krebs>2011-09-09 18:20:34 +0200
commit176c9ac08ad9c2ddc430b2d1a194f6be41115f5b (patch)
tree82ea214ff1d45799099576e4ff007c34a6b7c990 /util
parentdac9eb2553987778500e0bc7e54ad2a28124969d (diff)
parent150ce5757d2982da740bd9ce2b44b57b6d2831c6 (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'util')
-rwxr-xr-xutil/bin/anonbox.net8
-rwxr-xr-xutil/bin/dict.leo.org36
-rwxr-xr-xutil/bin/my-global-ipv4-addr3
-rwxr-xr-xutil/bin/naturalvoices.att4
-rwxr-xr-xutil/bin/translate.google4
5 files changed, 28 insertions, 27 deletions
diff --git a/util/bin/anonbox.net b/util/bin/anonbox.net
index d038cd0a..3b648afb 100755
--- a/util/bin/anonbox.net
+++ b/util/bin/anonbox.net
@@ -13,12 +13,12 @@ GET() {
## retrieve data
eval "$(${GET-GET} |
- sed -rn '
-s^<dd><p>([[:alnum:]@.]+)</p></dd>$\
+ sed -n '
+s^<dd><p>\([[:alnum:]@.]\+\)</p></dd>$\
email="\1" ; p
-s^<dd><p><a href="([^"\\]+)">.*</a></p></dd>$\
+s^<dd><p><a href="\([^"\\]\+\)">.*</a></p></dd>$\
uri="\1/" ; p
-s^<dd><p>([0-9]+)/([0-9]+)/([0-9]+) ([0-9]+):([0-9]+) ([ap]).m.</p></dd>$\
+s^<dd><p>\([0-9]\+\)/\([0-9]\+\)/\([0-9]\+\) \([0-9]\+\):\([0-9]\+\) \([ap]\).m.</p></dd>$\
Y=20\3 ; \
m=\1 ; \
d=\2 ; \
diff --git a/util/bin/dict.leo.org b/util/bin/dict.leo.org
index 6a9d9669..03f16b96 100755
--- a/util/bin/dict.leo.org
+++ b/util/bin/dict.leo.org
@@ -14,7 +14,7 @@ if test -d "$cache_dir" ; then
else
curl --silent "$url"
fi |
-sed 's/>\( *.\)/>\n\1/g' | sed -rn '
+sed 's/>\( *.\)/>\n\1/g' | sed -n '
s/[[:space:]]/ /g
/<!-- # Werbung # -->/,/<\/td>/b
/<!-- ============================================== -->/,/^<\/td>/b
@@ -23,7 +23,7 @@ sed 's/>\( *.\)/>\n\1/g' | sed -rn '
/<div id="divMoreInfo" class="popup">/,/^ <\/table>/b
## show link in rendered version
- s/^<a href="(.*searchLocRelinked.*)">$/&mehr: \1/
+ s/^<a href="\(.*searchLocRelinked.*\)">$/&mehr: \1/
s/^mehr &gt;&gt;//
s/<[Bb][Rr] *\/>/,/g
@@ -36,34 +36,34 @@ sed 's/>\( *.\)/>\n\1/g' | sed -rn '
s/.*/<!--(&)-->/
p
' \
-| w3m -cols 1024 -T text/html -dump | sed -r '
- s/[[:space:]]+/ /g
+| w3m -cols 1024 -T text/html -dump | sed '
+ s/[[:space:]]\+/ /g
s/ ,/,/g
s/^ //;s/ $//
s/[┌┬┐└┴┘├┼┤─]//g
s/ *│ */|/g
s/\[ \]//
s/\[Speichern\] der ausgewa:hlten Wo:rter im Trainer//
- s/^\|\|//;s/\|\| ?$//
-' | sed -rn '
+ s/^||//;s/|| \?$//
+' | sed -n '
/^\[EN-> DE\]/,$b
s/^mehr: /+ /
- s/^ENGLISCH\|\|DEUTSCH ?/= Englisch -> Deutsch/
- s/^\|([0-9]+) (Treffer)\|$/= \1 \2/
- s/^([^|]+)\|\|([^|]+)$/- \1|\2/
+ s/^ENGLISCH||DEUTSCH \?/= Englisch -> Deutsch/
+ s/^|\([0-9]\+\) \(Treffer\)|$/= \1 \2/
+ s/^\([^|]\+\)||\([^|]\+\)$/- \1|\2/
- s/^[^=+#-][^|]+$/## &/
+ s/^[^=+#-][^|]\+$/## &/
p
-' | sed -rn '
+' | sed -n '
/^$/b
- s/ ([?!])/\1/g
- s/([[(]) /\1/g;s/ ([])])/\1/g
+ s/ \([?!]\)/\1/g
+ s/\([[(]\) /\1/g;s/ \([]\)]\)/\1/g
- s/ \([0-9]+ of [0-9]+\) ?//;# TODO
+ s/ ([0-9]\+ of [0-9]\+) \?//;# TODO
#s/^##.*Grundform.*/\n#&/
- /^## .*Grundform.*/,/^##( .*)?/{
+ /^## .*Grundform.*/,/^##\( .*\)\?/{
/##/{/Grundform/!p}
b
}
@@ -71,13 +71,13 @@ sed 's/>\( *.\)/>\n\1/g' | sed -rn '
/^## Informationen /,$b;# TODO
#/^## Beispiele/,$b;# TODO
#/^## Wendungen/,$b;# TODO
- /^\+/b;# TODO
+ /^+/b;# TODO
#/^=/b;# TODO
p
-' | sed -r '
+' | sed '
##
- s/\|(.*)/\n \1/g
+ s/|\(.*\)/\n \1/g
s/^#.*/\n&/
s/##.*Treffer $/\n#&/
diff --git a/util/bin/my-global-ipv4-addr b/util/bin/my-global-ipv4-addr
index 305d3f80..71608a8a 100755
--- a/util/bin/my-global-ipv4-addr
+++ b/util/bin/my-global-ipv4-addr
@@ -8,7 +8,8 @@
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 .
+ sed -n '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
diff --git a/util/bin/naturalvoices.att b/util/bin/naturalvoices.att
index 9a944d8b..07fb6e17 100755
--- a/util/bin/naturalvoices.att
+++ b/util/bin/naturalvoices.att
@@ -24,8 +24,8 @@ done
(cd "$pwd/../.." && git submodule update --init)
{
- for arg; do echo "$arg"; done | sed -rn '
- s/^--(.*=.*)/\1/p;t
+ for arg; do echo "$arg"; done | sed -n '
+ s/^--\(.*=.*\)/\1/p;t
s/.*/text="${text+$text }&"/p;t
'
cat<<EOF
diff --git a/util/bin/translate.google b/util/bin/translate.google
index 1a1be6b6..45da6463 100755
--- a/util/bin/translate.google
+++ b/util/bin/translate.google
@@ -19,8 +19,8 @@ done
(cd "$pwd/../.." && git submodule update --init)
{
- for arg; do echo "$arg"; done | sed -rn '
- s/^--(.*=.*)/\1/p;t
+ for arg; do echo "$arg"; done | sed -n '
+ s/^--\(.*=.*\)/\1/p;t
s/.*/text="${text+$text }&"/p;t
'
cat<<EOF