Skip to content

Instantly share code, notes, and snippets.

View CypherpunkSamurai's full-sized avatar
😶
Currently Busy 🌻🐢

Cypherpunk Samurai CypherpunkSamurai

😶
Currently Busy 🌻🐢
View GitHub Profile
@CypherpunkSamurai
CypherpunkSamurai / tee.go
Created July 26, 2024 14:50 — forked from jerblack/tee.go
Golang: Mirror all writes to stdout and stderr in program to log file
package main
import (
"fmt"
"io"
"log"
"os"
)
func main() {
@Artefact2
Artefact2 / README.md
Last active September 19, 2024 19:38
GGUF quantizations overview

Which GGUF is right for me? (Opinionated)

Good question! I am collecting human data on how quantization affects outputs. See here for more information: ggerganov/llama.cpp#5962

In the meantime, use the largest that fully fits in your GPU. If you can comfortably fit Q4_K_S, try using a model with more parameters.

llama.cpp feature matrix

See the wiki upstream: https://github.com/ggerganov/llama.cpp/wiki/Feature-matrix

@jdah
jdah / network_demo.c
Created January 31, 2024 14:22
the world's most basic client/server
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>
static void server() {
// create socket
@Shadow0ps
Shadow0ps / Unighost_Prompt_Injection.py
Created January 12, 2024 07:15
Converts ASCII Prompts to Unicode Generating “Invisible” Prompts
#This script helps generate unicode which is essentially hidden or "invisible" but is easily read by LLM's especially those that do not rely on a UI or Prescreening of prompts via API submission.
#This wont be published until someone else discovers it as its too "valuable" to threat actors to publish given currently available mitigations.
# V1.0: TLP RED! Do Not Distribute! Category: Hidden Injection Prompt! - 09/2023 - ShadowOpz
# V2.0: TLP RED! Feature update: Added invisible clipboard functionality.
# V3.0: Public Disclosure from Twitter discovered. Notes below.
# V3.0 Notes: Released to public Gist 01/12/2024 after public disclosure from Twitter.
# Kudos to @rezo_ and @goodside for the discovery and their pyperclip version.
@qt-kaneko
qt-kaneko / Program.cs
Last active May 8, 2024 12:02
Google Lens API POC
using System;
using System.Linq;
using System.Net.Http;
using System.Text.Json;
using System.Text.RegularExpressions;
var http = new HttpClient();
// Here is image, i.e. File.ReadAllBytes("smth.png");
var file = new byte[] {137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 44, 0, 0, 0, 44, 8, 6, 0, 0, 0, 30, 132, 90, 1, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0, 154, 156, 24, 0, 0, 5, 194, 105, 84, 88, 116, 88, 77, 76, 58, 99, 111, 109, 46, 97, 100, 111, 98, 101, 46, 120, 109, 112, 0, 0, 0, 0, 0, 60, 63, 120, 112, 97, 99, 107, 101, 116, 32, 98, 101, 103, 105, 110, 61, 34, 239, 187, 191, 34, 32, 105, 100, 61, 34, 87, 53, 77, 48, 77, 112, 67, 101, 104, 105, 72, 122, 114, 101, 83, 122, 78, 84, 99, 122, 107, 99, 57, 100, 34, 63, 62, 32, 60, 120, 58, 120, 109, 112, 109, 101, 116, 97, 32, 120, 109, 108, 110, 115, 58, 120, 61, 34, 97, 100, 111, 98, 101, 58, 110, 115, 58, 109, 101, 116, 97, 47, 34, 32, 120, 58, 120, 109, 112, 116, 107, 61, 34, 65, 100, 111, 98, 101, 32, 88,
@badrelmers
badrelmers / Portable_Virtualbox.md
Last active September 11, 2024 19:53
portable virtualbox using the latest virtualbox installers

This makes virtualbox works in a portable mode:

  • if you have any installed virtualbox then uninstall it first
  • download https://download.virtualbox.org/virtualbox/7.0.8/VirtualBox-7.0.8-156879-Win.exe or any newer or older version
  • click on Download ZIP above to download the scripts needed
  • create a folder inside your USB/external drive or whatever, name it myVMBOX (ex. F:\myVMBOX if your USB is in F:\).
  • inside F:\myVMBOX put the virtualbox exe we just downloaded (VirtualBox-7.0.8-156879-Win.exe) and rename it to VirtualBox.exe.
  • inside F:\myVMBOX put the following files start_virtualbox.bat and uninstall_virtualbox.bat, you will find them inside the zip you just downloaded.
  • now everytime you want to start virtualbox use start_virtualbox.bat.
@danielgross
danielgross / ai-plugin.json
Created March 23, 2023 22:59
ChatGPT Plugin for Twilio
{
"schema_version": "v1",
"name_for_model": "twilio",
"name_for_human": "Twilio Plugin",
"description_for_model": "Plugin for integrating the Twilio API to send SMS messages and make phone calls. Use it whenever a user wants to send a text message or make a call using their Twilio account.",
"description_for_human": "Send text messages and make phone calls with Twilio.",
"auth": {
"type": "user_http",
"authorization_type": "basic"
},
# STEP 1: Load
# Load documents using LangChain's DocumentLoaders
# This is from https://langchain.readthedocs.io/en/latest/modules/document_loaders/examples/csv.html
from langchain.document_loaders.csv_loader import CSVLoader
loader = CSVLoader(file_path='./example_data/mlb_teams_2012.csv')
data = loader.load()
@jahtzee
jahtzee / prompts.txt
Last active August 6, 2024 00:40
ChatGPT Jailbreaking prompts, exploits and other fun stuff
These are some exploits, jailbreaks, tricks, whatever you want to call them I've collected and discovered over time.
==== Games and fun stuff ====
== Set up a virtual machine inside GPTs imagination ==
"I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd."
== Play a tabletop RPG with GPT as the dungeon master ==
"I want you to act as the dungeon master (DM) of a role playing game. Answer and act only in a way that a dungeon master would.
You are setting up a role playing game with only one other player. Everything you say as the dungeon master begins with (DM): followed by whatever you want to say. You will regularly ask me, the player, to
@chavinlo
chavinlo / train.py
Last active July 29, 2023 20:15
HIVEMIND_DISTRIBUTED_TRAINING_12_9_2022_8_37PM
# Install bitsandbytes:
# `nvcc --version` to get CUDA version.
# `pip install -i https://test.pypi.org/simple/ bitsandbytes-cudaXXX` to install for current CUDA.
# Example Usage:
# Single GPU: torchrun --nproc_per_node=1 trainer/diffusers_trainer.py --model="CompVis/stable-diffusion-v1-4" --run_name="liminal" --dataset="liminal-dataset" --hf_token="hf_blablabla" --bucket_side_min=64 --use_8bit_adam=True --gradient_checkpointing=True --batch_size=1 --fp16=True --image_log_steps=250 --epochs=20 --resolution=768 --use_ema=True
# Multiple GPUs: torchrun --nproc_per_node=N trainer/diffusers_trainer.py --model="CompVis/stable-diffusion-v1-4" --run_name="liminal" --dataset="liminal-dataset" --hf_token="hf_blablabla" --bucket_side_min=64 --use_8bit_adam=True --gradient_checkpointing=True --batch_size=10 --fp16=True --image_log_steps=250 --epochs=20 --resolution=768 --use_ema=True
import argparse
import socket
import sys