Skip to content

Instantly share code, notes, and snippets.

@nomand
nomand / AppleWKRemapper.ahk
Last active December 2, 2021 02:05 — forked from TheZoc/AppleWKRemapper.ahk
AutoHotKey script that allows Apple wireless keyboard work in Windows 10 with some layout changes. See header for details and credits to original authors and modders.
;===========================================================================================================================================
; Additional Modifications by nomand
;==========================================================================================================================================
;
; - fixed Media_Next functinality
; - moved Eject key screenshots to active window screenshot shortcut (Ctrl+F3)
; - restored Lctrl <> Fn swap
; - restored page up/down, home/end functinality
; - F12 Insert remap kept disabled
; - cleaned up code indentations and comments
@dnikonov
dnikonov / TEAMVIEWER: MAC OS CHANGE ID
Created April 11, 2014 15:38
TEAMVIEWER: MAC OS CHANGE ID
defaults delete ~/Library/Preferences/com.teamviewer.teamviewer9.plist
defaults delete ~/Library/Preferences/com.teamviewer.teamviewer9.Machine.plist
sudo defaults delete /Library/Preferences/com.teamviewer.teamviewer9.plist
rm -f ~/Library/Preferences/com.teamviewer.teamviewer9.plist
rm -f ~/Library/Preferences/com.teamviewer.teamviewer9.Machine.plist
sudo rm -f /Library/Preferences/com.teamviewer.teamviewer9.plist
@piki
piki / mmap.c
Created May 7, 2013 15:53
some fun with mmap and madvise
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#define CHECK(thing) if (!(thing)) { perror(#thing); exit(1); }
#define MAX_PAGE_IN 104857600
@alphazo
alphazo / gist:3303282
Created August 9, 2012 11:03
Clone MiFare cards using chinesse UUID writable cards

libnfc supports UUID writable cards and even has some dedicated tools for them.

However it doesn't work with some of the cards found on eBay that are even simpler to use. Sector 0 is unlocked and can be written without any additional commands. libnfc requires a small patch to get it working.

Following has been tested under ArchLinux with modified libnfc 1.5.1, mfoc 0.10.2 and a SCL3711 dongle.

Patch & recompile libnfc

The patch is fairly simple, open libnfc-1.5.1/utils/nfc-mfclassic.c and comment 2 lines (it was lines 384 and 385 for me):

// Try to write the trailer

@techtonik
techtonik / caller_name.py
Created March 21, 2012 19:29
Python - inspect - Get full caller name (package.module.function)
# Public Domain, i.e. feel free to copy/paste
# Considered a hack in Python 2
import inspect
def caller_name(skip=2):
"""Get a name of a caller in the format module.class.method
`skip` specifies how many levels of stack to skip while getting caller
name. skip=1 means "who calls me", skip=2 "who calls my caller" etc.
@e000
e000 / socks.py
Created March 14, 2011 20:21
socksipy + urllib2 handler
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,