Skip to content

Instantly share code, notes, and snippets.

View almet's full-sized avatar
🗺️

Alexis Métaireau almet

🗺️
View GitHub Profile
@almet
almet / -.diff
Last active August 26, 2015 13:31
diff --git a/test/integration_test.js b/test/integration_test.js
index f6abc36..f159a9c 100644
--- a/test/integration_test.js
+++ b/test/integration_test.js
@@ -18,15 +18,16 @@ const TEST_KINTO_SERVER = "http://0.0.0.0:8888/v1";
const PSERVE_EXECUTABLE = process.env.KINTO_PSERVE_EXECUTABLE || "pserve";
const KINTO_CONFIG = __dirname + "/kinto.ini";
-describe("Integration tests", () => {
+describe.only("Integration tests", () => {
@almet
almet / -
Created August 26, 2015 13:39
diff --git a/test/integration_test.js b/test/integration_test.js
index f6abc36..7d0aa43 100644
--- a/test/integration_test.js
+++ b/test/integration_test.js
@@ -18,11 +18,12 @@ const TEST_KINTO_SERVER = "http://0.0.0.0:8888/v1";
const PSERVE_EXECUTABLE = process.env.KINTO_PSERVE_EXECUTABLE || "pserve";
const KINTO_CONFIG = __dirname + "/kinto.ini";
-describe("Integration tests", () => {
+describe.only("Integration tests", () => {
@almet
almet / hawkauth.py
Created May 27, 2014 20:58
mohawk + requests = <3
class HawkAuth(AuthBase):
def __init__(self, hawk_credentials):
self.hawk_credentials = hawk_credentials
def __call__(self, r):
content_type = r.headers.get('Content-Type', '')
sender = mohawk.Sender(
self.hawk_credentials,
r.url,
r.method,
@almet
almet / README.rst
Last active August 29, 2015 14:03 — forked from vleborgne/anxwall.py

Comment installer le tweetwall de la cantine ?

C'est parti:

$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
@almet
almet / README.rst
Last active August 29, 2015 14:05 — forked from Natim/README.rst

Ramp Up

The problem

The idea of the ramp up is to have a scalable way to activate a software feature slowly so that the scale is handled.

If you have let say 10 million users and you want to launch a most wanted feature.

#!/bin/bash
host=$1
redis-cli -h $host info
echo -e "========\n\n"
for key in "spurl" "callurl" "userUrls" "call" "userCalls" "callstate" "hawkuser" "userid" "hawk" "oauth.token" "oauth.state"
do
echo -n "Number of keys for $key "
@almet
almet / nginx
Created October 31, 2014 15:36
Nginx static files routing
// Redirects all /c/{token} and /{token} to the index page,
// trying to load the static files if they exist.
server {
listen 8001;
server_name loop.lolnet.org;
root /home/www/loop.lolnet.org/;
location ~ ^/(c/)?(.*)$ {
@almet
almet / README.rst
Last active August 29, 2015 14:11
run you own sync server with nix

Change the configuration in firefox (with about:config):

services.sync.tokenServerURI: http://localhost:5000/token/1.0/sync/1.5

See the pull request to have the packages for nix.

The nix commands are:

$ nix-build ./default.nix -A pythonPackages.syncserver -o syncserver
$ nix-build ./default.nix -A pythonPackages.pasteScript -o paste
@almet
almet / powersave.sh
Created December 11, 2014 11:12
powersave
echo "powersave" | sudo tee /sys/bus/cpu/devices/cpu*/cpufreq/scaling_governor
var hmac = require('../loop/hmac');
var conf = require('../loop/config').conf;
var async = require('async');
var redis = require("redis");
var storage = conf.get("storage");
var hawkIdSecret = conf.get("hawkIdSecret");
if (storage.engine === "redis") {