Skip to content

Instantly share code, notes, and snippets.

View kyleterry's full-sized avatar

Kyle Terry kyleterry

View GitHub Profile
import env.common
import os
from fabric.api import env, cd, sudo, run, local, abort, task, prompt
from fabric.contrib import django
from lib.aquameta.fabric_utils import (virtualenv, database, raw_connection,
check_for_database_existence, yes_no_prompt,
env_apply_json_file)
from urllib import urlencode
from urllib2 import urlopen
import json
<<<<<<< HEAD
check(fread(tmp_key, sizeof(char), KEY_SIZE, fd) > 0, "Error reading");
check(fread(&value_size, sizeof(size_t), 1, fd) > 0, "Error reading");
=======
fread_res = fread(tmp_key, sizeof(char), KEY_SIZE, fd);
if (!fread_res)
ol_log_msg(LOG_WARN, "Could not read key.\n");
fread_res = fread(&value_size, sizeof(size_t), 1, fd);
if (!fread_res)
ol_log_msg(LOG_WARN, "Could not read value_size.\n");
<<<<<<< HEAD
$(cc) $(CFLAGS) $(INCLUDES) -o $(LIB_DIR)liboleg.so murmur3.o logging.o dump.o aol.o oleg.o -fpic -shared $(MATH_LINKER)
$(cc) $(CFLAGS) $(INCLUDES) -L$(LIB_DIR) -o $(LIB_DIR)libolegserver.so port_driver.o -fpic -shared $(MATH_LINKER) -loleg
=======
$(cc) $(CFLAGS) $(INCLUDES) -o $(LIB_DIR)liboleg.so murmur3.o logging.o dump.o oleg.o -fpic -shared $(MATH_LINKER)
$(cc) $(CFLAGS) $(INCLUDES) -L$(ERLLIBS) -L$(LIB_DIR) -o $(LIB_DIR)libolegserver.so port_driver.o -fpic -shared $(MATH_LINKER) -loleg -lei
>>>>>>> master
Breakpoint 1, test_jar () at ./src/test.c:57
57 int test_jar() {
(gdb) l
52 ol_log_msg(LOG_INFO, "Generated max is: %i", expected_bucket_max);
53 ol_close(db);
54 return 0;
55 }
56
57 int test_jar() {
58 ol_database *db = ol_open(DB_PATH, DB_NAME, OL_SLAUGHTER_DIR);
kyle@little-01:~$ tenyks /etc/tenyks/settings.py
Traceback (most recent call last):
File "/usr/local/bin/tenyks", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2823, in <module>
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 710, in subscribe
callback(dist)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2823, in <lambda>
add_activation_listener(lambda dist: dist.activate())
$ valgrind ./build/bin/oleg_test test
==18015== Memcheck, a memory error detector
==18015== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==18015== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==18015== Command: ./build/bin/oleg_test test
==18015==
valgrind: Fatal error at startup: a function redirection
valgrind: which is mandatory for this platform-tool combination
valgrind: cannot be set up. Details of the redirection are:
[ OK kyle@insomnia:~ ]
$ curl -vvvv -X POST -d 'testing' http://localhost:8080/test --header "Content-Type: text/html"
* Hostname was NOT found in DNS cache
* Trying ::1...
* connect to ::1 port 8080 failed: Connection refused
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /test HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:8080
<!doctype html>
<html>
<head>
<title>Kyle Terry: Entropy Meter is at 45%</title>
<style type="text/css">
body {
font-family: helvetica;
}
</style>
</head>
[ OK kyle@nebula:~/src/personal/Project-Oleg ]
[ [git:master] ]
$ make
gcc -std=gnu99 -Wall -Werror -g3 -O2 -I./include -I/usr/local/Cellar/erlang/R16B03/lib/erlang/usr/include/ -I/usr/local/Cellar/erlang/R16B03/lib/erlang/lib/erl_interface-3.7.15/include/ -c -fPIC src/murmur3.c
gcc -std=gnu99 -Wall -Werror -g3 -O2 -I./include -I/usr/local/Cellar/erlang/R16B03/lib/erlang/usr/include/ -I/usr/local/Cellar/erlang/R16B03/lib/erlang/lib/erl_interface-3.7.15/include/ -c -fPIC src/oleg.c
gcc -std=gnu99 -Wall -Werror -g3 -O2 -I./include -I/usr/local/Cellar/erlang/R16B03/lib/erlang/usr/include/ -I/usr/local/Cellar/erlang/R16B03/lib/erlang/lib/erl_interface-3.7.15/include/ -c -fPIC src/dump.c
gcc -std=gnu99 -Wall -Werror -g3 -O2 -I./include -I/usr/local/Cellar/erlang/R16B03/lib/erlang/usr/include/ -I/usr/local/Cellar/erlang/R16B03/lib/erlang/lib/erl_interface-3.7.15/include/ -c -fPIC src/logging.c
gcc -std=gnu99 -Wall -Werror -g3 -O2 -I./include -I/usr/local/Cellar/erlang/R16B03/lib/erlang/usr/include/ -I/usr/local/Ce
-O2:
real 0m7.613s
user 0m4.020s
sys 0m0.570s
-O3:
real 0m7.617s
user 0m4.030s
sys 0m0.570s