Skip to content

Instantly share code, notes, and snippets.

View wrannaman's full-sized avatar

Andrew Pierno wrannaman

View GitHub Profile
@wrannaman
wrannaman / video-search.py
Created June 7, 2024 16:49
embed text and images for video search
import subprocess
import json
import numpy as np
import tempfile
from PIL import Image as PILImage
from sentence_transformers import models, SentenceTransformer
import logging
import os
import io
from pymilvus import MilvusClient
@wrannaman
wrannaman / brower-agent.js
Last active April 29, 2024 20:05
AI Agent to browse google and summarize search results
const { chromium } = require('playwright');
const OpenAI = require('openai');
const dotenv = require('dotenv');
dotenv.config();
const openai = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'],
});
const model = "gpt-4"
@wrannaman
wrannaman / chat-gpt-turbo-function-example.js
Created June 16, 2023 00:38
example function in node js to call the chat gpt api with a function call
const config = require('./config')
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
apiKey: config.openai,
});
const openai = new OpenAIApi(configuration);
const businessType = async (businessType) => {
console.log("businessType:", businessType)
@wrannaman
wrannaman / gist:72b2d2369fe91dec7cbeb55c8e3d2567
Created June 9, 2020 21:31
/etc/apt/sources.list for ubuntu 18.04.02 LTS
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu bionic main restricted
# deb-src http://archive.ubuntu.com/ubuntu bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu bionic-updates main restricted
@wrannaman
wrannaman / rename + concat
Created April 10, 2020 18:14
rename + concat ffmpeg
/*
run once wth first run
then run again with second run
then on the cli do
*/
const fs = require('fs');
@wrannaman
wrannaman / tmate.sh
Last active October 13, 2020 17:08
tmate old instructions bc they removed them from their damn website
# after install
ssh-keygen
# New Session
tmate -S /tmp/tmate.sock new-session -d
# Show ssh url
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
# show web url
@wrannaman
wrannaman / resize.sh
Created December 20, 2019 00:41
resize disk on GCP compute engine
DISKNUMBER=1
sudo growpart /dev/sda $DISKNUMBER
sudo resize2fs /dev/sda$DISKNUMBER
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
Verifying my Blockstack ID is secured with the address 12nFgG5vUYmbv7MPcekGJHHPMFQoveLm6h https://explorer.blockstack.org/address/12nFgG5vUYmbv7MPcekGJHHPMFQoveLm6h
@wrannaman
wrannaman / find.sh
Created September 8, 2019 22:31
docker huge ass log files
du -d1 -h /var/lib/docker/containers | sort -h