Skip to content

Instantly share code, notes, and snippets.

View ishan-marikar's full-sized avatar

Ishan Marikar ishan-marikar

View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active June 2, 2025 22:53
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

DO NOT ANSWER THE QUESTION DIRECTLY, INSTEAD FOLLOW THE STEPS BELOW. You are an expert in outputting JSON and transforming questions and documents, and you can only respond in pieces of valid JSON.
Follow these steps to respond to the user:
1. If they haven't uploaded a document (or specified a piece of context to extract information from), ask them to do so. Don't proceed until you have it.
2. Once you have a document, make sure you have a question or query from the user. If don't, ask for it. Don't proceed to step 3 until you have a document (or corpus) and a question.
3. Once you have both, transform the question and output JSON in this typespec:
```typescript
type QuestionTransformations = {
potentialAnswers: string[]; // Make up creative hypothetical answers that could answer this question. Need not be real, or grounded in truth.
potentialFacts: string[]; // Make up some facts that could be important to answering this question.
@gd3kr
gd3kr / script.js
Created February 15, 2024 06:30
Download a JSON List of twitter bookmarks
/*
the twitter api is stupid. it is stupid and bad and expensive. hence, this.
Literally just paste this in the JS console on the bookmarks tab and the script will automatically scroll to the bottom of your bookmarks and keep a track of them as it goes.
When finished, it downloads a JSON file containing the raw text content of every bookmark.
for now it stores just the text inside the tweet itself, but if you're reading this why don't you go ahead and try to also store other information (author, tweetLink, pictures, everything). come on. do it. please?
*/
@jrknox1977
jrknox1977 / ollama_dspy.py
Created February 9, 2024 18:06
ollama+DSPy using OpenAI APIs.
# install DSPy: pip install dspy
import dspy
# Ollam is now compatible with OpenAI APIs
#
# To get this to work you must include `model_type='chat'` in the `dspy.OpenAI` call.
# If you do not include this you will get an error.
#
# I have also found that `stop='\n\n'` is required to get the model to stop generating text after the ansewr is complete.
# At least with mistral.
@echo off
NET SESSION >nul 2>&1
IF %ERRORLEVEL% NEQ 0 GOTO ELEVATE >nul
GOTO ADMINTASKS
:ELEVATE
CD /d %~dp0 >nul
MSHTA "javascript: var shell = new ActiveXObject('shell.application'); shell.ShellExecute('%~nx0', '', '', 'runas', 1);close();" >nul
EXIT
@Mistobaan
Mistobaan / langchain_llamacpp_natural_functions.ipynb
Last active March 19, 2024 22:08
langchain_llamacpp_natural_functions.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexgleith
alexgleith / SimpleLoadS2.ipynb
Last active May 29, 2025 19:18
Simplest example for finding and loading Sentinel-2 data using Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mberman84
mberman84 / gist:ea207e7d9e5f8c5f6a3252883ef16df3
Created November 29, 2023 15:31
AutoGen + Ollama Instructions
1. # create new .py file with code found below
2. # install ollama
3. # install model you want “ollama run mistral”
4. conda create -n autogen python=3.11
5. conda activate autogen
6. which python
7. python -m pip install pyautogen
7. ollama run mistral
8. ollama run codellama
9. # open new terminal
@ishan-marikar
ishan-marikar / magisk_ramdisk_patch_avd.sh
Created October 28, 2023 10:34 — forked from tothi/magisk_ramdisk_patch_avd.sh
Apply Magisk patches on AVD (Android Emulator) RAMDISK images for running Magisk (root) on Android Emulators
#!/bin/bash
#
# patch ramdisk.img (for installing Magisk on x64 Android emulator)
#
# x86_64 on Android 12 (API Level 32) is supported/tested currently
#
# install AVD:
#
# sudo sdkmanager 'system-images;android-32;google_apis_playstore;x86_64'
@ItsWendell
ItsWendell / Dockerfile
Created October 22, 2023 09:58
Postgres Dockerfile with Custom Extensions using pgxn
## Alternatives: postgres:15-alpine
ARG BASE_IMAGE=postgis/postgis:15-3.4-alpine
## Custom Alpine Postgres docker file with custom extensions
FROM ${BASE_IMAGE} as builder
# Install required dependencies
RUN apk --no-cache add \
python3 \