Skip to content

Instantly share code, notes, and snippets.

View mtorromeo's full-sized avatar

Massimiliano Torromeo mtorromeo

View GitHub Profile
@mtorromeo
mtorromeo / parallelrun.py
Created June 5, 2014 08:33
Parallelize shell processes enforcing a concurrency limit using python3 and asyncio
import asyncio
concurrency_sem = asyncio.Semaphore(3)
@asyncio.coroutine
def run(process):
yield from concurrency_sem.acquire()
print("Running {}...".format(process))
proc = yield from asyncio.create_subprocess_shell(process)
yield from proc.communicate()
@mtorromeo
mtorromeo / PKGBUILD
Created May 22, 2014 09:30
libuv 0.11.25 with inet_pton6.patch
# $Id: PKGBUILD 109507 2014-04-15 09:32:10Z mtorromeo $
# Maintainer: Massimiliano Torromeo <[email protected]>
pkgname=libuv
pkgver=0.11.25
pkgrel=1
pkgdesc="A new platform layer for Node.JS"
arch=('i686' 'x86_64')
url="https://github.com/joyent/libuv"
license=('custom')
@mtorromeo
mtorromeo / artera-sms.php
Last active August 29, 2015 13:57
Esempio di invio SMS Artera
<?php
//open connection
$ch = curl_init("https://www.artera.it/invio_sms_post.php");
//POST data
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"mittente" => "Foo Srl",
"username" => "NOMEUTENTE",
"password" => "PASSWORD",
"operation" => "invioSMS",