Skip to content

Instantly share code, notes, and snippets.

get Android source code: http://source.android.com/source/downloading.html
$ cd /path/to/android-src
$ cd system/core/libmincrypt/
$ gcc -c *.c -I../include
$ ar rcs libmincrypt.a *.o
$ cd ../mkbootimg
$ gcc mkbootimg.c -o mkbootimg -I../include ../libmincrypt/libmincrypt.a
$ cd ../cpio
$ gcc mkbootfs.c -o mkbootfs -I../include

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@x2c3z4
x2c3z4 / printTypeSize.c
Created May 8, 2013 14:24
print basic C type size
#include <stdio.h>
#include <stdint.h> //for intptr_t ,added in C99
#define PRINT_SIZE(type) printf("sizeof(%s)=%d\n",#type,sizeof(type))
int main()
{
PRINT_SIZE(int);
PRINT_SIZE(long);
PRINT_SIZE(intptr_t);
PRINT_SIZE(void*);
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/workqueue.h>
static void mykmod_work_handler(struct work_struct *w);
static struct workqueue_struct *wq = 0;
static DECLARE_DELAYED_WORK(mykmod_work, mykmod_work_handler);
static unsigned long onesec;
@x2c3z4
x2c3z4 / semtex.c
Created June 10, 2013 05:17 — forked from onemouth/semtex.c
/*
* linux 2.6.37-3.x.x x86_64, ~100 LOC
* gcc-4.6 -O2 semtex.c && ./a.out
* 2010 [email protected], salut!
*
* update may 2013:
* seems like centos 2.6.32 backported the perf bug, lol.
* jewgold to 115T6jzGrVMgQ2Nt1Wnua7Ch1EuL9WXT2g if you insist.
*/
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.
# Produce PDFs from all Markdown files in a directory
# Lincoln Mullen | http://lincolnmullen.com | [email protected]
# List files to be made by finding all *.md files and appending .pdf
PDFS := $(patsubst %.md,%.md.pdf,$(wildcard *.md))
# The all rule makes all the PDF files listed
all : $(PDFS)
# This generic rule accepts PDF targets with corresponding Markdown
@x2c3z4
x2c3z4 / embed.c
Created July 1, 2013 07:54 — forked from cpq/embed.c
// Copyright (c) Sergey Lyubka, 2013.
// All rights reserved.
// This program is used to embed arbitrary data into a C binary. It takes
// a list of files as an input, and produces a .c data file that contains
// contents of all these files as collection of char arrays.
// Usage:
// 1. Compile this file:
// cc -o embed embed.c
//
#!/bin/bash
# ©opyright 2009 - killadaninja - Modified G60Jon 2010
# airssl.sh - v1.0
# visit the man page NEW SCRIPT Capturing Passwords With sslstrip AIRSSL.sh
# Network questions
echo
echo "AIRSSL 2.0 - Credits killadaninja & G60Jon "
echo
route -n -A inet | grep UG
function sleep(ms) {
var start = new Date().getTime(), expire = start + ms;
while (new Date().getTime() < expire) { }
return;
}
//in [http://hrclub.jxrcw.com/HRManage/BestEmployers/Code.html?height=130&width=300&modal=true&ip=182.18.102.41&jx=%E5%8D%81%E4%BD%B3%E4%BA%BA%E5%8A%9B%E8%B5%84%E6%BA%90%E7%BB%8F%E7%90%86%E4%BA%BA%E5%A5%96&voteid=2886&lx=0].
var i;
for(i=0;i<500;i++){
var v1 = Math.ceil(Math.random()*(255-1)+1);
var v2 = Math.ceil(Math.random()*(255-1)+1);