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
| class Manager(object): | |
| def __init__(self, cls_): | |
| self.cls_ = cls_ | |
| def all(self): | |
| print(self.cls_.__name__) | |
| def model(cls): | |
| setattr(cls, 'objects', Manager(cls)) |
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
| class Manager(object): | |
| def __init__(self, cls_): | |
| self.cls_ = cls_ | |
| def all(self): | |
| print(self.cls_.__name__) | |
| class Model(object): | |
| @classmethod |
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
| class Manager(object): | |
| def __init__(self, cls_): | |
| self.cls_ = cls_ | |
| def all(self): | |
| print(self.cls_.__name__) | |
| class Model(object): |
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
| http://blog.smartbear.com/web-monitoring/why-containers-instead-of-hypervisors/ | |
| http://stackoverflow.com/questions/20578039/difference-between-kvm-and-lxc | |
| https://ofirm.wordpress.com/2014/01/05/creating-a-virtualized-fully-distributed-hadoop-cluster-using-linux-containers/ | |
| https://www.youtube.com/watch?v=0cDj7citEjE |
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
| vboxmanage dhcpserver add --netname intnet --ip 192.168.1.1 --netmask 255.255.255.0 --lowerip 192.168.1.2 --upperip 192.168.1.10 --enable | |
| vboxmanage dhcpserver add --netname intnet --ip 10.10.10.1 --netmask 255.255.255.0 --lowerip 10.10.10.2 --upperip 10.10.10.10 --enable | |
| vboxmanage dhcpserver remove --netname intnet | |
| # ref | |
| # https://www.virtualbox.org/manual/ch06.html | |
| # https://www.virtualbox.org/manual/ch08.html#vboxmanage-dhcpserver | |
| # https://www.youtube.com/watch?v=lhOY-KilEeE |
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 | |
| >>> matchCreation = 1421845413033 # timestamp em milisegundos | |
| >>> datetime.datetime.fromtimestamp(matchCreation / 1e3).strftime('%Y-%m-%d %H:%M:%S') | |
| '2015-01-21 10:03:33' | |
| >>> import datetime, time | |
| >>> t = datetime.datetime(2015, 12, 10, 1, 51, 16) | |
| >>> timestamp = time.mktime(t.timetuple()) # converve datetime para timestamp em segundos ... | |
| >>> timestamp |
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
| # instalacao do python, setup_tools, pip, virtualenv | |
| # https://www.digitalocean.com/community/tutorials/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4 | |
| yum -y update | |
| yum groupinstall -y development | |
| yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel | |
| yum install xz-libs | |
| wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz | |
| wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tar.xz |
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
| # Primeira parte: Instalacao do hadoop em standalone mode | |
| # criacao do usuario | |
| addgroup node # cria grupo node | |
| adduser --ingroup node node # cria usuário node dentro do grupo node | |
| su - node # trocar para usuario node | |
| # atualizacao do sistema | |
| sudo apt-get update | |
| sudo apt-get upgrade |
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
| # http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ | |
| # https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-14-04 | |
| # https://docs.mongodb.org/getting-started/python/ | |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
| echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list | |
| echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list | |
| # or |
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
| https://atom.io/ | |
| http://www.marinamele.com/install-and-configure-atom-editor-for-python |