Skip to content

Instantly share code, notes, and snippets.

@ajgappmark
ajgappmark / remcomms.sh
Created February 16, 2018 12:28 — forked from mystix/remcomms.sh
Script to strip all C comments
# Strip C comments
# by Stewart Ravenhall <[email protected]> -- 4 October 2000
# Un-Korn-ized by Paolo Bonzini <[email protected]> -- 24 November 2000
# Strip everything between /* and */ inclusive
# Copes with multi-line comments,
# disassociated end comment symbols,
# disassociated start comment symbols,
# multiple comments per line
@ajgappmark
ajgappmark / Makefile
Created November 8, 2017 10:25 — forked from maciejjo/Makefile
Generic Makefile for a small C project
SRCDIR = src
HDRDIR = headers
OBJDIR = obj
BINDIR = bin
DEPDIR = dep
DATDIR = data
CC = gcc
TARGET = sorting
CFLAGS = -Wall -Wextra -pedantic -g -O0 -I$(HDRDIR)
@ajgappmark
ajgappmark / fsec_solve.py
Created October 15, 2017 11:51 — forked from LiveOverflow/fsec_solve.py
Fsec2017 z3 solution
from z3 import *
import struct
# calculate e,f,d for a given input password
def calc(m):
e = 0
f = 0
d = 0
for i in xrange(0, len(m)):
c = ord(m[i])
@ajgappmark
ajgappmark / VideoStream.php
Created July 9, 2017 13:29 — forked from ranacseruet/VideoStream.php
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@ajgappmark
ajgappmark / art-compile-arm.sh
Created July 9, 2017 12:15 — forked from rriley/art-compile-arm.sh
A script to use the Android ART compiler to generate ARM binaries from apk files. Tested with Android 5.1.1_r4
# How to use ART to compile arm oat files on the host:
# - Get source code according to https://source.android.com/source/downloading.html
# - source build/envsetup.sh
# - mm build-art
# - Build the full android image for aosp_arm-eng
# (Follow the directions at https://source.android.com/source/building.html)
# - Use this script in the source root directory to compile APKs
CWD=`pwd`
export ANDROID_DATA="${CWD}/out/host/datadir/dalvik-cache/x86_64"
@ajgappmark
ajgappmark / gist:55662428bea4fb1928c294e61015d850
Created July 9, 2017 12:14 — forked from rriley/gist:ce38ab20532c1d7a2667
A script to use the Android ART compiler to generate x86 binaries from apk files. Tested with Android 5.1.1_r4
# How to use ART to compile arm oat files on the host:
# - Get source code according to https://source.android.com/source/downloading.html
# - source build/envsetup.sh
# - mm build-art
# - Use this script in the source root directory to compile APKs
CWD=`pwd`
export ANDROID_DATA="${CWD}/out/host/datadir/dalvik-cache/x86_64"
export ANDROID_ROOT="${CWD}/out/host/linux-x86"
BOOT_IMAGE="${CWD}/out/host/linux-x86/framework/core.art"
@ajgappmark
ajgappmark / util.py
Created June 22, 2017 09:28 — forked from shazow/util.py
Python utility functions I wrote and use often. See https://github.com/shazow/unstdlib.py for more.
"""
Handy Python functions written by Andrey Petrov (shazow). I release this code
under public domain. (Attribution is optional but appreciated.)
Approximate changelog (according to https://gist.github.com/603374):
2011-05-05
- I made a proper github repo out of this:
https://github.com/shazow/unstdlib.py
@ajgappmark
ajgappmark / pyscript.py
Created June 17, 2017 13:16 — forked from nhoffman/pyscript.py
Python script template
#!/usr/bin/env python
"""A simple python script template.
"""
from __future__ import print_function
import os
import sys
import argparse
@ajgappmark
ajgappmark / gist:b285c1c2f159be1c8e3136b787c36ac3
Created December 23, 2016 13:41 — forked from learncodeacademy/gist:5f84705f2229f14d758d
Getting Started with Vagrant, SSH & Linux Server Administration
@ajgappmark
ajgappmark / google_drive_util.py
Created December 5, 2016 14:30 — forked from macieksk/google_drive_util.py
A simple Python module to upload files to Google Drive file upload. Needs a file 'client_secrets.json' in the directory . The file can be obtained from https://console.developers.google.com/ -- under APIs&Auth/Credentials/Create Client ID for native application
## Simple Python module to upload files to Google Drive
# Needs a file 'client_secrets.json' in the directory
# The file can be obtained from https://console.developers.google.com/
# under APIs&Auth/Credentials/Create Client ID for native application
# To test usage:
# import google_drive_util
# google_drive_util.login()
# google_drive_util.test()