<commit_before># gammaray

gammaray is a system implementing disk-based introspection for virtual
machines.  It thus far works with VMs that have disks virtualized via QEMU;
however, this limitation is only due to the scarcity of developer time.
Conceptually, and practically, gammaray can perform introspection with any
source of raw disk writes.  The instructions below assume an Ubuntu 12.04 LTS
host, although they should be similar for most distributions of Linux.

## Dependencies

The following libraries are needed to build and execute gammaray (most
developers can skip the Python libraries):

1. hiredis [BSD 3-clause] - the Redis client-side library

   ```bash
   sudo apt-get install libhiredis-dev libhiredis0.10
   ```
2. bson [Optional, BSD 3-clause] - Python BSON library
3. redis-py [Optional, MIT] - Python hiredis wrapper

The Python libraries are optional if you want to write or execute Python
monitors consuming gammaray's publish-subscribe stream of file-level updates.

In addition to `libhiredis`, gammaray requires a slightly modified version of
QEMU.  Clone the QEMU repository, apply a patch for gammaray support, and then
compile a gammaray-friendly QEMU.

1. git clone...
2. git apply...
3. enjoy!

## Installation Procedure<commit_msg>gammaray: adding in custom QEMU to README<commit_after># gammaray

gammaray is a system implementing disk-based introspection for virtual
machines.  It thus far works with VMs that have disks virtualized via QEMU;
however, this limitation is only due to the scarcity of developer time.
Conceptually, and practically, gammaray can perform introspection with any
source of raw disk writes.  The instructions below assume an Ubuntu 12.04 LTS
host, although they should be similar for most distributions of Linux.

## Dependencies

The following libraries are needed to build and execute gammaray (most
developers can skip the Python libraries):

1. hiredis [BSD 3-clause] - the Redis client-side library

   ```bash
   sudo apt-get install libhiredis-dev libhiredis0.10
   ```

2. bson [Optional, BSD 3-clause] - Python BSON library
3. redis-py [Optional, MIT] - Python hiredis wrapper

The Python libraries are optional if you want to write or execute Python
monitors consuming gammaray's publish-subscribe stream of file-level updates.

In addition to `libhiredis`, gammaray requires a slightly modified version of
QEMU.  Clone the QEMU repository, apply a patch for gammaray support, and then
compile a gammaray-friendly QEMU.

1. Get the official QEMU source tree
 
   ```bash
   git clone git://git.qemu-project.org/qemu.git
   ```

2. Checkout a specific tagged commit to apply our patch cleanly
   
   ```bash
   git checkout v1.4.0
   ```

3. Get our patch

   ```bash
   git clone https://gist.github.com/5ceeccdf6107222b256a.git
   ```  

4. Apply the patch to your checked out QEMU tree

   ```bash
   git apply binary_tracing_block_qemu_1-4-0.patch
   ```

5. Configure QEMU, remember to change the prefix as needed

   ```bash
   ./configure \
    --enable-system \
    --disable-user \
    --enable-kvm \
    --enable-trace-backend=stderr \
    --target-list='i386-softmmu i386-linux-user x86_64-linux-user x86_64-softmmu' \
    --prefix=/home/wolf/qemu_bin \
    --static
   ```
   
6. Make, and make install QEMU.

   ```bash
   make
   make install
   ```

7. QEMU binaries with the patch compiled in should within the `prefix`
   folder, specifically inside the `bin` subfolder.

## Installation Procedure
{'fraction_non_alphanumeric': 0.07112130771436766, 'fraction_numerical': 0.01864066532836249, 'mean_word_length': 3.675603217158177, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2691684', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1021, 'n_words': 445}