Skip to content

Instantly share code, notes, and snippets.

View abulte's full-sized avatar

Alexandre Bulté abulte

View GitHub Profile
@abulte
abulte / Dockerfile
Created November 1, 2015 18:46
Node Dockerfile / Docker-Compose
FROM node:0.12
EXPOSE 3000
RUN mkdir /code
WORKDIR /code
COPY package.json /code/
RUN npm install
RUN npm install -g nodemon
ADD . /code
@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_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
@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_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!
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/.
@abulte
abulte / forms.html
Last active December 15, 2015 13:08 — forked from gnunicorn/forms.html
Jinja2 macros for TW Bootstrap, updated to work with 2.3.
<!-- https://gist.github.com/abulte/5264753 -->
{%- macro form_field_label(field) -%}
<label class="control-label" for="{{ field.id }}">{{ field.label.text }}
{%- if field.flags.required -%}
<abbr title="Required"> *</abbr>
{%- endif %}</label>
{% endmacro %}
{%- macro form_field_help(help) -%}