Always safe, Always fun
If you’re not paying for the product, you are the product.
Durex - Always safe, Always fun.
心流 / 心流れ / Flow
A feeling of complete absorption when you’re engaged in something you love to do without being disrupted by anxiety or boredom.
References
- Flow (psychology), https://en.wikipedia.org/wiki/Flow_(psychology)
The longest official place name in Australia
Mamungkukumpurangkuntjunya Hill, is a hill in South Australia. The name means “where the devil urinates” in the regional Pitjantjatjara language. The name is the longest official place name in Australia. The hill is located approximately 108.8 km west north-west of Marla.
House Prices Down Under
A look at historical house prices in Sydney and Melbourne from 1880 to 2010.
Melbourne Median vs Average Wage 1965 - 2010.
It must be remembered that house prices are determined by the demand and supply of credit, not the demand for and supply of housing.
房价不与国民收入,社会福利放在一起进行讨论,无异于光天化日里耍流氓。
AlphaGo movie
AlphaGo is an intriguing movie, full of striking imagery.
Proud of witnessing DeepMind and Google are making history …
The A.I. Revolution Will Not Be Supervised
“The A.I. Revolution Will Not Be Supervised.”
- Yann LeCun
RESTful calls to create Index and Mappings in ElasticSearch
There is a simple way, using RESTful client to create Index and Mappings in ElasticSearch, for example, with ElasticSearch Head plugin.
Create Index in ElasticSearch with Settings JSON file. URL: http://localhost:9200/orders/, Method: PUT
1 | { |
Create Mappings in ElasticSearch with Mappings JSON file. URL: http://localhost:9200/orders/_mapping/order, Method: PUT
1 | { |
To add a new fields to ElasticSearch, while dynamic mapping is off:
1 | { |
Run with additional fields JSON file, with URL: http://localhost:9200/orders/_mapping/order, Method: PUT
1 | { |
An ElasticSearch query example, with URL: http://localhost:9200/orders/_search, Method: POST
1 | { |
An example query with date/time type in a range:
1 | { |
AWS access key id and secret access key
There are some secret of AWS credentials, i.e., its Access Key ID and Secret Access Key, which let you connect AWS services withouth authentication.
In a quintessential project environment, you have dev, test, prod environment setup in AWS. Your local AWS_PROFILE is something like this so you can switch to different targeting end services while run your application on localhost:
1 | 𝜆 cat ~/.aws/credentials |
When test Jest client in Test environment, a AWS ElasticSearch client library, error thrown:
1 | 2018-02-27 15:18:19 INFO org.paradise.search.routes.ElasticSearchRoute - Body: io.searchbox.core.Index@4804b850[uri=orders/order/4SMK1UmbtqIAAAFhmYAFt9V7,method=PUT] message: searchIndexRoute - updating search index |
It turns out that WRONG Dev AWS_PROFILE applied in Test environment.
Replacing “aws_access_key_id” and “aws_secret_access_key” from the default profile with “aws_access_key_id” and “aws_secret_access_key” from test profile:
1 | 𝜆 cat ~/.aws/credentials |
Rerun the test and in log:
1 | 2018-02-27 15:23:54 INFO org.paradise.search.routes.ElasticSearchRoute - Body: io.searchbox.core.Index@62b18125[uri=orders/order/RVwK1UIBXmoAAAFhdJkFo9WA,method=PUT] message: searchIndexRoute - updating search index |
AWS ElasticSearch and Kibana proxy setup
There are several ways to access Amazon AWS ElasticSearch and Kibana services, which are HTTP based, without inject into HTTP request headers with authentication key …
AWS ES Proxy
Install a proxy application - AWS ES/Kibana Proxy. Download it from https://www.npmjs.com/package/aws-es-kibana and install:
1 | $ npm install -g aws-es-kibana |
Run AWS ES/Kibana Proxy then connect to ElasticSearch and Kibana services on AWS:
1 | $ cat ~/.aws/config |
With Fish Shell:
1 | 𝜆 env AWS_PROFILE=ap-test aws-es-kibana search-paradise-esv5-test-01-esd-blah23dlaoed81nz890adle4.ap-southeast-2.es.amazonaws.com |
SSH Tunnel
Set up SSH Tunnel for AWS ElasticSearch https://search-paradise-esv5-test-01-esd-blah23dlaoed81nz890adle4.ap-southeast-2.es.amazonaws.com from 443 port to localhost 9200:
1 | 𝜆 ssh -L 9200:search-paradise-esv5-test-01-esd-blah23dlaoed81nz890adle4.ap-southeast-2.es.amazonaws.com:443 -l ec2-user aws-jump-box |
Then access AWS ElasticSearch at: https://localhost:9200, AWS Kibana at: https://localhost:9200/_plugin/kibana
ElasticSearch Head
With plugin ElasticSearch Head, to query ElasticSearch, using URL and index “orders-search-box” e.g. https://localhost:9200/orders-search-test/, and context path “_search”