Last active
April 19, 2020 15:27
-
-
Save MinmoTech/0fbd36a8c852d4cbe62a9b5380740072 to your computer and use it in GitHub Desktop.
Revisions
-
Julius Dehner revised this gist
Apr 19, 2020 . 1 changed file with 9 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,11 +13,15 @@ comment = row[3] name = row[4] grouping = row[5] if url == "http://sn": input = f"""{password} comment: {comment} username: {username}""" else: input = f"""{password} comment: {comment} url: {url} username: {username}""" if username: command = f'echo -e "{input}" | gopass insert Account/{name}/{username}' -
Julius Dehner created this gist
Apr 17, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ #!/usr/bin/env python import csv from itertools import islice import os with open('lastpass_export.csv', newline='') as f: reader = csv.reader(f) for row in islice(reader, 1, None): url = row[0] username = row[1] password = row[2] comment = row[3] name = row[4] grouping = row[5] input = f"""{password} comment: {comment} url: {url} username: {username} line 3""" if username: command = f'echo -e "{input}" | gopass insert Account/{name}/{username}' elif grouping: command = f'echo -e "{input}" | gopass insert Notes/{grouping}/{name}' else: command = f'echo -e "{input}" | gopass insert Notes/{name}' os.system(command)