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, sys | |
if __name__ == "__main__": | |
# python ping_my_server.py misalabs.com | |
hostname = sys.argv[1] if len(sys.argv) == 2 else "misalabs.com" | |
end = False | |
while end is False: | |
response = os.system("ping -c 1 " + hostname) | |
if response == 0: | |
print "%s is up!" % hostname |
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
# -*- coding: utf-8 -*- | |
""" | |
Obtiene un listado de objetos de Regiones y Comunas con su relacion Region de | |
Chile | |
@author: misalabs | |
""" | |
import requests | |
from bs4 import BeautifulSoup | |
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
"Install Pathogen https://github.com/tpope/vim-pathogen | |
"Install Airline https://github.com/vim-airline/vim-airline | |
"Install Fugitive https://github.com/tpope/vim-fugitive | |
"Install Solarized https://github.com/altercation/vim-colors-solarized | |
"Helps to plugins installation | |
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on |
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
# -*- coding: utf-8 -*- | |
""" | |
Get a list of world's countries | |
@author: misalabs | |
""" | |
import requests | |
from bs4 import BeautifulSoup | |
# Get countries | |
countries_html = requests.get('http://es.wikipedia.org/wiki/Anexo:Pa%C3%ADses_del_mundo') |
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 datetime | |
import mock | |
real_datetime_class = datetime.datetime | |
def mock_datetime_now(target): | |
""" | |
A mock patch context, we override the datetime.datetime with a custom value. | |
""" |
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 requests | |
from mock import patch | |
from django.test.runner import DiscoverRunner | |
class CustomTestRunner(DiscoverRunner): | |
"""Custom test runner""" | |
def __init__(self, *args, **kwargs): |
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 csv | |
import requests | |
from bs4 import BeautifulSoup | |
servel_html = requests.get('http://www.servel.cl/declaraciones-de-patrimonio-e-intereses-alcaldes/') | |
page_servel = BeautifulSoup(servel_html.text, 'lxml') | |
with open("candidatos.csv", 'a+') as f: | |
w = csv.writer(f) |
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
""" | |
Spider which helps to send HackerOne reports to Pushbullet. | |
""" | |
import datetime | |
from scrapy import signals, Spider | |
from scrapy.xlib.pydispatch import dispatcher | |
from pushbullet import Pushbullet | |
from settings_prod import PUSHBULLET_KEY |
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
""" | |
Python script to connect to TOR via STEM. I also recommend this source https://gist.github.com/KhepryQuixote/46cf4f3b999d7f658853 | |
""" | |
import socks | |
import requests | |
import socket | |
from stem import Signal | |
from stem.control import Controller | |
from stem.util import term |
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
### Keybase proof | |
I hereby claim: | |
* I am misalabs on github. | |
* I am misalabs (https://keybase.io/misalabs) on keybase. | |
* I have a public key whose fingerprint is 31CC ED0F 52CF 1F05 F448 8A6B C5A7 046D 8FE9 399A | |
To claim this, I am signing this object: |
OlderNewer