This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
"""smtptest.py: command-line smtp test mail sender | |
https://github.com/turbodog/python-smtp-mail-sending-tester | |
Usage: python smtptest.py [options] fromaddress toaddress serveraddress | |
Examples: | |
python smtptest.py [email protected] [email protected] mail.example.com | |
python smtptest.py --debuglevel 1 --usetls -u bob -p xyzzy "Bob <[email protected]>" [email protected] mail.example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'formatters': { | |
'verbose': { | |
'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s", | |
'datefmt' : "%d/%b/%Y %H:%M:%S" | |
}, | |
'simple': { | |
'format': '%(levelname)s %(message)s' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from livereload import Server | |
import formic | |
server = Server() | |
for f in formic.FileSet( | |
include=["**.py","**.html","**.css","**.js"], | |
exclude=[ | |
'**sqlite**', | |
'.**.*sw*', | |
'**.pyc', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cuisine | |
from fabric.api import * | |
@task | |
def vagrant(): | |
""" | |
Vagrant machine environ. | |
""" | |
def ssh_config(name=''): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from webscraping import download, xpath | |
import sys | |
D = download.Download() | |
src = ("crunchy","javascript") | |
def scrape(html): | |
for e in xpath.search(html,"//div[@class='release']"): | |
if "raw" in e.lower(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from colorconsole import terminal | |
BLANCO = 'blanco' | |
NEGRO = 'negro' | |
VACIO = "" | |
TRenglon = range(0,9) | |
TColumna = ["A","B","C","D","E","F","G","H"] | |
screen = terminal.get_terminal() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend default { | |
.host = "127.0.0.1"; | |
.port = "81"; | |
} | |
sub vcl_recv { | |
# if find purge in the url go there and purge | |
if( req.url ~ "purge" ) { | |
return (lookup); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import psutil | |
PROCESS = psutil.Process(os.getpid()) | |
MEGA = 10 ** 6 | |
MEGA_STR = ' ' * MEGA | |
def pmem(): | |
tot, avail, percent, used, free,_,_,_,_ = psutil.virtual_memory() | |
tot, avail, used, free = tot / MEGA, avail / MEGA, used / MEGA, free / MEGA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Requiere que exista el paquete | |
/usr/bin/dialog | |
apt-cache search ^dialog | |
dialog - Muestra cajas de diálogo amigables desde scripts de consola | |
para ejecutar | |
git clone https://gist.github.com/6174258.git ciclo_vida_andres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Daniel Verner | |
# CarrotPlant LLC | |
# 2011 | |
# Backup each mysql databases into a different file, rather than one big file | |
# Optionally files can be gzipped (dbname.gz) | |
# | |
# Usage: dump_all_databases [ -u username -o output_dir -z ] | |
# | |
# -u username to connect mysql server |