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
# singleton_decorator.py | |
from __future__ import annotations | |
from typing import Any, Callable, TypeVar, Type, cast | |
T = TypeVar("T", bound=type) | |
def singleton(cls: T) -> T: | |
# Enforce single instance by intercepting __call__ on the metatype of this class | |
# without changing the symbol's type. | |
# Option A: wrap __new__ on the class |
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
#!/usr/bin/env bash | |
set -euo pipefail | |
log() { echo "[provision] $*"; } | |
# Ensure apt is usable | |
if command -v apt-get >/dev/null 2>&1; then | |
log "apt-get update" | |
sudo apt-get update -y || apt-get update -y || true | |
log "install ffmpeg + libsndfile1" |
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
1. Download Magento 1.7 | |
2. Enable https://stackoverflow.com/a/36407094/1167269 | |
3. sudo apt install php7.0-xml php-xml php7.0-gd php7.0-mcrypt php7.0-mysql | |
4. Change Line 555 in app/code/core/Mage/Core/Model/Layout.php | |
5. Make sure that pdo_mysql extension is enabled in php.ini | |
6. https://stackoverflow.com/a/15443527/1167269 |
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://github.com/elastic/elasticsearch/blob/master/docs/java-api/aggregations/metrics/tophits-aggregation.asciidoc |
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
There is a whole section about in the documents: | |
http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.multiple-modules | |
Basically if you are using the generic interfaces (e.g. CrudRepository) then Spring won't know if you want that repository to be backed on the spring-mongodb or spring-redis data modules. | |
Sources: | |
http://stackoverflow.com/questions/39432764/info-warnings-about-multiple-modules-in-spring-boot-what-do-they-mean |
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
{ | |
"cluster_name": "es_app", | |
"nodes": { | |
"0wkHZVDnQPKFggbPogcxhw": { | |
"timestamp": 1474481441697, | |
"name": "es_app-elasticsearch-prd-sg2-01", | |
"transport_address": "inet[/16.0.1.78:9300]", | |
"host": "es_app-elasticsearch-prd-sg2-01.sd.int", | |
"ip": ["inet[/16.0.1.78:9300]", "NONE"], | |
"attributes": { |
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
::: [app-elasticsearch-prd-sg2-01][0wkHZVDnQPKFggbPogcxhw][app-elasticsearch-prd-sg2-01.sd.int][inet[/16.0.1.78:9300]]{master=false} | |
Hot threads at 2016-09-21T17:57:43.345Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true: | |
::: [app-elasticsearch-prd-sg2-08][DKZvxCenTDaOLLr6xcBSTw][app-elasticsearch-prd-sg2-08.sd.int][inet[/16.0.1.221:9300]]{data=false, master=true} | |
Hot threads at 2016-09-21T17:57:43.343Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true: | |
::: [app-elasticsearch-prd-sg2-06][NUUji2PqQOGti1B9y0Qy6A][app-elasticsearch-prd-sg2-06.sd.int][inet[/16.0.1.119:9300]]{master=false} | |
Hot threads at 2016-09-21T17:57:43.345Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true: | |
::: [app-elasticsearch-prd-sg2-03][GCBd_Gr2S06Xa_6nSn0omQ][app-elasticsearch-prd-sg2-03.sd.int][inet[/16.0.1.77:9300]]{master=false} |
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
::: [app-elasticsearch-prd-sg2-01][0wkHZVDnQPKFggbPogcxhw][app-elasticsearch-prd-sg2-01.sd.int][inet[/16.0.1.78:9300]]{master=false} | |
Hot threads at 2016-09-21T11:10:59.058Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true: | |
17.3% (86.7ms out of 500ms) cpu usage by thread 'elasticsearch[app-elasticsearch-prd-sg2-01][search][T#14]' | |
3/10 snapshots sharing following 26 elements | |
org.apache.lucene.util.packed.DeltaPackedLongValues.get(DeltaPackedLongValues.java:39) | |
org.apache.lucene.util.packed.PackedLongValues.get(PackedLongValues.java:110) | |
org.apache.lucene.util.LongValues.get(LongValues.java:45) | |
org.elasticsearch.index.fielddata.plain.PackedArrayIndexFieldData$10.get(PackedArrayIndexFieldData.java:492) | |
org.apache.lucene.index.SingletonSortedNumericDocValues.setDocument(SingletonSortedNumericDocValues.java:52) |
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
[INFO] com.google.code.findbugs:jsr305:jar:2.0.1:compile | |
[INFO] org.atteo:evo-inflector:jar:1.2.1:compile | |
[INFO] org.apache.lucene:lucene-sandbox:jar:4.10.4:compile | |
[INFO] org.springframework:spring-expression:jar:4.2.6.RELEASE:compile | |
[INFO] log4j:log4j:jar:1.2.17:compile | |
[INFO] aopalliance:aopalliance:jar:1.0:compile | |
[INFO] org.slf4j:jul-to-slf4j:jar:1.7.21:compile | |
[INFO] org.ow2.asm:asm-commons:jar:4.1:compile | |
[INFO] org.hibernate:hibernate-validator:jar:5.2.4.Final:compile | |
[INFO] org.springframework:spring-aop:jar:4.2.6.RELEASE:compile |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | |
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.project.microservice</groupId> | |
<artifactId>search</artifactId> | |
<version>1.0.0</version> | |
<packaging>war</packaging> | |
<inceptionYear>2015</inceptionYear> |
NewerOlder