Skip to content

Instantly share code, notes, and snippets.

@domasmar
domasmar / mouse-keys.py
Created June 15, 2014 17:02
Simple mouse keys script for linux written in python
'''
Keyboard keys codes:
KEY_KP1 - 1
KEY_KP2 - 2
KEY_KP3 - 3
KEY_KP4 - 4
KEY_KP5 - 5
KEY_KP6 - 6
KEY_KP7 - 7
KEY_KP8 - 8
@pudquick
pudquick / xz_decompress.py
Last active August 29, 2015 14:18
Python ctypes wrapper around liblzma for the purposes of (naive) xz file decompression, for use with OS X 10.7+
# Example usage of the function:
# decompress('PayloadJava.cpio.xz', 'PayloadJava.cpio')
# Decompresses a xz compressed file from the first input file path to the second output file path
import sys
from ctypes import CDLL, Structure, c_void_p, c_size_t, c_uint, c_uint32, c_uint64, create_string_buffer, addressof, sizeof, byref
class lzma_stream(Structure):
_fields_ = [
# -*- coding: utf-8 -*-
"""
Based on:
https://gist.github.com/meeuw/c3bc9dd07945c87c89e6#file-findfiles-py
https://bitbucket.org/nosklo/pysmbclient/wiki/Home
"""
import os
import pexpect
import re
@Jeremy-D-Miller
Jeremy-D-Miller / pbxz.c
Created October 28, 2015 06:38
PBXZ "extractor" from 'Mac OS X Internals - To The Apple's Core' by Jonathan Levin
/*
* From 'Mac OS X Internals - To The Apple's Core' by Jonathan Levin
*
* http://www.newosxbook.com/articles/OTA.html
* http://www.newosxbook.com/src.jl?tree=listings&file=pbzx.c
*
*/
#include <stdio.h> // for printf
#include <string.h> // for strncmp