Skip to content

Instantly share code, notes, and snippets.

View richarddun's full-sized avatar
Always onward, however slow, failure's delay will pass and go.

Richard D richarddun

Always onward, however slow, failure's delay will pass and go.
  • Dublin, Ireland
View GitHub Profile
#!/usr/bin/env python2
import curses
import curses.panel
def main(win):
global stdscr
global max_y,max_x,mult
stdscr = win
curses.initscr()
@richarddun
richarddun / gist:1bb11d32cafc394efbcb8f4a8b6cb130
Last active January 30, 2025 19:33
scapy script to send http requests
#!/usr/bin/env python
"""
Script to open TCP connection and send 1 HTTP GET request containing
a specific string, and header
Usage:
./http.py <IP_of_target>
There is only one mandatory argument, which is the target IP address.
@richarddun
richarddun / aiohttp_sample
Last active September 1, 2017 19:24
Sample usage of aiohttp to post arbitary data and return / use the result in original order with asyncio.gather()
import asyncio
import aiohttp
import json
async def retrieve_data(postdata):
async with aiohttp.ClientSession() as client:
#use the excellent httpbin.org as a springboard
postrep = await client.post('http://httpbin.org/post',data={"postkey":postdata})
jsonobj = json.loads(await postrep.text())
return jsonobj['form']['postkey']
@richarddun
richarddun / img_gen.py
Created July 6, 2023 14:03
Basic OpenAI image gen (Dall-e 2) from cli using python
# This Python file uses the following encoding: utf-8
import openai
import requests
import sys
from PIL import Image
# sample usage of Dalle-2 via Python
# from CLI with sys for args
variations = 4
@richarddun
richarddun / img_vary.py
Created July 6, 2023 14:08
Sample python script to take an image as input and send to dall-e 2 from cli
# This Python file uses the following encoding: utf-8
import openai
import requests
import sys
from PIL import Image
from uuid import uuid4
import os
image_to_vary = sys.argv[1]
try:
@richarddun
richarddun / Codex-Profiles-Termux.md
Last active January 6, 2026 00:58
Run OpenAI Codex on Termux (Android) with OpenRouter + Dynamic Model Launcher (Grok, Claude, GPT-5, Gemini)

Run OpenAI Codex on Termux (Android) with OpenRouter + Dynamic Model Launcher

Grok • Claude Opus • GPT-5 • Gemini • MiniMax • ANY OpenRouter Model

This guide shows you how to install and run OpenAI’s Codex CLI inside Termux on Android, using the DioNanos/codex-termux fork (bionic-compatible), with full support for:

  • Shell tool execution
  • OpenRouter models (Grok, Claude Opus, GPT-5, Gemini, etc.)
  • A dynamic fzf launcher that auto-detects all [profiles.*] in your Codex config
  • Clean .env-based secret handling
  • Automatic model switching