Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@rixtox
rixtox / consts.cpp
Created January 29, 2024 05:41
WinRT HTTP example in (almost) pure C
#define INITGUID
#include <guiddef.h>
#include <windows.web.http.h>
extern "C" {
const IID IID_IUnknown = __uuidof(IUnknown);
const IID IID___x_ABI_CWindows_CWeb_CHttp_CIHttpClient = __uuidof(ABI::Windows::Web::Http::IHttpClient);
const IID IID___x_ABI_CWindows_CWeb_CHttp_CIHttpClientFactory = __uuidof(ABI::Windows::Web::Http::IHttpClientFactory);
const IID IID___x_ABI_CWindows_CWeb_CHttp_CIHttpRequestMessageFactory = __uuidof(ABI::Windows::Web::Http::IHttpRequestMessageFactory);
const IID IID___x_ABI_CWindows_CWeb_CHttp_CIHttpMethodFactory = __uuidof(ABI::Windows::Web::Http::IHttpMethodFactory);
// USB Vendor ID: 0x05AC
// USB Product ID: 0x0251
/* The upper label indicates the key's function.
* The lower label indicates the USB/HID Keyboard report value.
* The keyboard report (endpoint 0x81) has the following data structure:
* ```
* struct kdb_report {
* uint8_t modifier;
* uint8_t reserved;
#!/usr/bin/env bash
# Install Git and Golang toolchain
function gdir_env_install_pkgs
{
if [ -x "$(command -v xcode-select)" ]; then
xcode-select --install
fi
@rixtox
rixtox / Export Timing Points to OSU.py
Last active October 19, 2019 14:23
Export REAPER Tempo Markers to osu! Timing Points
import sys, os, configparser, codecs, re
sys.argv=["Main"]
import tkinter as tk
from tkinter.filedialog import asksaveasfilename
root = tk.Tk()
root.withdraw()
proj = RPR_EnumProjects(-1, "", 512)[0]
@rixtox
rixtox / gif2mp4
Last active September 14, 2019 15:54
Converts GIF to MP4 optimized for Telegram
#!/usr/bin/env bash
# Author: Rix
# Version: 0.0.1
set -eu -o errexit -o pipefail -o nounset
function print_usage {
echo 'Usage: gif2mp4 [-c] <[-r] INPUT> ...'
echo ' -c, --concat <OUTPUT> concat all inputs into single MP4'
Verifying my Blockstack ID is secured with the address 1JQ7aPR8WgdNci3nECrWidKgoeBLg5xR2t https://explorer.blockstack.org/address/1JQ7aPR8WgdNci3nECrWidKgoeBLg5xR2t
@rixtox
rixtox / .zshrc
Last active October 23, 2017 07:22
My .zshrc
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="xir"
plugins=(git extract zsh-syntax-highlighting zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
[[ -e ~/.profile ]] && emulate sh -c 'source ~/.profile'
alias ls='ls --color'
alias lsa='ls -lah'
[System.IO.File]::WriteAllText('out.ass', [System.IO.File]::ReadAllText('in.ass', [System.Text.Encoding]::GetEncoding('gb2312')), [System.Text.Encoding]::GetEncoding('utf-8'))
List of Encoding values:
[System.Text.Encoding]::GetEncodings()
Get-ChildItem .\* -Include *.ass | Rename-Item -NewName { $_.Name -replace '^.*?(\d+).*(\.\w+)$','$1$2' }