###修改 hostname
##修改 master 的 hostname
# vim /etc/hostname
master
from pyramid.config import Configurator | |
from zope.interface.registry import Components | |
import simplejson as json | |
import datetime | |
import decimal | |
from .. import lib | |
//Add some contstraints for good measture, constraints must be ran individually | |
CREATE CONSTRAINT ON (c:Customer) ASSERT c.email IS UNIQUE; | |
CREATE CONSTRAINT ON (p:Product) ASSERT p.uuid IS UNIQUE; | |
//:Start Product and customer query: | |
//Products, bundles and categories | |
CREATE (product1:Product {name: "Product 1", uuid: "d8d177cc-1542-11e5-b60b-1697f925ec7b", price: 10}) | |
CREATE (product2:Product {name: "Product 2", uuid: "d8d17b28-1542-11e5-b60b-1697f925ec7b", price: 20}) | |
CREATE (product3:Product {name: "Product 3", uuid: "d8d17c72-1542-11e5-b60b-1697f925ec7b", price: 30}) |
使用 apt-mirror 来同步 hortonworks 镜像服务器上的 Ambari, HDP, HDP-UTILS 仓库, 方便本地搭建 Hadoop 集群. 适合于 Ubuntu/Debian 分支的操作系统.
set foldmethod=indent
use zo
and zc
to fold and unfold in normal mode
use zR
and zM
to fold and unfold all folds
set foldmethod=indent
use zo
and zc
to fold and unfold in normal mode
use zR
and zM
to fold and unfold all folds
validates :url, uniqueness: true, format: { with: URI::regexp(%w(http https))} |
# coding: utf-8 | |
try: | |
import cPickle as pickle | |
except ImportError: | |
import pickle | |
try: | |
import hashlib | |
sha1 = hashlib.sha1 |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list | |
sudo apt-get update | |
sudo apt-get install mongodb-org |
# http://zh.wikipedia.org/wiki/中文数字 | |
# http://china.younosuke.com/03_013.html | |
module ChineseNum | |
extend self | |
UPPER_ZERO = '零' | |
LOWER_ZERO = '〇' | |
UPPER_DIGITS = %w[壹 贰 叁 肆 伍 陆 柒 捌 玖].unshift nil | |
LOWER_DIGITS = %w[一 二 三 四 五 六 七 八 九].unshift nil |