Skip to content

Instantly share code, notes, and snippets.

View alexandregz's full-sized avatar
🎯
Focusing

Alexandre Espinosa Menor alexandregz

🎯
Focusing
View GitHub Profile
import argparse
import sqlite3 as lite
import os
def _open_db(db):
try:
con = lite.connect(db)
cur = con.cursor()
return (cur,con)
except lite.Error as e:
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@alexandregz
alexandregz / create_homebrew_update.sh
Last active August 29, 2015 14:14
create_homebrew_update.sh
#!/bin/bash
#
# To create updated branch from gh/homebrew
# Useful when you update regularly any formula
#
# Need to have homebrew forked previously
#
# Alexandre Espinosa Menor - https://github.com/alexandregz
#
# ps -p PID -o etime=
@alexandregz
alexandregz / gist:086e8d7cb15affeafad0
Created February 16, 2015 07:56
requirements to install roundcube v1.1.0 with mamp v3.0.7.3
/Applications/MAMP/bin/php/php5.6.2/bin/pear install Auth_SASL Net_SMTP Net_IDNA2 Mail_mime Mail_mimeDecode Net_IDNA2-0.1.1
@alexandregz
alexandregz / gist:90086596b44823f21ef7
Created February 16, 2015 08:10
automatic login with tampermonkey (greasemonkey)
// ==UserScript==
// @name login into roundcube 2FA
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match http://localhost:8888/roundcube/*
// @copyright 2012+, You
// ==/UserScript==
$('#rcmloginuser').attr('value', '[email protected]');
@alexandregz
alexandregz / brew-more.rb
Last active August 29, 2015 14:15 — forked from lwe/brew-more.rb
# Small utility which uses the homepage and nokogori to get a description from the formula's homepage.
#
# As written in the homebrew wiki:
# > Homebrew doesn’t have a description field because the homepage is always up to date,
# > and Homebrew is not. Thus it’s less maintenance for us. To satisfy the description
# > we’re going to invent a new packaging microformat and persuade everyone to publish
# > it on their homepage.
#
# Too bad no packaging microformat has yet been invented, but brew-more just first looks for a
# `<meta name="description">` tag, then for an `a#project_summary_link` tag (which is used in
@alexandregz
alexandregz / Proceso.pm
Last active August 29, 2015 14:15
dinaip openwrt
sub setZonasDominio{
my $dominio = $_[0];
foreach my $zona (@{$dominio->{cambios}}){
&Debug::log("Modificando zona $zona->{zona} del dominio $dominio->{dominio}");
my $r1 = &enviarPeticion('Domain_Zone_UpdateTypeA', {domain => $dominio->{dominio},
hostname => $zona->{zona},
ip => $zona->{ip}},1);
@alexandregz
alexandregz / .profile
Created February 21, 2015 17:02
ash shell PS1
# new ps1 from http://blog.arinium.fi/2012/09/howto-working-directory-in-synology-ds211j-shell-prompt/
PS1="`whoami`@`hostname | sed 's/\..*//'`:\w"
case `id -u` in
0) PS1="${PS1}# ";;
*) PS1="${PS1}$ ";;
esac
@alexandregz
alexandregz / with_desc_tap.brew_bash_completion.sh
Created March 6, 2015 10:21
brew desc autocompletion (bash)
--- /tmp/brew_bash_completion.sh 2015-03-06 11:06:21.000000000 +0100
+++ /usr/local/etc/bash_completion.d/brew_bash_completion.sh 2015-03-06 11:13:34.000000000 +0100
@@ -230,6 +230,19 @@
}
+_brew_desc ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in