Skip to content

Instantly share code, notes, and snippets.

View lkraider's full-sized avatar

Paul Eipper lkraider

View GitHub Profile
@lkraider
lkraider / mac-osx-el-captain-commands.sh
Last active April 24, 2016 11:00 — forked from rahul286/mac-osx-el-captain-commands.sh
Updating to Mac El Capitan using downloaded pkg file
#!/bin/sh
set -ex
## El Capitan Download
## based on https://github.com/lioonline/OS-X-El-Capitan
## and https://7labs.heypub.com/tips-tricks/el-capitan-direct-download.html
## pkg file link - version 10.11.4
HOST="http://osxapps.itunes.apple.com"
PATH="/apple-assets-us-std-000001/Purple69/v4/6a/c9/bc/6ac9bcc0-71a4-9b73-bb59-c1b053df10b9/"
@lkraider
lkraider / generator.py
Created April 4, 2016 17:17
Terraform AWS policy generator
#!/usr/bin/env python
"""Convert CSV policies into AWS JSON format."""
import json
import csv
POLICIES = 'terraform.csv'
CRUD_COL = 2
ACTION_COL = 3
@lkraider
lkraider / decorator-class-example.py
Created March 9, 2016 01:50
Python decorator class example
from datetime import datetime
import functools
class convert_argument(object):
def __init__(self, data_type):
print '__init__(data_type="%s")' % data_type
self.prefix_converter = 'convert_'
self.data_type = data_type
@lkraider
lkraider / report-0ed362.html
Created December 3, 2015 22:47
Atlas-iOS ATLMediaInputStream.m leaks
<!doctype html>
<html>
<head>
<title>Atlas-iOS/Code/Utilities/ATLMediaInputStream.m</title>
<style type="text/css">
body { color:#000000; background-color:#ffffff }
body { font-family:Helvetica, sans-serif; font-size:10pt }
h1 { font-size:14pt }
.code { border-collapse:collapse; width:100%; }
.code { font-family: "Monospace", monospace; font-size:10pt }
@lkraider
lkraider / sol.py
Last active August 28, 2015 16:36 — forked from CleitonDeLima/sol.py
import fileinput
MAX = 0
P = 10000
def identidade(matriz):
for i in range(MAX):
for j in range(MAX):
matriz[i][j] = int((i == j))
@lkraider
lkraider / async-socket.py
Created August 14, 2014 23:13
Example of using gevent for async socket server and client
import gevent
import gevent.server
import gevent.monkey
gevent.monkey.patch_all()
import socket
import string
import random
import filecmp
@lkraider
lkraider / custom_schematics_type.py
Last active December 18, 2015 22:38 — forked from JensRantil/custom_schematics_type.py
Demonstrating the convert -> validate -> primitive structure
#!/bin/env python2.7
from schematics.models import Model
from schematics.types import StringType
from schematics.exceptions import ValidationError
class EventType(StringType):
DIVIDER = ':'
import unittest
import hashlib
from schematics.models import Model
from schematics.types import IntType, StringType, MD5Type
from schematics.exceptions import ValidationError
class TestTransformers(unittest.TestCase):
@lkraider
lkraider / BasicExample.md
Last active December 14, 2015 13:28 — forked from zdne/BasicExample.md

Format: 1A Host: http://blog.acme.com

Basic ACME Blog API

Welcome to the ACME Blog API. This API provides access to the ACME Blog service.


@lkraider
lkraider / adf2mp3.py
Created November 2, 2011 22:40
GTA Vice City ADF to MP3 audio converter
#!/usr/bin/env python
import sys
import os
def adf2mp3(input_path, output_path, buffer_size=1024*1024):
print 'Converting', output_path
input_file = open(input_path, 'rb')
output_file = open(output_path, 'wb')
for read_buffer in iter(lambda: input_file.read(buffer_size), ''):