Skip to content

Instantly share code, notes, and snippets.

package main
import (
"image"
"image/color"
"log"
"github.com/mewkiz/pkg/imgutil"
)
@mewmew
mewmew / bindsh.c
Last active August 29, 2015 14:09
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <arpa/inet.h>
int main(int argc, char **argv) {
int lsock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(lsock == -1) {
fprintf(stderr, "socket() failed.\n");
@mewmew
mewmew / nested.go
Created April 18, 2015 20:00
Generate C programs for stress testing.
// nested is a tool which generates C programs with a given number of nested if-
// statements. These programs are intended to stress test the implementations of
// various decompilation components and give an approximation of their time
// complexity.
//
// Example output for n=2:
//
// int main(int argc, char **argv) {
// int x = 0;
// if (x < 1) {
@mewmew
mewmew / crawl.go
Last active August 9, 2016 01:20
Identify broken links based on GitHub directory listing.
// Based on https://github.com/PuerkitoBio/gocrawl/blob/master/examples_test.go
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
@mewmew
mewmew / flavor.rb
Created November 15, 2016 09:31 — forked from ttscoff/flavor.rb
Quick wrapper to convert Markdown to HTML via Github API
#!/usr/bin/ruby
# Convert a Markdown README to HTML with Github Flavored Markdown
# Github and Pygments styles are included in the output
#
# Requirements: json gem (`gem install json`)
#
# Input: STDIN or filename
# Output: STDOUT
# Arguments: "-c" to copy to clipboard (or "| pbcopy"), or "> filename.html" to output to a file
# cat README.md | flavor > README.html
digraph {
rankdir=LR
{rank=same; binary unpacker upx}
nodesep=0.5
/* input and output formats */
"Mach-O Universal static library" [fillcolor=limegreen style=filled]
archive [fillcolor=limegreen style=filled]
elf [fillcolor=limegreen style=filled]
pe [fillcolor=limegreen style=filled]
@mewmew
mewmew / PKGBUILD
Created January 21, 2018 17:03
AUR PKGBUILD for PhysicsFS with MPQ files support.
pkgname=physfs-git
pkgver=12
pkgrel=1
pkgdesc="A library to provide abstract access to various archives"
arch=('x86_64')
url="https://github.com/dgengin/physfs"
license=('ZLIB')
depends=('zlib')
makedepends=('git' 'cmake' 'doxygen')
provides=("physfs")
@mewmew
mewmew / web-servers.md
Created February 15, 2018 13:06 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mewmew
mewmew / lldb-basics.md
Created April 22, 2018 19:12 — forked from youfoundron/lldb-basics.md
lldb basics

#LLDB Basics A basic overview of lldb for personal reference.
Official documentation can be found here here.

##Command Structure General syntax

<noun> <verb> [-options [option-value]] [argument [argument...]]
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#include <pthread.h>
void * f(void *data) {
struct timespec start;
clock_gettime(CLOCK_REALTIME, &start);