Skip to content

Instantly share code, notes, and snippets.

View DavidBuchanan314's full-sized avatar
๐ŸŒ
Hack the planet!

David Buchanan DavidBuchanan314

๐ŸŒ
Hack the planet!
View GitHub Profile
@vxgmichel
vxgmichel / aioudp.py
Last active February 24, 2025 10:28
High-level UDP endpoints for asyncio
"""Provide high-level UDP endpoints for asyncio.
Example:
async def main():
# Create a local UDP enpoint
local = await open_local_endpoint('localhost', 8888)
# Create a remote UDP enpoint, pointing to the first one
@prashanthpai
prashanthpai / python_getdents.py
Last active July 5, 2024 21:26
Python wrapper for getdents/getdents64() syscall
#!/usr/bin/env python
import os
import sys
import ctypes
import struct
from ctypes.util import find_library
# struct linux_dirent64 {
# ino64_t d_ino; /* 64-bit inode number */
# off64_t d_off; /* 64-bit offset to next structure */
@oxguy3
oxguy3 / DRM-free video.md
Last active February 25, 2025 23:41
DRM-free media available for purchase

DRM-free media available for purchase

I think DRM on video content is just awful, but throwing a temper tantrum about it isn't gonna do me any good. So instead of whining about video I can't get DRM-free, I'm gonna celebrate the media I can get without DRM.

DRM-free marketplaces

@haasn
haasn / about:config.md
Last active December 27, 2024 15:46
Firefox bullshit removal via about:config

Firefox bullshit removal

Updated: Just use qutebrowser (and disable javascript). The web is done for.

@pakt
pakt / rdwr.py
Created August 15, 2015 10:59
Direct read/write access to Python's memory
#
# read/write access to python's memory, using a custom bytearray.
# some code taken from: http://tinyurl.com/q7duzxj
#
# tested on:
# Python 2.7.10, ubuntu 32bit
# Python 2.7.8, win32
#
# example of correct output:
# inspecting int=0x41424344, at 0x0228f898
@itrobotics
itrobotics / platform_driver_spi.c
Created May 14, 2015 01:41
a linux driver example code to demo platform_driver of Raspberry Pi which simple show the SPI-FLASH ID
// Simple Character Device Driver Module for Raspberry Pi.
#include <linux/module.h>
#include <linux/string.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <linux/init.h>
#include <linux/cdev.h>
#include <linux/device.h>
@luser
luser / symbols.py
Last active September 9, 2023 04:54
GDB Mozilla symbol server
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
#
# A GDB Python script to fetch debug symbols from the Mozilla symbol server.
#
# To use, run `source /path/to/symbols.py` in GDB 7.9 or newer, or
# put that in your ~/.gdbinit.
from __future__ import print_function
@DavidLudwig
DavidLudwig / sdl2gles2gears.c
Last active November 15, 2022 09:45
GLGears for SDL2 + OpenGL ES 2
/*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 16, 2025 13:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@rofl0r
rofl0r / gist:1073739
Created July 9, 2011 16:53 — forked from angavrilov/gist:926972
mmap injection on linux (emulation of VirtualAllocEx)
/* Support for executing system calls in the context of the game process. */
static const int injection_size = 4;
static const char nop_code_bytes[injection_size] = {
/* This is the byte pattern used to pad function
addresses to multiples of 16 bytes. It consists
of RET and a sequence of NOPs. The NOPs are not
supposed to be used, so they can be overwritten. */
0xC3, 0x90, 0x90, 0x90