Skip to content

Instantly share code, notes, and snippets.

@jth0
jth0 / op-cleanup.py
Created April 27, 2023 16:11
Process JSON output from 1Password CLI to rename imported vaults, grant admins manage access, and delete old vaults.
#!/opt/homebrew/bin/python3
# Process JSON output from 1Password CLI to rename imported vaults, grant admins manage access, and delete old vaults.
# run `op signin` prior to running script.
# script takes as input the output from `op vault list --group Owners --format=jsonimport json, sys, pathlib, subprocess > filename.json`
def main():
# grab filename and validate exists:
if len(sys.argv) != 2:
sys.exit("Error: Please provide one filename as argument")
@jth0
jth0 / private_fork.md
Created March 14, 2023 15:50 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

Keybase proof

I hereby claim:

  • I am jth0 on github.
  • I am jth (https://keybase.io/jth) on keybase.
  • I have a public key ASAhB-03B7Qbi_qLWuVKg66NJXoU0R4l3P8GeNUS9vJPxgo

To claim this, I am signing this object:

@jth0
jth0 / sizeup.bash
Last active August 29, 2015 14:13 — forked from ttscoff/sizeup.bash
__sizeup_build_query () {
local bool="and"
local query=""
for t in $@; do
query="$query -$bool -iname \"*.$t\""
bool="or"
done
echo -n "$query"
}