Jump to content

JaredWilliams

Member
  • Content Count

    6
  • Joined

  • Last visited

About JaredWilliams

  • Rank
    Newbie
  • Birthday June 25

Contact Methods

  • Website URL
    http://jared.nyc

Profile Information

  • Location
    New York City
  1. I work a lot in the terminal and a lot of other programs. I use 1password and it doesn't save the password. But there has been stuff I've copied from safari like API keys and passwords. etc. so it helps to have a way to remove it. and since its SQLite and I've tested this for a couple hours now, doesn't affect Alfred in any negative way.
  2. just tried doing sqlite3 clipboard.alfdb and that worked So I wrote this quick update statement anyone in the future might want to use Steps: 1. Open the DB by doing: sqlite3 "~/Library/Application Support/Alfred 3/Databases/clipboard.alfdb" 2. If you want to see how many times your password, or sensitive data, is in the clipboard run this query (replace where it says YOURPASSWORD with your password or any sensitive data): SELECT COUNT(item) FROM clipboard WHERE item LIKE '%YOURPASSWORD%'; 3. Run this query (replace where it says YOURPASSWORD with your password or any sensitive data you want to remove like APIKeys, etc): UPDATE clipboard SET item = replace( item, 'YOURPASSWORD', 'PasswordRemoved') WHERE item LIKE '%YOURPASSWORD%'; 4. Run the SELECT from step 2 again And heres a quick script i wrote that you can run whenever. Change where it says 'PasswordToRemove' to your password. Also you can pass data to the script as a parameter, however, if that parameter is missing it just defaults to whatever text you have as 'PasswordToRemove' #!/bin/bash DInput=$1 YourPassword="PasswordToRemove" StringToRemove="${DInput:-$YourPassword}" COUNT=$(sqlite3 "~/Library/Application Support/Alfred 3/Databases/clipboard.alfdb" "SELECT COUNT(item) FROM clipboard WHERE item LIKE '%$StringToRemove%';") sqlite3 "~/Library/Application Support/Alfred 3/Databases/clipboard.alfdb" "UPDATE clipboard SET item = replace( item, '$StringToRemove', 'PasswordRemoved') WHERE item LIKE '%$StringToRemove%';" POSTCOUNT=$(sqlite3 "~/Library/Application Support/Alfred 3/Databases/clipboard.alfdb" "SELECT COUNT(item) FROM clipboard WHERE item LIKE '%$StringToRemove%';") echo "Sensitive Data Count: $COUNT" echo "Removing Sensitive Data....." echo "Count after Scrubbing: $POSTCOUNT" So you can run /usr/local/bin/AlfredDataScrubber and it will replace the string 'PasswordToRemove' with 'PasswordRemoved' or you can run /usr/local/bin/AlfredDataScrubber "LongAPIKey" and it will replace the string 'LongAPIKey' with 'PasswordRemoved'
  3. Is there any way to open the clipboard.alfdb in any terminal program so that I can remove sensitive data and replace it with something like "PASSWORDREMOVED" without corrupting the data file? Is it in any certain data format? Like if it was SQLite I could make the changes through there I know you can do function-backspace to remove entries from the clipboard, however, i just want to remove the sensitive data not the whole line from the clipboard. Thank you, Jared https://jared.nyc https://devopschat.co
  4. Hey, couldn't find a github link but i made some changes to the file for ZSH. if someone wants to be able to use this with ZSH just replace the file term_hist.py with this: #!/usr/bin/env python # -*- coding: utf-8 -*- import sys import unicodedata import codecs from os.path import expanduser from workflow import Workflow, ICON_WEB, web, ICON_WARNING def main(wf): """Execute the query on bash_history and return results """ args = wf.args query = " ".join(args) home = expanduser("~") results = [] with codecs.open(home+"/.zsh_history", "r", encoding='ISO-8859-2') as f: searchlines = reversed(f.readlines()) for i, line in enumerate(searchlines): if query in line: histstart = line.encode("utf-8","ignore").partition(":0;") results.append(histstart[2]) for i in range(len(results)): wf.add_item(results[i], subtitle="", arg = results[i], valid=True, icon="icon.png") wf.send_feedback() return 0 if __name__ == u"__main__": wf = Workflow() sys.exit(wf.run(main))
  5. Im a heavy user, i also worked at AWS. Im going to check this out today! Thanks
×
×
  • Create New...