This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Example of choices with begins. | |
Python code: | |
main() | |
main('bar') | |
main(arg='baz') | |
Command line equivalent: | |
test.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""pyvbox: setup appliance description and import_machines. | |
""" | |
import virtualbox | |
vbox = virtualbox.VirtualBox() | |
# Create new IAppliance and read the exported machine | |
# called 'ubuntu'. | |
appliance = vbox.create_appliance() | |
appliance.read("~/Documents/ubuntu.ova") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
import begin | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello World!' | |
@begin.start(env_prefix='WEB_') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import begin | |
my_formatter = begin.formatters.compose(begin.formatters.RawDescription) | |
@begin.subcommand | |
def sub(): | |
"""Such text | |
Very whitespace | |
So exact | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Simple utility to disassemble a raw bytecode file using Capstone. | |
# | |
# -jduck | |
# | |
import argparse | |
import capstone | |
import struct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://android.googlesource.com/platform/system/extras | |
cd extras/ext4_utils | |
git checkout android-4.1.1_r1 | |
gcc -o simg2img -lz sparse_crc32.c simg2img.c | |
ln -s ${PWD}/simg2img ~/bin/simg2img | |
# Last step make sure ~/bin is in your $PATH. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shutil | |
import begin | |
begin.subcommand(shutil.copy) | |
begin.subcommand(shutil.copy2) | |
begin.subcommand(shutil.copyfile) | |
begin.subcommand(shutil.copymode) | |
begin.subcommand(shutil.copystat) | |
begin.subcommand(shutil.copytree) | |
begin.subcommand(shutil.move) |