Skip to content

Instantly share code, notes, and snippets.

View joseabraham's full-sized avatar
😎
Building cool things

Jose Abraham Garcia joseabraham

😎
Building cool things
View GitHub Profile
@ranfysvalle02
ranfysvalle02 / vector-search-tool.py
Created June 3, 2023 15:16
MongoDB Atlas Vector Search + LangChain Agents = ✨MAGIC✨
# https://www.mongodb.com/docs/atlas/atlas-search/knn-beta/
import pymongo
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.llms import AzureOpenAI
import os
from rake_nltk import Rake
from langchain.agents import initialize_agent, Tool
MONGO_URI = "mongodb+srv://....mongodb.net/?retryWrites=true&w=majority&tls=true"
MONGODB_DATABASE = "demo_db"
@horosin
horosin / README.md
Last active July 15, 2024 09:56
Extracting and Generating JSON Data with GPTs, LangChain, and Node.js
@kacperlukawski
kacperlukawski / qdrant-0.10-multiple-vectors.ipynb
Last active October 14, 2024 18:26
Using multiple vectors in Qdrant 0.10
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@antoine-briand
antoine-briand / dropbox-business-account-backup.sh
Created June 21, 2022 21:23
Backup dropbox business accounts using rclone
: '
This script helps me to backup Dropbox business accounts. Requires rclone to be installed on your machine (https://rclone.org/downloads/).
You must create a dropbox application (https://www.dropbox.com/developers/apps) with all READ scopes.
Then configure your rclone using rclone config
1) Choose dropbox
2) Set your remote name
3) On client_id, paste the value you have for "App key" on your Dropbox app (in settings)
4) On client_secret, paste the value you have for "App secret" on your Dropbox app (in settings)
5) Edit advanced config and set a value to the impersonate parameter (your admin account email e.g)
@shashankvemuri
shashankvemuri / all.py
Last active January 24, 2024 00:01
all the code
import numpy as np
import warnings
from pandas_datareader import data as pdr
import yfinance as yf
import datetime as dt
from yahoo_fin import stock_info as si
import pandas as pd
pd.set_option('display.max_rows', None)
warnings.filterwarnings("ignore")
yf.pdr_override()
@cgcardona
cgcardona / ava-full-node-steps.md
Last active December 2, 2022 03:16
Steps for firing up an Avalanche full node

Steps for firing up a full Avalanche node

Avalanche is an open-source platform for launching highly decentralized applications, financial primitives, and interoperable blockchains.

These are steps for firing up an Avalanche full node on Digital Ocean.

Digital Ocean Ubuntu Instance

ssh into a Digital Ocean Ubuntu box

@diegofcornejo
diegofcornejo / lambda_rds_ses.js
Last active July 12, 2020 21:55
Send an email with csv attachment created from query results
const aws = require('aws-sdk');
const nodemailer = require('nodemailer');
const mysql = require('mysql');
const json2csv = require('json2csv').parse;
const fs = require('fs');
// create Nodemailer SES transporter
var transporter = nodemailer.createTransport({
SES: new aws.SES({
apiVersion: '2010-12-01'
#facebook marketplace
from selenium import webdriver
from time import sleep
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from pymongo import MongoClient
class App:
@jrrio
jrrio / reduce_Object.md
Created April 23, 2018 15:06
Calculate the average of Object properties using for...in loop, Object.keys(), Object.values(), and Object.entries()

Calculate the average of Object properties

Here is our Object literal with some properties. What we need to do is calculate the average height of a set of people using JavaScript.

const data = {
  "Matt": { "height" : 176, "weight": 87 },
  "Jason": { "height" : 190, "weight": 103 },
  "Peter": { "height" : 180, "weight": 98 }
};
@srquinn21
srquinn21 / README.markdown
Last active August 28, 2020 02:04
Cross Site WebSocket Hijacking Nginx Config

Notes

While researching possible Websocket vulnerabilities, I came across the "Cross Site WebSocket Hijacking" attack as documented here:

http://www.christian-schneider.net/CrossSiteWebSocketHijacking.html
https://www.notsosecure.com/how-cross-site-websocket-hijacking-could-lead-to-full-session-compromise/

TL;DR: Websockets, by spec, do not respect the browser's Same Origin Policy enforced for CORs and XHR requests. This means that a connection made in one browser tab can be hijacked in another browser tab similar to a typical XSS attack. In order to protect our services, we need to make sure that the Origin header matches the application's server name.

I've provided a nginx.conf file below that demonstrates how to check the Origin header. In addition to this config update, you'll also want to be sure to use a session token during your websocket handshake that is verified on the server for each connection. I suggest looking into JSON Web Tokens (JWT)