Skip to content

Instantly share code, notes, and snippets.

View leucos's full-sized avatar
👽
Waiting for aliens

Michel Blanc leucos

👽
Waiting for aliens
  • devops.works
  • Lyon, France
View GitHub Profile
@leucos
leucos / dmxusb_pro.py
Created August 7, 2014 13:51
[note to self] Reading serial number on DMX USB Pro
#
# (c) 2013-2014 ERASME
#
# This file is part of griotte
#
# griotte is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@leucos
leucos / spec_helper.rb
Created April 9, 2014 06:26
Mocking authentication in Padrino
# ...
# Somewhere in spec_helper.rb
def login_as(role = nil)
if (role)
acct = Account[:role => role] || Account.new(:name => 'Foo', :surname => role, :email => "#{role}@none.org", :role => role)
Project::Admin.any_instance.stub(:current_account).and_return(acct)
Project::Admin.any_instance.stub(:logged_in?).and_return(true)
Project::App.any_instance.stub(:current_account).and_return(acct)
import sys, tty, copy
from raspiomix import Raspiomix
import quick2wire.i2c as i2c
def testAnalog():
varDivisior = 64 # from pdf sheet on adc addresses and config
varMultiplier = (3.3/varDivisior)/1000
@leucos
leucos / analog_test.py
Created September 12, 2013 10:53
I2C Raspiomix test
import sys, tty, copy
from raspiomix import Raspiomix
import quick2wire.i2c as i2c
def testAnalog():
varDivisior = 64 # from pdf sheet on adc addresses and config
varMultiplier = (3.3/varDivisior)/1000
@leucos
leucos / tailer.sh
Created August 20, 2013 07:51
EventMachine + popen
#!/bin/bash
for i in {1..1000}; do
echo -n $i
sleep 0.001
done
@leucos
leucos / ansible_approach.md
Last active August 2, 2021 20:43
My ansible approach

My ansible approach

Per service playbooks

Playbooks are written per service : a playbook is a collection of tasks, and eventually associated handers, templates, and files, that are required to properly install and setup a service.

Each playbook has a setup.yml entry point, which is responsible of including various necessary tasks to get the service up and running. Typically, this

@leucos
leucos / museomix_electrolab.md
Last active January 18, 2017 18:16
Hosting #museomix : providing real-world access to exhibits via sensors and actuators

Context

Museomix is a short event where coders, designers, hackers, cultural and museum experts brainstorm on collections and museum installations. This document gives hints on setting up an electronic lab so attendees can benefit from real-world interactions.

General considerations

Often, exhibits must sense their environment (is there light ? is there a visitor ? ...) or act on their environment (turn the light on ! make a sound ! ...).

Soldering team

@leucos
leucos / network_and_it_mmix.md
Last active December 13, 2015 17:59
Hosting #museomix : suggestions regarding network and IT infrastructure

Context

Museomix is a short event where coders, designers, hackers, cultural and museum experts brainstorm on collections and museum installations. This document gives hints on network deployments and IT infrastructure for such event.

Technical considerations

The figures given in this document are based on a 100 people event.

Network

@leucos
leucos / README.md
Last active December 11, 2015 10:28
Ruby playbook example

Deploying Ruby with Ansible

Define these variables somewhere and let it go :

  • ruby_current: the ruby version you want to deploy (e.g. "1.9.3-p374")
  • ruby_user: Under which account we want ruby to be installed (e.g. "myappuser"; "ruby" in this playbook)

Note : this playbook only works with '-i' in the sudo line since it requires the target user environment to be fully loaded

@leucos
leucos / manuel.md
Last active December 10, 2015 00:39
Manuel du player de contenus statiques Raspberry-Pi

Player Statique Raspberry-Pi (PSπ)

Mode d’emploi

Quessedonc ?

Le player de contenus statiques Raspberry-Pi (PSπ) permet de diffuser en boucle des médias. Actuellement, le PSπ supporte les formats suivants :

  • Audio : wav, mp3, ogg
  • Vidéo : mpeg4 (Simple Profile, yuv420p, 1920x1080, 16:9, 24 fps) / ac3 (48000 Hz, 5.1, 448 kb/s)