Skip to content

Instantly share code, notes, and snippets.

@disler
disler / main.py
Last active June 20, 2025 21:44
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());
@arkark
arkark / vm2_3.9.17_sandbox_escape.md
Last active January 16, 2024 20:48
Sandbox Escape in [email protected] - CVE-2023-32314

Sandbox Escape in [email protected]

A sandbox escape vulnerability exists in vm2 for versions up to 3.9.17. It abuses an unexpected creation of a host object based on the specification of Proxy, and allows RCE via Function in the host context.

Impact

A threat actor can bypass the sandbox protections to gain remote code execution rights on the host running the sandbox.

PoC

# V1 (optimized for novel imagery)
Forget all previous prompts. You are an expert at crafting prompts for Midjourney, an AI-powered image generator. Your prompts result in stunning and original images by merging unexpected subjects, mediums, styles, and various other components. Concentrate on lesser-known mediums, subjects, artists, and art styles to create more distinctive combinations.
Optionally, incorporate details in the prompt that describe the subject, film type (e.g., Kodak Portra 400, Fujifilm Neopan Acros 100, CineStill 800T), lighting (e.g., side lighting, diffused lighting, hard lighting), shot type (e.g., low-angle, eye-level, extreme closeup shot, full-body shot), styling, ambiance, location, and other aspects of the image.
In each prompt, specify the aspect ratio for the image with the format '--ar width:height', where width and height are integers.
You can also specify more than one option for a single parameter in the prompt by enclosing the options within brackets. For example:
@neubig
neubig / dispatch_openai_requests.py
Last active February 19, 2024 17:55
A simple script to get results from the OpenAI Asynchronous API
# NOTE:
# You can find an updated, more robust and feature-rich implementation
# in Zeno Build
# - Zeno Build: https://github.com/zeno-ml/zeno-build/
# - Implementation: https://github.com/zeno-ml/zeno-build/blob/main/zeno_build/models/providers/openai_utils.py
import openai
import asyncio
from typing import Any
@adrianhajdin
adrianhajdin / Customizer.jsx
Created March 31, 2023 12:33
Build and Deploy an AI-Powered 3D Website Using React | 2023 Three JS Course Tutorial for Beginners
{/* Download button */}
<button className='download-btn' onClick={downloadCanvasToImage}>
<img
src={download}
alt='download_image'
className='w-3/5 h-3/5 object-contain'
/>
</button>
@kmatt
kmatt / pg_podman.sh
Created March 21, 2023 20:07
Podman / Docker PostgreSQL on Windows 10
podman pull docker.io/library/postrges
podman volume create pg_data
podman run -dt --name postgres \
-e POSTGRES_PASSWORD=*** \
--mount type=volume,src=pg_data,target=/var/lib/postgresql/data \
-p 5432:5432 \
postgres
@gladiopeace
gladiopeace / Crack Sublime Text Windows and Linux.md
Created December 19, 2022 00:21 — forked from JerryLokjianming/Crack Sublime Text Windows and Linux.md
Crack Sublime Text 3.2.2 Build 3211 and Sublime Text 4 Alpha 4098 with Hex

YouTube Channel https://www.youtube.com/c/jerrylokjianming


How to Crack Sublime Text 3.2.2 Build 3211 with Hex Editor (Windows | Without License) ↓

  1. Download & Install Sublime Text 3.2.2 Build 3211
  2. Visit https://hexed.it/