Skip to content

Instantly share code, notes, and snippets.

@Lyude
Lyude / pattach.py
Last active October 2, 2017 18:40
A simple GDB plugin for attaching to processes without knowing their PID
# A simple gdb plugin for attaching to processes without knowing their PIDs
from sys import stderr
from abc import ABCMeta, abstractmethod
from datetime import datetime
from fnmatch import fnmatch, fnmatchcase
from textwrap import dedent, wrap
import platform
try:
import psutil
from ctypes import *
from ctypes.util import find_library
class LibClang(CDLL):
def __getitem__(self, name):
return super().__getitem__('clang_' + name)
libclang = LibClang(find_library('clang'))
#!/usr/bin/python3
# hidrelayd - A daemon for powering remotely controllable HID devices
#
# Copyright (C) 2017 Red Hat Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
@Lyude
Lyude / sockets.py
Created May 13, 2016 00:49 — forked from marlyn-x86/sockets.py
A thing to show packet information - currently, the notebook on the left doesn't resize nicely
import socket
from socket import (getaddrinfo)
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
url = "www.example.com"
port = 80
protocols = {
"AH" : socket.IPPROTO_AH,
@Lyude
Lyude / 01-xdc-2015-web-authentication
Created September 16, 2015 14:07
XDC 2015 Web Authentication Script
#!/bin/sh
##########################################
# Just fill in the USERNAME and PASSWORD #
# here and throw it in #
# /etc/NetworkManager/dispatcher.d #
##########################################
ESSID="SeneNET"
USERNAME="FILL_ME_IN"
PASSWORD="FILL_ME_IN"
#!/bin/sh
##### How to install #####
# Because this is a short script and it was written mainly for my own
# convenience I haven't bothered writing any installation scripts for it, and
# it's simple enough to install that I just figured I'd write the installation
# instructions here with a big header so everyone notices them.
#
# Hopefully this should go without saying, but this script requires you use
# NetworkManager for this to work. In addition, you must also have WEXT
# compatibility enabled in your kernel for cfg80211 and you must have curl
@Lyude
Lyude / envrc.sh
Last active August 29, 2015 14:01
Some awesome functions for handling per-project enviornment variables in zsh
_current_envrc=""
# Per-project enviornment variables
_envrc_handler() {
local current_dir="$(pwd -P)"
while [[ $current_dir != "" ]]; do
if [[ -e "$current_dir/.envrc" ]]; then
_load_envrc "$current_dir/.envrc"
return
@Lyude
Lyude / 5-stcc-web-authentication
Last active September 1, 2018 22:33
NetworkManager script for automatically performing web authentication with STCC's WiFi
#!/bin/sh
##### How to install #####
# Because this is a short script and it was written mainly for my own
# convenience I haven't bothered writing any installation scripts for it, and
# it's simple enough to install that I just figured I'd write the installation
# instructions here with a big header so everyone notices them.
#
# Hopefully this should go without saying, but this script requires you use
# NetworkManager for this to work. In addition, you must also have WEXT
# compatibility enabled in your kernel for cfg80211 and you must have curl
@Lyude
Lyude / e621_batch.rb
Created March 11, 2013 04:43
The yiff downloader for e621.net
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law. You can redistribute it and/or modify it under
# the terms of the Do What The Fuck You Want To License, Version 2, as published
# by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details.
require 'optparse'
require 'ostruct'
require 'rexml/element'
require 'rexml/document'
require 'net/http'