Thoughts on reading the llama 3.1 paper
- tags
- ai
First, install if you haven't:
|
|
Check if it works:
|
|
Then open your 1password app, go to Settings > Developer
and Integrate
with 1Password CLI
.
See which vaults you have access to:
|
|
ID NAME 26qksmfapwaq2s..... Personal
It should ask you to open the vault each time.
And example would be
|
|
ID: go6jxv7zgslinwotun2uj4q4qe Title: Resend API Vault: Personal (26qksmfapwaq2siqwsfcxrh6d4) Created: 10 minutes ago Updated: 10 minutes ago by Will Schenk Favorite: false Version: 1 Category: SECURE_NOTE Fields: notesPlain: re_XYEvJ5TV_8a....
And if you want to get the raw value pipe it through JQ:
|
|
re_XYEvJ5TV_8a...
|
|
re_XYEvJ5TV_8a...
There are a couple of ways to do this but here is how you'd do it from the secret scripts section of the docs.
First we create an environment file like env
:
|
|
Then we can make a simple node script that sends a message using the API:
|
|
With the package.json
:
|
|
Then we can try it out without 1password:
|
|
Please set RESEND_API
And then with 1password:
|
|
email sent!
Maybe you don't want it to prompt you everytime, and you want to cache the results. For that you inject, which takes the template and outputs a file that can, hopefully, be secretly shared around
|
|
/Users/wschenk/willschenk.com/content/labnotes/2024/using_1password_from_a_script/.env
Then you can use the normal dotenv
way of loading in things. It
really depends on how and when you are running the scripts, and if its
only triggered by you doing it or if it runs somewhere else.
What happens if you don't want to ship the cleartext files around? Install 1password on the server!
Here's the debian instructions.
Add the key for the 1Password apt repository:
|
|
Add the 1Password apt repository:
|
|
Add the debsig-verify policy:
|
|
Install 1Password CLI:
|
|
Service accounts don't work with personal vaults, so back on your home machine lets create a new one:
|
|
ID: ursbnjfomqcdmz2fym3l3kgjhe Name: Production Type: USER_CREATED Attribute version: 1 Content version: 1 Items: 0 Created: now Updated: now
Copy the item over:
|
|
ID: | uxoawzbzw2bprash6fhlo3q3yq | |
Title: | Resend | API |
Vault: | Production | (ursbnjfomqcdmz2fym3l3kgjhe) |
Created: | now | |
Updated: | now | |
Favorite: | false | |
Version: | 1 | |
Category: | SECURE_NOTE | |
Fields: | ||
notesPlain: | re_XYEvJ5TV_8a…. |
Now we can create a service account
|
|
Service account created successfully! Service account UUID: AME6P4DMKFHMFC5HPQGMQZUVAQ Service account token: ops_eyJzaWduSW5BZGRyZXNzIjoiaHR0cHM6... To start using this service account, run the following command: export OP_SERVICE_ACCOUNT_TOKEN=ops_eyJzaWduSW5BZGRyZXNzIjoiaHR0cHM6...
Keep this somewhere because it'll go away
|
|
And then you have access to the secrets!
Previously
Next