Skip to content

Instantly share code, notes, and snippets.

View abulte's full-sized avatar

Alexandre Bulté abulte

View GitHub Profile
@abulte
abulte / build_rethinkdb_wheezy.sh
Created December 7, 2012 12:58
Build RethinkDB on Debian Wheezy
# <http://www.rethinkdb.com/docs/build/>
sudo apt-get install g++ protobuf-compiler protobuf-c-compiler libprotobuf-dev \
libprotobuf-c0-dev libboost-dev libssl-dev libv8-dev libboost-program-options-dev \
libgoogle-perftools-dev jsdoc-toolkit libprotoc-dev curl exuberant-ctags m4 \
rubygems
# *carefully note all packages installed!!*
mkdir ~/tmp && cd ~/tmp
wget http://nodejs.org/dist/v0.8.15/node-v0.8.15.tar.gz
tar xvfz node-v0.8.15.tar.gz
@abulte
abulte / rethindb_ip_whitelist.sh
Created December 7, 2012 13:07
RethinkDB IP whitelist on service ports
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# set default policies to allow everything
# this should be DROP by default but out of scope...
iptables -P INPUT ACCEPT
@abulte
abulte / rpi_make_sd_macos.sh
Last active December 9, 2015 18:28
Raspberry image to sd shell script (mac os)
#!/bin/bash
EXPECTED_ARGS=2
NAME=$1
if [ $# -ne $EXPECTED_ARGS ]
then
echo "Usage: `basename $0` <partition_name> <image_path>"
echo "Example: `basename $0` disk2s1 ./rpi.img"
@abulte
abulte / bench-cb.results
Last active December 10, 2015 21:18
CubieBoard Raspbian benchmark
root@raspberrypi:/home/pi# apt-get install phoronix-test-suite
root@raspberrypi:/home/pi# cat /proc/cpuinfo
Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 1006.38
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc08
@abulte
abulte / cb-vs-rpi_disk.txt
Created January 10, 2013 12:10
RPI vs Cubie benchmark | Disk
## CUBIE BOARD
dbench version 4.00 - Copyright Andrew Tridgell 1999-2004
Running for 600 seconds with load '/usr/share/dbench/client.txt' and minimum warmup 120 secs
0 of 1 processes prepared for launch 0 sec
1 of 1 processes prepared for launch 0 sec
releasing clients
1 664 21.16 MB/sec warmup 1 sec latency 557.218 ms
1 664 10.58 MB/sec warmup 2 sec latency 1557.416 ms
@abulte
abulte / cb-vs-rpi_cpu.txt
Created January 10, 2013 12:11
Cubie vs RPI benchmark | CPU
## RPI 1/2
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing CPU performance benchmark
Threads started!
@abulte
abulte / cb-vs-rpi_ram.txt
Created January 10, 2013 12:13
Cubie vs RPI benchmark | Memory
## RPI 1/2
Long uses 4 bytes. Allocating 2*33554432 elements = 268435456 bytes of memory.
Using 262144 bytes as blocks for memcpy block copy test.
Getting down to business... Doing 10 runs per test.
0 Method: MEMCPY Elapsed: 1.72793 MiB: 128.00000 Copy: 74.077 MiB/s
1 Method: MEMCPY Elapsed: 1.72856 MiB: 128.00000 Copy: 74.050 MiB/s
2 Method: MEMCPY Elapsed: 1.73830 MiB: 128.00000 Copy: 73.635 MiB/s
3 Method: MEMCPY Elapsed: 1.72849 MiB: 128.00000 Copy: 74.053 MiB/s
4 Method: MEMCPY Elapsed: 1.72736 MiB: 128.00000 Copy: 74.102 MiB/s
@abulte
abulte / cb-vs-rpi_gtk.txt
Created January 10, 2013 12:16
Cubie vs RPI benchmark | GTK
## RPI 1/2
GtkPerf 0.40 - Starting testing: Thu Jan 10 11:44:55 2013
GtkEntry - time: 0.75
GtkComboBox - time: 10.18
GtkComboBoxEntry - time: 5.72
GtkSpinButton - time: 1.05
GtkProgressBar - time: 0.72
GtkToggleButton - time: 1.12
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@abulte
abulte / header_python.py
Created March 4, 2013 17:36
My python source header
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2013 Alexandre Bulté <alexandre[at]bulte[dot]net>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.