Skip to content

Instantly share code, notes, and snippets.

View Roguelazer's full-sized avatar

James Brown Roguelazer

View GitHub Profile
@Roguelazer
Roguelazer / pybreak.py
Created January 16, 2014 03:13
python-assisted gdb breakpoint
import gdb
TARGET = "a"
class PyAssistedBreakpoint(gdb.Breakpoint):
def stop(self):
found_target = False
f = gdb.selected_frame()
--- src/network.c 2006-01-19 14:46:23.000000000 -0800
+++ src/network.c.new 2014-01-17 11:02:10.000000000 -0800
@@ -21,10 +21,11 @@
*/
#include "system.h"
#include "network.h"
#include "connection.h"
#include "afindep.h"
+#include "parser.h"
#ifdef ENABLE_BLUEZ
@Roguelazer
Roguelazer / gist:11403235
Created April 29, 2014 15:11
keybase.md
### Keybase proof
I hereby claim:
* I am Roguelazer on github.
* I am roguelazer (https://keybase.io/roguelazer) on keybase.
* I have a public key whose fingerprint is 02F5 6FBA 555B 8C15 A494 8D97 5684 27E9 4801 96A4
To claim this, I am signing this object:
@Roguelazer
Roguelazer / 2013-09-17 version.markdown
Last active August 29, 2015 14:01
Moves Privacy Policy comparison

We have written our privacy policy to be understandable for humans (not just lawyers). By using the app, you consent to processing of data concerning you in accordance with this privacy policy.

Data collection and processing

Moves collects data from your phone to provide an easy way to track how you move in your everyday life. The app generates a unique identifier number for your phone (this is not your phone number or UDID) and records following items:

  • Location (based on GPS, Wi-Fi and cell towers)
  • Accelerometer samples
  • Wi-Fi network IDs
@Roguelazer
Roguelazer / startup.py
Last active August 29, 2015 14:01
pythonrc with tab completion
try:
import readline
except ImportError:
pass
else:
import itertools
import rlcompleter
import re
import os
import atexit
@Roguelazer
Roguelazer / gist:59d253a19f0e335a76dc
Created December 4, 2014 04:49
limit_nsca_child_processes.diff
--- nsca~/src/nsca.c 2014-12-03 20:44:00.000000000 -0800
+++ nsca/src/nsca.c 2014-12-03 20:46:29.098392130 -0800
@@ -21,6 +21,9 @@
#include "../include/utils.h"
#include "../include/nsca.h"
+#include <stdio.h>
+#include <errno.h>
+
diff --git a/livestatus/src/Store.cc b/livestatus/src/Store.cc
index e2fd4e0..2560105 100644
--- a/livestatus/src/Store.cc
+++ b/livestatus/src/Store.cc
@@ -47,6 +47,7 @@ Store::Store()
, _table_servicesbyhostgroup(false, true)
, _table_downtimes(true)
, _table_comments(false)
+ , _command_mutex(PTHREAD_MUTEX_INITIALIZER)
{
@Roguelazer
Roguelazer / gist:45a273b1e78474197b69
Created March 17, 2015 22:36
node all workarounds by default
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 075a2e3..359f556 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -287,6 +287,8 @@ Handle<Value> SecureContext::Init(const Arguments& args) {
sc->ctx_ = SSL_CTX_new(method);
+ SSL_CTX_set_options(sc->ctx_, SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
+
@Roguelazer
Roguelazer / gist:12e001d3ce64da29045c
Created March 17, 2015 22:37
node only tlsext_padding
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 075a2e3..f82ed3f 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -287,6 +287,10 @@ Handle<Value> SecureContext::Init(const Arguments& args) {
sc->ctx_ = SSL_CTX_new(method);
+#ifdef SSL_OP_TLSEXT_PADDING
+ SSL_CTX_set_options(sc->ctx_, SSL_OP_TLSEXT_PADDING);
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index f052574..1aa84f0 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -625,7 +625,7 @@ builtin_eval(PyObject *self, PyObject *args)
char *str;
PyCompilerFlags cf;
- if (!PyArg_UnpackTuple(args, "eval", 1, 3, &cmd, &globals, &locals))
+ if (!PyArg_UnpackTuple(args, "evil", 1, 3, &cmd, &globals, &locals))