Skip to content

Instantly share code, notes, and snippets.

View sboisson's full-sized avatar

Stéphane sboisson

View GitHub Profile
@philipcristiano
philipcristiano / faces_example.py
Created June 18, 2013 14:10
Resize and crop an image based on OpenCV detected faces
import sys
from PIL import Image, ImageDraw
try:
import cv
except ImportError:
print 'Could not import cv, trying opencv'
import opencv.cv as cv
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active February 24, 2026 02:06
Backend Architectures Keywords and References
@davewongillies
davewongillies / gist:5855425
Last active December 18, 2015 22:38
Installing graphite-web into a virtualenv with circus and chaussette
# virtualenv graphite-web
# cd graphite-web
# . bin/activate
# pip install circus chaussette meinheld Django==1.3 Twisted==11.1.0 python-memcached==1.47 txAMQP==0.4 simplejson==2.1.6 django-tagging==0.3.1 gunicorn pytz pyparsing==1.5.7 http://cairographics.org/releases/py2cairo-1.8.10.tar.gz git+git://github.com/graphite-project/whisper.git#egg=whisper
# pip install git+git://github.com/graphite-project/graphite-web.git --install-option="--prefix=$VIRTUALENV_PREFIX/graphite-web" --install-option="--install-lib=$VIRTUALENV_PREFIX/graphite-web/lib/python2.7/site-packages"
@dankrause
dankrause / ssdp.py
Last active December 27, 2025 23:25
Tiny python SSDP discovery library with no external dependencies
# Copyright 2014 Dan Krause
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@joechrysler
joechrysler / who_is_my_mummy.sh
Last active January 16, 2026 13:02
Find the nearest parent branch of the current git branch
#!/usr/bin/env zsh
git show-branch -a \
| grep '\*' \
| grep -v `git rev-parse --abbrev-ref HEAD` \
| head -n1 \
| sed 's/.*\[\(.*\)\].*/\1/' \
| sed 's/[\^~].*//'
# How it works:
@blt04
blt04 / ip-down
Created July 27, 2013 05:46
OSX VPN Scripts: The built in Mac VPN client doesn't have too many options but you can easily apply custom settings via scripts. Here are some examples of how to customize your VPN connections. Just put these two files in /etc/ppp and customize. Make sure you `chmod 0755 /etc/ppp/ip-up /etc/ppp/ip-down`. For more information, see `man pppd`.
#!/bin/bash
#
# /etc/ppp/ip-down
#
# When the ppp link goes down, this script is called with the following
# parameters
# $1 the interface name used by pppd (e.g. ppp3)
# $2 the tty device name
# $3 the tty device speed
# $4 the local IP address for the interface
@jvehent
jvehent / cipherscan top domains
Created September 26, 2013 07:06
Cipherscan of major internet websites that have HTTPS enabled. The output shows the server ciphers preferences, TLS version and PFS key size if present. https://github.com/jvehent/cipherscan
$ for site in google.com facebook.com youtube.com yahoo.com wikipedia.org linkedin.com microsoft.com twitter.com amazon.com blogspot.com tumblr.com netflix.com mozilla.org marketplace.mozilla.com login.persona.org; do echo;echo "-- $site --"; ./CiphersScan.sh $site:443;done
-- google.com --
prio ciphersuite protocol pfs_keysize
1 ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 ECDH,P-256,256bits
2 ECDHE-RSA-RC4-SHA TLSv1.2 ECDH,P-256,256bits
3 ECDHE-RSA-AES128-SHA TLSv1.2 ECDH,P-256,256bits
4 AES128-GCM-SHA256 TLSv1.2
5 RC4-SHA TLSv1.2
6 RC4-MD5 TLSv1.2
@JanJakes
JanJakes / 00-readme.md
Last active July 27, 2023 11:32
Ubuntu server with Nginx, uWSGI and Node.js installation & deployment setup

Ubuntu with Nginx, uWSGI & Node.js and it's deployment

This Gist contains instructions to setup Ubuntu server with Nginx, uWSGI & Node.js with that can serve for any Python apps (Django for instance) and will allow it's automatized deployment.

The content is as follows:

  • 01-ubuntu.md – A basic Ubuntu server setup.
  • 02-nginx-uwsgi-nodejs.md – Nginx, uWSGI and Node.js installation and setup.
  • 03-deployment.md – A server setup for automatized deployment.
  • 04-mariadb.md – Mariadb installation and setup.
@enyachoke
enyachoke / pre-receive
Created November 13, 2013 20:43
This is a git pre-recieve hook that compiles a slug using heroku buildpacks and optionally uploads it to s3 and generate a pre-signed url for downloading it. This script assumes you have s3cmd installed and configured.
#!/bin/bash
while read oldrev newrev refname
do
# Only build the master branch.
if [[ $refname = "refs/heads/master" ]] ; then
echo "building------> $newrev ... "
#We get the archive and pass it to the slug builder
slug_id=newapp
git archive $newrev | docker run -i -name $newrev -a stdin -a stdout -a stderr flynn/slugbuilder - > $newrev.tgz
# s3cmd put $newrev.tgz s3://pyxiscloud/$newrev.tgz
@John07
John07 / HLS_dvr.sh
Last active November 27, 2025 12:40
A small script to make recording http live streams (HLS, those streams that work on iOS devices) nicer on a Mac. Script records the stream for a defined period of time and sends the user notifications if anything goes wrong and once it's done.
# required: ffmpeg (e.g. from homebrew), terminal-notifier from https://github.com/alloy/terminal-notifier
# you can schedule this with launchd to run e.g. weekly
# Specify in seconds how long the script should record (default here is 1 hour).
seconds=3600
# Date format for the recording file name
DATE=`date "+%d-%m-%y_%H-%M"`
# start ffmpeg recording