Skip to content

Instantly share code, notes, and snippets.

View vphantom's full-sized avatar

Stéphane Lavergne vphantom

View GitHub Profile
@vphantom
vphantom / openrouter2md.py
Created March 25, 2025 12:21
Convert OpenRouter chat JSON archive into Markdown
#!/usr/bin/env python3
"""
OpenRouter Chat Transcript Converter
This script converts JSON chat data from OpenRouter to a markdown format.
It reads a JSON file and outputs a markdown file with the chat transcript.
Usage: openrouter2md input_file1.json [input_file2.json ...]
Output: input_file1.md [input_file2.md ...]
@vphantom
vphantom / webclip.sh
Created January 23, 2025 22:19
Replace X clipboard with LLM-ready cleaned up context
#!/bin/bash
# Exit unless xclip and html2markdown are installed, using the return code of 'which'
if ! which xclip >/dev/null 2>&1; then
echo "xclip is not installed" >&2
exit 2
fi
if ! which html2markdown >/dev/null 2>&1; then
echo "html2markdown is not installed" >&2
exit 2
@vphantom
vphantom / example.sh
Last active April 5, 2021 01:39
OpenVPN inside a kernel namespace
#!/bin/bash
#
# Example wrapper script to run an application jailed inside the VPN.
# "myvpn" is the name of my namespace.
#
sudo -E ip netns exec myvpn sudo -E -u lis -- ~/bin/firefox.bin/firefox &
@vphantom
vphantom / modified-cursor.pcf.gz
Last active July 1, 2018 16:35
Override Xorg's black hand1 mouse cursor pointer with the white hand2