Skip to content

Instantly share code, notes, and snippets.

Ricardo Mansilla mansilla

Block or report user

Report or block mansilla

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mansilla
mansilla / securityIncidentsGDL2017.geojson
Created Oct 7, 2018
security incidents in Guadalajara, Mexico, from mid 2017 to mid 2018
View securityIncidentsGDL2017.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View using-mechanize.py
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 Aug 10, 2015
Seting up Mechanize browser
View setup-mechanize.py
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
View gist:47104a83fe8e2e3dd431
$ 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
View gist:b98123bc4979cf94f5c0
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"
View gist:b8e9b3079d5a0055ff93
{
"took" : 4,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 100,
@mansilla
mansilla / gist:5716151
Last active Dec 18, 2015
lighttpd-sub.conf
View gist:5716151
fastcgi.server = (
"/myapp" => (
"django-fcgi" => (
"socket" => "/route/to/socket_file.sock",
"check-local" => "disable",
)
),
)
@mansilla
mansilla / lighttpd.conf
Last active Dec 18, 2015
lighttpd.conf
View 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 Nov 7, 2011
code for fetching a net of followers around a user...
View getting_the_circle.py
# 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 ===========
You can’t perform that action at this time.