Skip to content

Instantly share code, notes, and snippets.

@beowolx
beowolx / openchat_3_5.preset.json
Created December 22, 2023 16:49
This is the prompt preset for OpenChat 3.5 models in LM Studio
{
"name": "OpenChat 3.5",
"load_params": {
"n_ctx": 8192,
"n_batch": 512,
"rope_freq_base": 10000,
"rope_freq_scale": 1,
"n_gpu_layers": 80,
"use_mlock": true,
"main_gpu": 0,
@mberman84
mberman84 / gist:34d7716e78bdfe6cff07a63f6d05298d
Created October 27, 2023 14:10
MemGPT + Open-Source Models
# spin up a runpod GPU with TextGen WebUI, no need to use openai flag
# you can also use TextGen WebUI on your local computer
git clone https://github.com/cpacker/MemGPT.git
cd MemGPT
export OPENAI_API_BASE=https://some-stuff-5000.proxy.runpod.net # using runpod
# export OPENAI_API_BASE=localhost:5000 # using local computer
BACKEND_TYPE=webui
python3 main.py --no_verify
@win3zz
win3zz / CVE-2023-21939.md
Created August 27, 2023 12:33
CVE-2023-21939 - Code Exec - Proof of Concept

CVE-2023-21939 - Code Exec - Proof of Concept

Vulnerability Summary: Vulnerability in the Oracle Java SE, Oracle GraalVM Enterprise Edition product of Oracle Java SE (component: Swing). Supported versions that are affected are Oracle Java SE: 8u361, 8u361-perf, 11.0.18, 17.0.6, 20; Oracle GraalVM Enterprise Edition: 20.3.9, 21.3.5 and 22.3.1. Easily exploitable vulnerability allows unauthenticated attacker with network access via HTTP to compromise Oracle Java SE, Oracle GraalVM Enterprise Edition. Successful attacks of this vulnerability can result in unauthorized update, insert or delete access to some of Oracle Java SE, Oracle GraalVM Enterprise Edition accessible data. Note: This vulnerability applies to Java deployments, typically in clients running sandboxed Java Web Start applications or sandboxed Java applets, that load and run untrusted code (e.g., code that comes from the internet) and rely on the Java sandbox for security. This vulnerability can also be exploited by using APIs in the specifie

@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active July 1, 2024 05:32
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
@mberman84
mberman84 / checker.py
Created June 12, 2023 02:47
Cuda Checker
import torch
print(torch.version.cuda)
print(torch.cuda.is_available())
@disler
disler / main.py
Last active November 29, 2023 04:30
vueGPT: Automatically Generate Vue 3 <script setup lang='ts'> components like a boss.
from vueGPT import prompt, make_client
from dotenv import load_dotenv
# load .env file
load_dotenv()
# get openai api key
OPENAI_API_KEY = environ.get('OPENAI_API_KEY')
@samicrusader
samicrusader / pmxcfs.py
Created May 27, 2023 04:44
Proxmox Virtual Environment config.db dump utility
#!/usr/bin/env python3
import os
import sqlite3
import sys
try:
os.mkdir('config_restore')
except:
pass
@fofr
fofr / select-grid.js
Created May 26, 2023 22:15
Photoshop grid selection
// Get a reference to the active document.
var doc = app.activeDocument;
// Set the height of the selection to the height of the document.
var height = doc.height;
// Set the x and y offset in pixels.
var xOffset = 5;
var yOffset = 5;
@aemmitt-ns
aemmitt-ns / restricted.m
Created May 19, 2023 14:06
program to dump out forbidden classes and selectors in NSPredicates
// dump classes and selectors forbidden in NSPredicates
// `cc -framework Foundation -o restricted restricted.m`
#import <Foundation/Foundation.h>
#import <dlfcn.h>
int main() {
void *cf = dlopen("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation", 0);
NSDictionary* (*RestrictedClasses)() = dlsym(cf, "_CFPredicatePolicyRestrictedClasses");
NSDictionary* (*RestrictedSelectors)() = dlsym(cf, "_CFPredicatePolicyRestrictedSelectors");
NSLog(@"Restricted Selectors: %@", RestrictedSelectors());