Skip to content

Instantly share code, notes, and snippets.

View bitsnaps's full-sized avatar
🌍
Working @ CorpoSense

Ibrahim H. bitsnaps

🌍
Working @ CorpoSense
View GitHub Profile
from flask import Flask, jsonify, request
import requests
import PyPDF2
import tempfile
import pickle
import retrying
from langchain.llms import OpenAI
from langchain.chains.qa_with_sources import load_qa_with_sources_chain
from langchain.docstore.document import Document
from langchain.embeddings.openai import OpenAIEmbeddings
@bitsnaps
bitsnaps / agent.py
Created June 21, 2023 09:56 — forked from hursh-desai/agent.py
obsidian + langchain
import os
import re
import faiss
from langchain import FAISS
import obsidiantools.api as otools
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.chains.qa_with_sources import load_qa_with_sources_chain
from langchain.llms import OpenAI
os.environ["OPENAI_API_KEY"] = 'sk-********'
@bitsnaps
bitsnaps / odoo9-install.sh
Last active April 13, 2023 16:24 — forked from bistaray/Install Odoo v9 YENTHE
Ubuntu Scripts Installing Odoo v9
#!/bin/bash
################################################################################
# Script for installing Odoo on Ubuntu 14.04, 15.04 and 16.04 (could be used for other version too)
# Author: Yenthe Van Ginneken
#-------------------------------------------------------------------------------
# This script will install Odoo on your Ubuntu 14.04 server. It can install multiple Odoo instances
# in one Ubuntu because of the different xmlrpc_ports
#-------------------------------------------------------------------------------
# Make a new file:
# sudo nano odoo-install.sh
@bitsnaps
bitsnaps / tool_size.py
Created March 21, 2023 09:48
A script to browse all python packages and show their sizes
#!/usr/bin/env python
import os
import pkg_resources
def calc_container(path):
total_size = 0
for dirpath, dirnames, filenames in os.walk(path):
for f in filenames:
fp = os.path.join(dirpath, f)
@bitsnaps
bitsnaps / curl-hack-.md
Last active March 13, 2023 08:32 — forked from vpnwall-services/curl-hack-.md
Curl example #bash #curl #hack

Hacking With cURL

A list of examples and references of hacking with Bash and the Curl command.

What the heck is cURL?

cURL is short for "Client URL" and is a computer software project providing a library (libcurl) and command-line tool (curl) first released in 1997. It is a free client-side URL transfer library that supports the following protocols: Cookies, DICT, FTP, FTPS, Gopher, HTTP/1, HTTP/2, HTTP POST, HTTP PUT, HTTP proxy tunneling, HTTPS, IMAP, Kerberos, LDAP, POP3, RTSP, SCP, and SMTP Although attack proxies like BurpSuitePro are very handy tools, cURL allows you to get a bit closer to the protocol level, leverage bash scripting and provides a bit more flexibility when you are working on a complex vulnerability.

cURL GET parameters

HTTP GET variables can be set by adding them to the URL.

@bitsnaps
bitsnaps / bypass_ssl_insecurities.py
Created February 26, 2023 18:04 — forked from sujit/bypass_ssl_insecurities.py
Selenium Bypass SSL Bad/Revoked Certificates
import sys
from time import sleep
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import WebDriverException
from eliot import start_action, to_file, log_call
# from selenium.webdriver.common.keys import Keys
# from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
# from selenium.webdriver.common.by import By
# from selenium.webdriver.support import expected_conditions as EC
@bitsnaps
bitsnaps / InstallGLPK.md
Last active February 11, 2023 16:31
Setup and install glpk on Windows 7

GLPK Installation process on Windows 7 SP1

Prerequists:

  • Visual C++ (for GLPK v4.65 you'll need VC v2010 Express)

  • Download the latest GLPK zip package: https://sourceforge.net/projects/winglpk/files/winglpk/ then extract its content to the C:\glpk.

  • Create the environment variable %GLPK_HOME% pointing to the C:\glpk path you've created, and add to the system path the following value: SET PATH=%PATH%;%GLPK_HOME%\w64

@bitsnaps
bitsnaps / scraping_results.py
Last active January 14, 2023 17:04
Scraping results from Quiz And Survey Master wordpress plugin using python3
import os, csv, requests, datetime, urllib, re
from bs4 import BeautifulSoup
# from dateutil.parser import parse # if you want to parse datetime
# This script allows you to grab results from your wordpress website if you're using "Quiz And Survey" plugin.
wp_host = 'https://your-wordpress-website.com'
wp_login = f"{wp_host}/login"
wp_admin = f"{wp_host}/wp-admin/"
wp_quiz = f"{wp_host}/wp-admin/admin.php?page=mlw_quiz_results&qmn_order_by=time_taken_real"
@bitsnaps
bitsnaps / JScienceTest.groovy
Created September 25, 2022 22:04 — forked from kimukou/JScienceTest.groovy
JScienceTest.groovy
// reference http://www.geocities.jp/tomtomf/JScience/JScience.htm
//
@GrabResolver (name='jcurl-repository', root='http://jcurl.berlios.de/m2/repo/')
@Grab(group = 'org.jscience', module='jscience', version='4.3.1')
import org.jscience.mathematics.number.Complex
import org.jscience.mathematics.vector.ComplexMatrix
//計算結果の出力様関数
def show(cm) {
@bitsnaps
bitsnaps / base64coding.groovy
Created September 24, 2022 09:45 — forked from mujahidk/base64coding.groovy
Base64 encoding and decoding in Groovy.
def text = "Going to convert this to Base64 encoding!"
// Encode
def encoded = text.bytes.encodeBase64().toString()
println encoded
// Decode
byte[] decoded = encoded.decodeBase64()
println new String(decoded)