A powerful platform for your mobile or web application。
Let us take care of your infrastructure
Focus on your users
Firebase can power your app's backend, including data storage,
user authentication, static hosting, and more. Focus on creating
extraordinary user experiences. We'll take care of the rest.
Build cross-platform native mobile and web apps with our Android, iOS, and JavaScript SDKs. You can also connect Firebase to your existing backend using our server-side libraries。
from https://www.firebase.com/ https://www.firebase.com/pricing.html(有free plan) 相关帖子:"蒲公英"-发布应用,从未如此简单!
var ap =newAPlayer({
element:document.getElementById('player1'),
narrow:false,
autoplay:true,
showlrc:false,
theme:'#e6d0b2',
music: {
title:'Preparation',
author:'Hans Zimmer/Richard Harvey',
url:'http://7xifn9.com1.z0.glb.clouddn.com/Preparation.mp3',
pic:'http://7xifn9.com1.z0.glb.clouddn.com/Preparation.jpg'
}
});
ap.init();
Options
{
element:document.getElementById('player1'), // Optional, player element
narrow:false, // Optional, narrow style
autoplay:true, // Optional, autoplay song(s), not supported by mobile browsers
showlrc:false, // Optional, show lrc
mutex:true, // Optional, pause other players when this player playing
theme:'#e6d0b2', // Optional, theme color, default: #b7daff
music: { // Required, music info
title:'Preparation', // Required, music title
author:'Hans Zimmer/Richard Harvey', // Required, music author
url:'http://7xifn9.com1.z0.glb.clouddn.com/Preparation.mp3', // Required, music url
pic:'http://7xifn9.com1.z0.glb.clouddn.com/Preparation.jpg'// Optional, music picture
}
}
API
ap.init()
ap.play()
ap.pause()
Work with module bundler
var APlayer =require('APlayer');
var ap =newAPlayer({...});
With lrc
LRC format:
Support multiple time tag, support three decimal second
hashring is a consistent hashing algorithm for Node.js that is compatible with libketama and python's hash_ring package.
The HashRing module provides consistent hashing that is compatible with the
original libketama library that was developed at last.fm. In addition to beeing
compatible with libketama it's also compatible with the hash_ring module for
Python. See the compatiblity section of the API for more details on this.
Build status
Installation
The advised installation of module is done through the Node package manager (npm).
npm install hashring --save
The --save parameter tells npm that it should automatically add the module to
the dependencies field in your package.json.
Usage
var HashRing =require('hashring');
The HashRing constructor is designed to handle different argument types as a
consistent hash ring can be use for different use cases. You can supply the
constructor with:
String
A single server, possible, but pointless in most cases if you only use one
server, then done use the HashRing at all, it only adds overhead.
var ring =newHashRing('127.0.0.1:11211');
Array
Multiple servers for the HashRing.
var ring =newHashRing(['127.0.0.1:11211', '127.0.0.2:11211']);
Object
An Object where the keys of the Object are the servers and the value can be a
Number and it will be seen as weight for server. The value can also be an
Object. Where the key can be a weight or a vnode.
Weights or vnodes are used to give servers a bigger distribution in the
HashRing. For example you have 3 servers where you want to distribute your keys
over but not all servers are equal in capacity as 2 of those machines have 200mb
of memory and the other has 3.2 gig of memory. The last server is substantially
bigger and there for should receive a greater distrubtion in the ring.
For a rule of thumb use the amount of memory as weight:
var HashRing =require('hashring');
var ring =newHashRing({
'127.0.0.1:11211':200,
'127.0.0.2:11211': { weight:200 }, // same as above'127.0.0.3:11211':3200
});
If you want create a server with multiple vnodes (virtual nodes):
var HashRing =require('hashring');
var ring =newHashRing({
'127.0.0.1:11211': { vnodes:50 },
'127.0.0.2:11211': { vnodes:200 },
'127.0.0.3:11211': { vnodes:100 }
});
Algorithm
With the second argument you can configure the algorithm that is used to hash
the keys. It defaults to md5 and can only contain values that are accepted in
Node's crypto API. Alternatively you can supply it with a function for a
custom hasher. But do note that the hashValue will be calculated on the result.
Options
vnode count The amount of virtual nodes per server, defaults to 40 as this
generates 160 points per server as used by ketama hashing.
compatiblity Allows you to force a compatibility mode of the HashRing. It
default to ketama hash rings but if you are coming from a python world you
might want compatibility with the hash_ring module. There's a small diff
between hash_ring and ketama and that's the amount of replica's of a server.
Ketama uses 4 and hash_ring uses 3. Set this to hash_ring if you want to
use 3.
replicas The amount of replicas per server. Defaults to 4.
max cache size We use a simple LRU cache inside the module to speed up
frequent key lookups, you can customize the amount of keys that need to be
cached. It defaults to 5000.
default port The default port number which will removed from the server
address to provide ketama compatibility.
'use strict';
// require the module, it returns a HashRing constructorvar HashRing =require('hashring');
// Setup hash rings with your servers, in this example I just assume that all// servers are equal, and we want to bump the cache size to 10.000 items.var ring =newHashRing([
'127.0.0.1',
'127.0.0.2',
'127.0.0.3',
'127.0.0.4'
], 'md5', {
'max cache size':10000
});
// Now we are going to get some a server for a keyring.get('foo bar banana'); // returns 127.0.0.x// Or if you might want to do some replication scheme and store/fetch data from// multiple serversring.range('foo bar banana', 2).forEach(functionforEach(server) {
console.log(server); // do stuff with your server
});
// Add or remove a new a server to the ring, they accept the same arguments as// the constructorring.add('127.0.0.7').remove('127.0.0.1');
Generates the continuum of server a.k.a as the Hash Ring based on their weights
and virtual nodes assigned.
HashRing.get(key)
Find the correct node for which the key is closest to the point after what the
given key hashes to.
key String, Random key that needs to be searched in the hash ring
returns: The matching server address.
HashRing.range(key, size, unique)
Returns a range of servers. Could be useful for replication.
key String, Random key that needs to be searched in the hash ring
size Number, Amount items to be returned (maximum). Defaults to the amount
of servers that are in the hashring.
unique Boolean, Don't return duplicate servers. Defaults to true.
returns: The array of servers that we found.
HashRing.swap(from, *to)
Hotswap identical servers with each other. This doesn't require the cache to be
completely nuked and the hash ring distribution to be re-calculated.
Please note that removing the server and adding a new server could potentially
create a different distribution.
from String, The server that needs to be replaced
to String. The server that replaces the server
HashRing.add(server)
Add a new server to ring without having to re-initialize the hashring. It
accepts the same arguments as you can use in the constructor.
server Server that need to be added to the ring.
HashRing.remove(server)
Remove a server from the hash ring.
server Server that need to be removed from the ring.
HashRing.has(server)
Checks if a given server exists in the hash ring.
server Server for whose existence we're checking.
HashRing.reset()
Reset the HashRing and clean up it's references.
HashRing.end()
Resets the HashRing and closes the ring.
HashRing.find(hashValue) (private)
Finds the correct position of the given hashValue in the hashring.
hashValue Number, The hashValue from the HashRing#hashValue method.
returns: Index of the value in the ring.
HashRing.hash(key) (private)
Generates the hash for the key.
key String, Random key that needs to be hashed.
returns: The hashed valued.
HashRing.digest(key) (private)
Digest hash so we can make a numeric representation from the hash. So it can be
fed in to our hashValue.
key String, Random key that needs to be hashed.
returns: An array of charCodeAt(0) converted chars.
HashRing.hashValue(key) (private)
Get the hashed value of the given key, it does the digesting, hashing yo.
key String, Random key that needs to be hashed.
returns: The hash value of the key.
HashRing.points(servers)
Returns the points per server.
servers Optional server that you want to filter for
returns: A Object with server -> Array of points mapping
Upgrading from 0.0.x to 1.x.x
The 0.0.x releases had some serious flaws that causes it to be incompatible
with the 1.0.0 release. These flaws are the reason that 1.0.0 got released. They
are not backwards compatible as they change the way that keys are hashed. The
following incompatible changes have been made for the sake of consistency:
Only accepts hashers that are build in to node (for now). As it can only
guarantee proper hashing of values.
The replace function was actually doing swaps of keys, so it's original
functionality has been renamed to swap. The replace API is now removing the
given server and adds it again. As this causes the servers to be properly
re-hashed.
The module now requires a C++ compiler to be installed on your server as
hashing the value requires support for 64bit bitshifting and JavaScript as a
language only supports 32bit bitshifting.
It adds 4 replica's instead 3 for the servers. This is how libketama
originally did it, if you want to have 3 replica's in the hash ring you can
set the compatibility option to hash_ring.
The API's have be renamed, deprecation notices are added in to place and they
will be removed in the next minor version bump (1.1.0)
Added human readable configuration options instead of camelcase. This
increases readability of the module.
CRC32 was removed as crypto engine because it was too unstable.
Docker image for Nginx + Ghost, Nginx acting as a reverse proxy。 This is a Docker image for running Nginx + Ghost as a service.
Ghost
is a blog system, while Nginx acts as a reverse proxy to Ghost. As many
services like Gravatar cannot be correctly loaded from China, the Nginx
replaces them with an accessible proxy using http_sub module. It also helps processing HTTPS meta links in Ghost.
Usage
After building the image, just run
docker run -v /path/to/your/data:/mnt/volume -e ENV1=value -e ... your-image-id
To save the blog data, a Docker image is needed to be mounted into the container. If it is mounted at /usr/src/ghost/content,
then the whole volume will act as the content storage for Ghost.
However, in many CaaS providers like DaoCloud, one volume may be shared
across several containers. In this case, you can mount the volume to
another path like /mnt/volume, and point the environment variable GHOST_SITE_DATA to the full path of the data storage like /mnt/volume/ghost_content.
There are more environment variables to set: GHOST_SITE_HTTPS - Whether this site should force its urls to begin with https. Set to true to enable it. GHOST_SITE_URL - Full url to this site without the scheme. e.g. typeblog.netGHOST_MAILGUN_USER & GHOST_MAILGUN_PASS - REQUIREDMailgun API credentials。
from https://github.com/PeterCxy/docker-nginx-ghost
DESCRIPTION
-----------
The OpenSSL Project is a collaborative effort to develop a robust,
commercial-grade, fully featured, and Open Source toolkit implementing the
Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1)
protocols as well as a full-strength general purpose cryptography library.
The project is managed by a worldwide community of volunteers that use the
Internet to communicate, plan, and develop the OpenSSL toolkit and its
related documentation.
OpenSSL is based on the excellent SSLeay library developed from Eric A. Young
and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the
OpenSSL license plus the SSLeay license) situation, which basically means
that you are free to get and use it for commercial and non-commercial
purposes as long as you fulfill the conditions of both licenses.
OVERVIEW
--------
The OpenSSL toolkit includes:
libssl.a:
Implementation of SSLv2, SSLv3, TLSv1 and the required code to support
both SSLv2, SSLv3 and TLSv1 in the one server and client.
libcrypto.a:
General encryption and X.509 v1/v3 stuff needed by SSL/TLS but not
actually logically part of it. It includes routines for the following:
Ciphers
libdes - EAY's libdes DES encryption package which was floating
around the net for a few years, and was then relicensed by
him as part of SSLeay. It includes 15 'modes/variations'
of DES (1, 2 and 3 key versions of ecb, cbc, cfb and ofb;
pcbc and a more general form of cfb and ofb) including desx
in cbc mode, a fast crypt(3), and routines to read
passwords from the keyboard.
RC4 encryption,
RC2 encryption - 4 different modes, ecb, cbc, cfb and ofb.
Blowfish encryption - 4 different modes, ecb, cbc, cfb and ofb.
IDEA encryption - 4 different modes, ecb, cbc, cfb and ofb.
Digests
MD5 and MD2 message digest algorithms, fast implementations,
SHA (SHA-0) and SHA-1 message digest algorithms,
MDC2 message digest. A DES based hash that is popular on smart cards.
Public Key
RSA encryption/decryption/generation.
There is no limit on the number of bits.
DSA encryption/decryption/generation.
There is no limit on the number of bits.
Diffie-Hellman key-exchange/key generation.
There is no limit on the number of bits.
X.509v3 certificates
X509 encoding/decoding into/from binary ASN1 and a PEM
based ASCII-binary encoding which supports encryption with a
private key. Program to generate RSA and DSA certificate
requests and to generate RSA and DSA certificates.
Systems
The normal digital envelope routines and base64 encoding. Higher
level access to ciphers and digests by name. New ciphers can be
loaded at run time. The BIO io system which is a simple non-blocking
IO abstraction. Current methods supported are file descriptors,
sockets, socket accept, socket connect, memory buffer, buffering, SSL
client/server, file pointer, encryption, digest, non-blocking testing
and null.
Data structures
A dynamically growing hashing system
A simple stack.
A Configuration loader that uses a format similar to MS .ini files.
openssl:
A command line tool that can be used for:
Creation of RSA, DH and DSA key parameters
Creation of X.509 certificates, CSRs and CRLs
Calculation of Message Digests
Encryption and Decryption with Ciphers
SSL/TLS Client and Server Tests
Handling of S/MIME signed or encrypted mail
PATENTS
-------
Various companies hold various patents for various algorithms in various
locations around the world. _YOU_ are responsible for ensuring that your use
of any algorithms is legal by checking if there are any patents in your
country. The file contains some of the patents that we know about or are
rumored to exist. This is not a definitive list.
RSA Security holds software patents on the RC5 algorithm. If you
intend to use this cipher, you must contact RSA Security for
licensing conditions. Their web page is http://www.rsasecurity.com/.
RC4 is a trademark of RSA Security, so use of this label should perhaps
only be used with RSA Security's permission.
The IDEA algorithm is patented by Ascom in Austria, France, Germany, Italy,
Japan, the Netherlands, Spain, Sweden, Switzerland, UK and the USA. They
should be contacted if that algorithm is to be used; their web page is
http://www.ascom.ch/.
NTT and Mitsubishi have patents and pending patents on the Camellia
algorithm, but allow use at no charge without requiring an explicit
licensing agreement: http://info.isl.ntt.co.jp/crypt/eng/info/chiteki.html
INSTALLATION
------------
To install this package under a Unix derivative, read the INSTALL file. For
a Win32 platform, read the INSTALL.W32 file. For OpenVMS systems, read
INSTALL.VMS.
Read the documentation in the doc/ directory. It is quite rough, but it
lists the functions; you will probably have to look at the code to work out
how to use them. Look at the example programs.
PROBLEMS
--------
For some platforms, there are some known problems that may affect the user
or application author. We try to collect those in doc/PROBLEMS, with current
thoughts on how they should be solved in a future of OpenSSL.
SUPPORT
-------
See the OpenSSL website www.openssl.org for details of how to obtain
commercial technical support.
If you have any problems with OpenSSL then please take the following steps
first:
- Download the current snapshot from ftp://ftp.openssl.org/snapshot/
to see if the problem has already been addressed
- Remove ASM versions of libraries
- Remove compiler optimisation flags
If you wish to report a bug then please include the following information in
any bug report:
- On Unix systems:
Self-test report generated by 'make report'
- On other systems:
OpenSSL version: output of 'openssl version -a'
OS Name, Version, Hardware platform
Compiler Details (name, version)
- Application Details (name, version)
- Problem Description (steps that will reproduce the problem, if known)
- Stack Traceback (if the application dumps core)
Report the bug to the OpenSSL project via the Request Tracker
(http://www.openssl.org/support/rt.html) by mail to:
openssl-bugs@openssl.org
Note that the request tracker should NOT be used for general assistance
or support queries. Just because something doesn't work the way you expect
does not mean it is necessarily a bug in OpenSSL.
Note that mail to openssl-bugs@openssl.org is recorded in the publicly
readable request tracker database and is forwarded to a public
mailing list. Confidential mail may be sent to openssl-security@openssl.org
(PGP key available from the key servers).
HOW TO CONTRIBUTE TO OpenSSL
----------------------------
Development is coordinated on the openssl-dev mailing list (see
http://www.openssl.org for information on subscribing). If you
would like to submit a patch, send it to openssl-bugs@openssl.org with
the string "[PATCH]" in the subject. Please be sure to include a
textual explanation of what your patch does.
If you are unsure as to whether a feature will be useful for the general
OpenSSL community please discuss it on the openssl-dev mailing list first.
Someone may be already working on the same thing or there may be a good
reason as to why that feature isn't implemented.
Patches should be as up to date as possible, preferably relative to the
current Git or the last snapshot. They should follow the coding style of
OpenSSL and compile without warnings. Some of the core team developer targets
can be used for testing purposes, (debug-steve64, debug-geoff etc). OpenSSL
compiles on many varied platforms: try to ensure you only use portable
features.
Note: For legal reasons, contributions from the US can be accepted only
if a TSU notification and a copy of the patch are sent to crypt@bis.doc.gov
(formerly BXA) with a copy to the ENC Encryption Request Coordinator;
please take some time to look at
http://www.bis.doc.gov/Encryption/PubAvailEncSourceCodeNofify.html [sic]
and
http://w3.access.gpo.gov/bis/ear/pdf/740.pdf (EAR Section 740.13(e))
for the details. If "your encryption source code is too large to serve as
an email attachment", they are glad to receive it by fax instead; hope you
have a cheap long-distance plan.
Our preferred format for changes is "diff -u" output. You might
generate it like this:
# cd openssl-work
# [your changes]
# ./Configure dist; make clean
# cd ..
# diff -ur openssl-orig openssl-work > mydiffs.patch