Skip to content

Instantly share code, notes, and snippets.

@jeffbryner
jeffbryner / model_armor.py
Created June 28, 2025 17:15
model armor call
from google.cloud import modelarmor_v1
import google.auth
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
def is_prompt_clean(prompt):
"""
Take raw input and run it through the model armor API to check if it is clean
@jeffbryner
jeffbryner / jql.md
Created June 19, 2025 17:02
JQL reference

JQL Structure The basic structure of a JQL query consists of three components:

Field: Refers to the Jira field that you want to search for. Examples include:

Assignee, Affected version, Attachments, Comment, Component, Created, Creator, Description, Due, Epic link, Filter, Fix version, Issue key, Labels, Last viewed, Priority, Project, Reporter, Resolved, Sprint, Status, Summary, Text, Time spent, Voter, Watcher, custom field – Any custom field defined by the administrator and accessible to the user

Operator: Specifies the comparison operator that you want to use to compare the field to the value. Examples of operators include:

@jeffbryner
jeffbryner / WiFiScanner.app
Created June 6, 2025 18:22
macOS: capture surrounding wifi networks in rust
A directory with your Info.plist and the cargo build --release binary
WiFiScanner.app
WiFiScanner.app/Contents
WiFiScanner.app/Contents/MacOS
WiFiScanner.app/Contents/MacOS/wifiscanner
WiFiScanner.app/Contents/Resources
WiFiScanner.app/Contents/Info.plist
@jeffbryner
jeffbryner / csv_chat.py
Last active February 23, 2025 23:55
csv chat
from agno.agent import Agent, AgentMemory
from agno.memory.classifier import MemoryClassifier
from agno.memory.summarizer import MemorySummarizer
from agno.memory.manager import MemoryManager
from gemini_models import model_pro, model_flash
from agno.tools.file import FileTools
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.duckdb import DuckDbTools
from agno.storage.agent.sqlite import SqliteAgentStorage
from agno.memory.db.sqlite import SqliteMemoryDb
@jeffbryner
jeffbryner / delegated_credential.py
Created December 17, 2023 21:57
google delegated creds from a gcp service account
def delegated_credential(credentials, subject, scopes):
from google.auth import iam
from google.auth.transport import requests
from google.oauth2 import service_account
TOKEN_URI = "https://accounts.google.com/o/oauth2/token"
try:
admin_creds = credentials.with_subject(subject).with_scopes(scopes)
except AttributeError: # Looks like a compute creds object
# Refresh the boostrap credentials. This ensures that the information
@jeffbryner
jeffbryner / fix_missing_exif.py
Created November 24, 2022 18:40
Add missing exif date from filename
# small script to add exif date tags to photos that are missing them
# assumes the date is in the filename in the format: <something>-DATE-anythingelse.<jpg|png|etc>
# and that the date can be parsed by dateutil.parser
# dependencies
# pip install exif, python-dateutil
import exif
import glob
from exif import Image
@jeffbryner
jeffbryner / Dockerfile
Created November 22, 2021 22:42
cloudbuild with local docker builder
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
cat .inputrc
"\e[5~": history-search-backward
"\e[6~": history-search-forward
@jeffbryner
jeffbryner / pd_threshold.py
Created October 18, 2019 18:24
pandas threshold function
def pd_threshold(in_dict,column_name,threshold_count):
'''given a dictionary (or data frame), return a dictionary of the column values over a certain threshold'''
df=pd.DataFrame(in_dict)
df_count=df.groupby(column_name)[column_name].count()
return df_count[df_count.where(df_count>threshold_count)>threshold_count].to_dict()

Keybase proof

I hereby claim:

  • I am jeffbryner on github.
  • I am 0x7eff (https://keybase.io/0x7eff) on keybase.
  • I have a public key ASC1HuFOZoQ-lVt-4CZ2rozOACHs2rJbmX2DmfiuJ1SNVgo

To claim this, I am signing this object: