Skip to content

Instantly share code, notes, and snippets.

Electrifying my brain

Patrice Ferlet metal3d

Electrifying my brain
View GitHub Profile
metal3d /
Last active Aug 29, 2015
A simple script that gives me number of download for github project release
import requests
import json
import sys
# use argv... example:
# python github-dl-count MyUserName MyRepoName
user = sys.argv[1]
repo = sys.argv[2]
url="" % (user, repo)
View gist:835543
<simplelayout />
<rtmpconnection objectencoding="3" name="mainconnect" src="rtmp://" autoconnect="true" >
<method name="hello">
Debug.write("server said hello...")
<rtmpstatus />
<text>Orange light: warning and mybe error on server, Green OK, Red: Error</text>
View example for avahi and wol
#Script de Démarrage des Ordinateurs sur l'interface réseau eth1
/usr/bin/wol -i $MACADDR
#Maintenant on tourne en boucle et on attend que le pc annonce qu'il existe
metal3d / exemple1
Last active Dec 10, 2015
Exemples PlantUML
View exemple1
A -> B: le label de mon appel
B -> A: autre label...
metal3d /
Last active Dec 11, 2015
Bayesian class that train datas and compute bayesian calculation.
# -*- encoding: utf-8 -*-
""" Simple Bayesian calculation
After training datas by categories, you can use Bayes.bayes method to compute
bayesian calculation to find probality for a content
matches some categories
>>> b = Bayes()
metal3d /
Created Feb 1, 2016
Patch to change SELinux context of CoreOS libvirt deployment script
diff -up ./ ./
diff -up ./ ./
--- ./ 2016-01-25 14:18:15.431503583 +0100
+++ ./ 2016-01-25 14:24:35.942741966 +0100
@@ -51,6 +51,12 @@ for SEQ in $(seq 1 $1); do
+ if [[ selinuxenabled ]] ;then
metal3d / gtk.css
Created Feb 9, 2016
Reduct title bar on gnome 3
View gtk.css
/* To put in ~/.config/gtk-3.0/gtk.css */
/* Create directory and file if they don't exist */
/* Change paddings to fill your preferences */
.header-bar.default-decoration {
padding-top: 1px;
padding-bottom: 1px;
.header-bar.default-decoration .button.titlebutton {
padding-top: 1px;
padding-bottom: 1px;
View PythonDIPonyTech
# Why DI Framework are useful
Dependency injection is back in fashion. That's probably the result AngularJS, Symfony2, and many Java frameworks success that offer a "DI" implementation. But what is "DI", and why are we able to *not use* "DI" framework with Python ?
## What is dependency injection
Dependency injection is a pattern, or it is rather a way to implement dependencies between classes. The approach is basically to avoid classes to directly instanciate objects, and make use of interfaces and/or factories. That's all, nothing more complicated.
To illustrate the definition, it's simpler to look at an example.
metal3d / OWNERS
Last active Mar 24, 2017
Kubernetes Incubator Proposal - Argoos
Patrice FERLET aka Metal3d <> <>
metal3d / goswitch installation
Created Nov 19, 2017
Install script for goswitch
View goswitch installation
curl -sSL $(curl -s | \
grep tarball | cut -d '"' -f 4) | \
tar -zxf - --strip-components=1 -C ~/.local/bin */goswitch