summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/common/askpass8
-rwxr-xr-xbin/common/gt4
-rwxr-xr-xbin/extra/myalscore.sh3
3 files changed, 10 insertions, 5 deletions
diff --git a/bin/common/askpass b/bin/common/askpass
index 2725dbf..c7d2249 100755
--- a/bin/common/askpass
+++ b/bin/common/askpass
@@ -3,11 +3,15 @@
# We can figure out the password for the key based on $1
# which is in the following form:
# Enter passphrase for key 'path/to/key':
-# The point is to retrieve the path and use the final name of the key
-# find the according password.
+# The point is to retrieve the path where the filename is the name of
+# the key.
+# Then we can construct the path for pass and get the password.
key="$(printf '%s\n' "$1" |
cut -f 2 -d \' |
awk -F '/' '{print $NF}')"
pass="keys/$(hostname)/ssh/$key"
+# optional: add key to running ssh-agent
+keyadd "$key" &
+
pass show "$pass" | head -n 1
diff --git a/bin/common/gt b/bin/common/gt
index c679b23..ceb58a8 100755
--- a/bin/common/gt
+++ b/bin/common/gt
@@ -15,10 +15,10 @@ help() {
usage: gt [OPTION]
-a PATH add repo
-s update and show status of each repo
--c COMMAND run 'git COMMAND' in each repo
+-c COMMAND run 'git COMMAND' in each repo
-h show this help
-l list repos
--e edit repos in $EDITOR
+-e edit repos in \$EDITOR
EOF
}
diff --git a/bin/extra/myalscore.sh b/bin/extra/myalscore.sh
index ef68bcc..e2b4e25 100755
--- a/bin/extra/myalscore.sh
+++ b/bin/extra/myalscore.sh
@@ -4,4 +4,5 @@
query="$(printf '%s' "$*" | sed 's/\s/%20/g')"
curl -s "https://myanimelist.net/search/prefix.json?type=all&keyword=$query&v=1" \
-H 'Accept: application/json, text/javascript, */*; q=0.01' |
- jq -r '.categories[].items[] | [.payload.score, .name] | join(" ")'
+ jq -r '.categories[].items[] | "\(.payload.score)@\(.name)@\(.url)"' |
+ column -t -l 3 -s '@'