Skip to content

Instantly share code, notes, and snippets.

View wojons's full-sized avatar

Alexis Okuwa wojons

View GitHub Profile
@wojons
wojons / gist:4290902
Last active October 14, 2015 02:07 — forked from cmer/gist:1566734
apt-get install -y build-essential libx11-dev libgl1-mesa-dev libxext-dev perl perl-modules make
cd /tmp
wget http://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz
tar xzvf UnixBench5.1.3.tgz
cd UnixBench
./Run
@wojons
wojons / gist:6154645
Created August 5, 2013 09:35
nginx dont retry next upstream on post or put when timeout error
upstream mash {
ip_hash;
server 127.0.0.1:8081;
server 192.168.0.11:8081;
}
server {
location / {
if ($request_method = POST ) {
// Data inserted
r.db('test').table('multi').insert({
id:1,
field: [
{key1: 1}, {key1: 2}, {key1: 3}
]
})
r.db('test').table('multi').insert({
id:2,
field: [
@wojons
wojons / test query
Created November 25, 2013 08:21 — forked from AtnNn/test query
r.table('lexi2').insert([
{net:{lo:{tx:1, rx:2}, eth0:{tx:2, rx:4}}},
{net:{lo:{tx:4, rx:6}, wl0ps4:{tx:7, rx:1}}},
{net:{lo:{tx:14, rx:8}, eth0:{tx:1, rx:5}}}])
r.table('lexi2').reduce(
function(left, right){
return { net:
left('net').keys().setUnion(right('net').keys()).map(
function(iface){
@wojons
wojons / temp.php
Last active December 31, 2015 17:29
issue with filtering floats in rethinkdb on php driver output
```php
<?php
object(r\Filter)#65 (2) {
["positionalArgs":"r\Query":private]=>
array(2) {
[0]=>
object(r\Table)#67 (2) {
["positionalArgs":"r\Query":private]=>
array(1) {
[0]=>
#!/bin/bash
# Splits a given table into n evenly-spaced shards.
# call with ./split-table <tablename> <numshards>
table=$1
shards=$2
cluster="localhost:29015"
splits=`seq 0 $((16**4/$shards)) $((16**4+1)) \
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
import httplib
import urllib2
import ssl
import certifi
from backports.ssl_match_hostname import match_hostname
class CertValidatingHTTPSConnection(httplib.HTTPConnection):
default_port = httplib.HTTPS_PORT
@wojons
wojons / crash.log
Created May 4, 2014 05:32
rethinkdb 1.12.3 crash
error: Error in ./src/buffer_cache/alt/alt.hpp at line 327:
error: Guarantee failed: [block_size == lock_->cache()->max_block_size().value()]
error: Backtrace:
addr2line: 'rethinkdb': No such file
error: Sun May 4 07:30:26 2014
1: backtrace_t::backtrace_t() at 0x115e872 (rethinkdb)
2: lazy_backtrace_formatter_t::lazy_backtrace_formatter_t() at 0x115eb6d (rethinkdb)
3: format_backtrace(bool) at 0x115fdd1 (rethinkdb)
4: report_fatal_error(char const*, int, char const*, ...) at 0x11ace15 (rethinkdb)
@wojons
wojons / 1 of 4 nodes
Last active August 29, 2015 14:02
rethinkdb-crash-1.2.5 6/16/14
error: Error in src/rdb_protocol/btree.cc at line 532:
error: Guarantee failed: [!mod_info->deleted.second.empty() && mod_info->added.second.empty()]
error: Backtrace:
addr2line: 'rethinkdb': No such file
error: Thu May 29 02:14:37 2014
1: backtrace_t::backtrace_t() at 0x115e912 (rethinkdb)
2: lazy_backtrace_formatter_t::lazy_backtrace_formatter_t() at 0x115ec0d (rethinkdb)
3: format_backtrace(bool) at 0x115fe71 (rethinkdb)
4: report_fatal_error(char const*, int, char const*, ...) at 0x11aceb5 (rethinkdb)