From 718fcb70fa813422496cb5322b5532d3f4f6df52 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/bin') 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 604b6d64312a7ca711a3fdd1b5863984953e2fc8 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/bin') 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/bin') 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/bin') 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