Skip to content

Instantly share code, notes, and snippets.

View tyilo's full-sized avatar
👀

Asger Hautop Drewsen tyilo

👀
View GitHub Profile

This doesn't work with OS X 10.9 or later. If you want to build gdb-ng either use Mountain Lion or ask gdbinit (github)/osxreverser (twitter)/fractalg (irc) to fix it for you ;^)

Install darwinbuild:

sudo port install darwinbuild

Download and pack gdb-ng:

cd /tmp
wget --no-check-certificate https://github.com/gdbinit/gdb-ng/archive/master.zip
@tyilo
tyilo / min-coin-bruteforce.py
Last active December 16, 2015 13:48
The minimum coin problem solution in python
coins_values = [2, 1, 0.5, 0.2, 0.1, 0.05, 0.02, 0.01]
coins_amount = [1, 2, 2, 3, 1, 2, 2, 2 ]
price = 1.7
import itertools
total_coins = 0
coins_list = []
int main(void) {
// Signature of setState
void (*setState)(BOOL);
void *handle = dlopen("/path/to/lib.dylib", RTLD_LAZY);
*(void **) (&setState) = dlsym(handle, "setState");
// To enable
setState(YES);
@tyilo
tyilo / DES crypt.js
Created July 9, 2013 01:57
JS DES crypt
/* JavaScript password hash generator.
* $Id: pwd.js,v 1.5 2004/10/09 09:41:38 emikulic Exp $
*
* Copyright (c) 2004, Emil Mikulic.
* 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
qpdf --password=[password] --decrypt [in] [out]
// ==UserScript==
// @id chrome-image-form-crash@tyilo.com
// @name Chrome Crash Test: Insert form on image and submit
// @version 1.0
// @namespace http://tyilo.com/
// @author Asger Drewsen <asgerdrewsen@gmail.com>
// @description ...
// @include http://www.w3.org/Graphics/PNG/alphatest.png
// @run-at document-end
// ==/UserScript==
#!/bin/bash
# Install sleepwatcher
cd /tmp
curl -O http://www.bernhard-baehr.de/sleepwatcher_2.2.tgz
tar -zxvf sleepwatcher_2.2.tgz
cd sleepwatcher_2.2
sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
sudo cp sleepwatcher /usr/local/sbin
sudo cp sleepwatcher.8 /usr/local/share/man/man8
sudo cp config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents
@tyilo
tyilo / gist:328cff50b7632c76b50f
Last active February 7, 2017 07:28
Cycript wishlist
  • autocomplete for native functions:
    • a = new Pointer(0x1337, @encode(void)); a.<tab>
  • system.print that prints to cycript console when injected into a process
default partial alphanumeric_keys
xkb_symbols "basic" {
include "us(basic)"
name[Group1]= "English (US, with æøå)";
key <AD11> { [ bracketleft, braceleft, aring, Aring ] };
key <AC10> { [ semicolon, colon, ae, AE ] };
key <AC11> { [ apostrophe, quotedbl, oslash, Ooblique ] };