Skip to content

Instantly share code, notes, and snippets.

View xarg's full-sized avatar

Alex Plugaru xarg

View GitHub Profile
#!/bin/bash
echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..."
echo -e "\nEx: benchmark.sh -n100 -c10 http://www.google.com/ http://www.bing.com/ \n"
## Gnuplot settings
echo "# Let's output to a jpeg file
set terminal jpeg size 1280,720
# This sets the aspect ratio of the graph
@xarg
xarg / gist:3b33e5c937e663b511a3
Last active August 29, 2015 14:18 — forked from miohtama/gist:5389146
Parse email body and get only the text
import email
def get_decoded_email_body(message_body):
""" Decode email body.
Detect character set if the header is not set.
We try to get text/plain, but if there is not one then fallback to text/html.
:param message_body: Raw 7-bit message body input e.g. from imaplib. Double encoded in quoted-printable and latin-1