Skip to content

Instantly share code, notes, and snippets.

@Happyholic1203
Happyholic1203 / copy.py
Created May 17, 2017 03:32 — forked from vpontis/copy.py
Copy to clipboard from iPython on Mac OS X
"""
Add copy to clipboard from IPython!
To install, just copy it to your profile/startup directory, typically:
~/.ipython/profile_default/startup/
Example usage:
%copy hello world
# will store "hello world"
@Happyholic1203
Happyholic1203 / codesign_gdb.md
Created January 23, 2018 14:15 — forked from hlissner/codesign_gdb.md
Codesign gdb on OSX

Note: these instructions are for pre-Sierra MacOS. Sierra Users: see https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d by @gravitylow.

If you are getting this in gdb on OSX while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
@Happyholic1203
Happyholic1203 / system_uuid.sh
Created March 9, 2018 08:51 — forked from bencord0/system_uuid.sh
Unique id for a linux system
#!/bin/bash
cat /var/lib/dbus/machine-id && exit
# Provided by dbus, hence available on all systemd systems.
# Any user can read it and it is persistent accross boots.
# It is unique per installation, and works well in VMs.
# Not all systems (i.e. stage3 gentoo/handbook install)
# have dbus installed by default.
cat /sys/class/dmi/id/product_uuid && exit
@Happyholic1203
Happyholic1203 / heartbleed.py
Created February 26, 2019 01:31 — forked from eelsivart/heartbleed.py
Heartbleed (CVE-2014-0160) Test & Exploit Python Script
#!/usr/bin/python
# Modified by Travis Lee
# Last Updated: 4/21/14
# Version 1.16
#
# -changed output to display text only instead of hexdump and made it easier to read
# -added option to specify number of times to connect to server (to get more data)
# -added option to send STARTTLS command for use with SMTP/POP/IMAP/FTP/etc...
# -added option to specify an input file of multiple hosts, line delimited, with or without a port specified (host:port)
@Happyholic1203
Happyholic1203 / fast_tail_using_mmap.py
Created October 9, 2020 03:59
Fast tail(1) implementation using mmap in Python
import os
import sys
import mmap
def tail(filepath, numlines):
with open(filepath, 'rb') as f:
mapped = mmap.mmap(f.fileno(), 0, mmap.MAP_SHARED, mmap.PROT_READ)
size = os.stat(filepath).st_size
try:
@Happyholic1203
Happyholic1203 / karabiner.json
Created November 7, 2020 03:26
Karabiner settings for UHK Simulation
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {