Skip to content

Instantly share code, notes, and snippets.

View 0xbepresent's full-sized avatar

Misa 0xbepresent

View GitHub Profile
@0xbepresent
0xbepresent / ping_my_server.py
Last active December 24, 2015 10:29
PIng to my server!
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
@0xbepresent
0xbepresent / get_regiones_comunas.py
Created March 26, 2014 05:24
Obtiene un listado de objetos Regiones y Comunas con su relacion Region de Chile
# -*- 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
@0xbepresent
0xbepresent / my_configs.vim
Last active August 31, 2017 02:07
My configs Mac-Vim
"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
@0xbepresent
0xbepresent / get_countries.py
Created July 21, 2014 19:20
Get a list of world's countries
# -*- 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')
@0xbepresent
0xbepresent / mock_datetime_object.py
Created January 10, 2015 16:29
Mock Datetime Object
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.
"""
@0xbepresent
0xbepresent / mycustomtestrunner.py
Created February 3, 2015 22:23
Mock Get Requests in all Tests
import requests
from mock import patch
from django.test.runner import DiscoverRunner
class CustomTestRunner(DiscoverRunner):
"""Custom test runner"""
def __init__(self, *args, **kwargs):
@0xbepresent
0xbepresent / get_candidatos.py
Created October 18, 2016 19:40
Obtener candidatos de Santiago.
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)
@0xbepresent
0xbepresent / scrapping_h1.py
Created March 27, 2017 18:26
Spider which helps to send HackerOne reports to Pushbullet.
"""
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
@0xbepresent
0xbepresent / tor_connection.py
Created August 19, 2017 14:20
Python Script to connect to TOR via Stem.
"""
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
### 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: