Some more scripts

This commit is contained in:
Nemo 2017-01-30 16:16:50 +05:30
parent 375993cdd7
commit f9d9af87cb
2 changed files with 40 additions and 0 deletions

13
github-team-ssh-keys.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
curl -u "$GITHUB_USER:$GITHUB_TOKEN" https://api.github.com/teams/847073/members | jq '.[] | .login' -r > list.txt
rm authorized_keys || true
while read USERID
do
curl https://github.com/$USERID.keys >> authorized_keys
done < list.txt
rm list.txt

27
gnome-keyring-dumper.py Executable file
View File

@ -0,0 +1,27 @@
#! /usr/bin/env python
# this is inspired by https://bitbucket.org/kang/python-keyring-lib/issue/151/how-is-it-possible-to-list-keyrings-keys
import secretstorage
def hackng():
bus = secretstorage.dbus_init()
for keyring in secretstorage.get_all_collections(bus):
for item in keyring.get_all_items():
attr = item.get_attributes()
if attr and 'username_value' in attr:
print('[%s] %s: %s = %s' % (
keyring.get_label(),
item.get_label(),
attr['username_value'],
item.get_secret()
))
else:
print('[%s] %s = %s' % (
keyring.get_label(),
item.get_label(),
item.get_secret()
))
if __name__ == '__main__':
hackng()