Skip to content

Instantly share code, notes, and snippets.

View mansilla's full-sized avatar

Ricardo Mansilla mansilla

View GitHub Profile
@mansilla
mansilla / securityIncidentsGDL2017.geojson
Created October 7, 2018 21:05
security incidents in Guadalajara, Mexico, from mid 2017 to mid 2018
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mansilla
mansilla / gist:5716151
Last active December 18, 2015 03:09
lighttpd-sub.conf
fastcgi.server = (
"/myapp" => (
"django-fcgi" => (
"socket" => "/route/to/socket_file.sock",
"check-local" => "disable",
)
),
)
@mansilla
mansilla / lighttpd.conf
Last active December 18, 2015 03:08
lighttpd.conf
fastcgi.server = (
"/myapp" => (
"django-fcgi" => (
"socket" => "/route/to/socket_file.sock",
"check-local" => "disable",
)
),
)
alias.url = (
# en caso de que lo necesiten
@mansilla
mansilla / getting_the_circle.py
Created November 7, 2011 00:44
code for fetching a net of followers around a user...
# Usando tweepy para obetener la red de seguidores de nivel k de un sujeto en twitter.
# Created by Ricardo Mansilla at November 6, 2011.
#=====================================================================================
import sys
import tweepy
import webbrowser
import time
#======= SETUP ===========
@mansilla
mansilla / using-mechanize.py
Created August 10, 2015 14:36
Using Mechanize
page = br.open("http://example.com")
# page tiene el resultado de la request
html_source_code = page.read() # br esta ahora en example.com
#=== Interactuando con los formularios
br.select_form(name="form-name") # si la forma tiene name
# si no tiene el tag "name", hay que buscar la forma por su
# indice en el codigo de la pagina
br.form = list(br.forms())[0]
@mansilla
mansilla / setup-mechanize.py
Created August 10, 2015 13:57
Seting up Mechanize browser
import mechanize
from mechanize import Browser
br = Browser()
# browser basic setup (for simulate a real web browser)
br.set_handle_equiv(True) # cuando tratar HTML http-equiv headers como HTTP headers
br.set_handle_redirect(True) # para los redirect loops
br.set_handle_referer(True) # para annadir un referer al objeto request
br.set_handle_robots(False) # ignorar robots.txt
br.set_debug_http(False) # bueno para la fase de development
$ bin/plugin --install com.github.richardwilly98.elasticsearch/elasticsearch-river-mongodb/1.6.0
$ bin/plugin --install elasticsearch/elasticsearch-mapper-attachments/1.6.0
$ bin/plugin --install mobz/elasticsearch-head
$ bin/plugin --install lukas-vlcek/bigdesk
curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"servers": [ { "host": "127.0.0.1", "port": 27017 } ],
"db": "nombre_base_prueba",
"collection": "nombre_coleccion_prueba"
},
"index": {
"name": "nombre_indice_prueba",
"type": "tipo_prueba"
{
"took" : 4,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 100,