This file contains 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
# syntax = docker/dockerfile:1.2 | |
# Use the empty image with the portage tree as the first stage | |
FROM gentoo/portage:latest as portage | |
# Gentoo stage3 is the second stage, basically an unpacked Gentoo Linux | |
FROM gentoo/stage3:amd64-systemd as base | |
# FROM ksmanis/stage3:latest as base | |
LABEL org.opencontainers.image.authors="andreev.mipt@gmail.ru" |
This file contains 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
{ | |
"data": [ | |
{ | |
"measure": [ | |
"relative", | |
"relative", | |
"relative", | |
"relative", | |
"relative", | |
"relative", |
This file contains 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
@Configuration | |
class RestTemplateCustomConfig { | |
@Autowired | |
lateinit var restTemplate: RestTemplate | |
@PostConstruct | |
fun restOperations() { | |
restTemplate.messageConverters.add(0, mappingJacksonHttpMessageConverter()) |
This file contains 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 lombok.SneakyThrows; | |
import lombok.extern.slf4j.Slf4j; | |
import org.apache.commons.lang3.ClassUtils; | |
import org.apache.commons.lang3.StringUtils; | |
import org.apache.commons.lang3.reflect.FieldUtils; | |
import java.lang.reflect.Field; | |
import java.time.temporal.Temporal; | |
import java.util.ArrayDeque; | |
import java.util.ArrayList; |
This file contains 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
private final static ExecutorService EXECUTOR_2019V2 = createExecutorService(8, 64); | |
public static ExecutorService createExecutorService(int threadsCount, int queueCapacity) { | |
BlockingQueue queue = new ArrayBlockingQueue(queueCapacity); | |
AtomicInteger thrIdx = new AtomicInteger(0); | |
ThreadPoolExecutor executor = new ThreadPoolExecutor(threadsCount, threadsCount, 0, TimeUnit.MILLISECONDS, | |
queue, r -> new Thread(r, "2019v2_" + thrIdx.incrementAndGet())); | |
executor.setRejectedExecutionHandler((r, ex) -> { | |
log.warn("Task {} rejected for 2019_v2", r.toString()); | |
}); |
This file contains 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 javax.net.ssl.SSLSocket; | |
import javax.net.ssl.SSLSocketFactory; | |
import java.io.*; | |
/** Establish a SSL connection to a host and port, writes a byte and | |
* prints the response. See | |
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services | |
*/ | |
public class SSLPoke { | |
public static void main(String[] args) { |
This file contains 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
~/.m2/settings.xml | |
<proxies> | |
<proxy> | |
<id>[org]</id> | |
<active>true</active> | |
<protocol>http</protocol> | |
<username>{USERNAME}</username> | |
<password>{PASSWORD}</password> | |
<host>127.0.0.1</host> |
This file contains 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://habr.com/ru/post/435594/ | |
https://habr.com/ru/post/358724/ |
This file contains 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://gist.github.com/ptarjan/e38f45f2dfe601419ca3af937fff574d#request-rate-limiter | |
https://stripe.com/en-US/blog/rate-limiters | |
https://redislabs.com/redis-best-practices/basic-rate-limiting/ | |
https://medium.com/figma-design/an-alternative-approach-to-rate-limiting-f8a06cf7c94c | |
https://www.dr-josiah.com/2014/11/introduction-to-rate-limiting-with_26.html | |
https://www.dr-josiah.com/2014/11/introduction-to-rate-limiting-with.html | |
https://github.com/wangzheng0822/ratelimiter4j | |
https://github.com/chriso/redback/blob/master/lib/advanced_structures/RateLimit.js | |
https://github.com/hamsterready/redis-ratelimit | |
https://github.com/marcosbarbero/spring-cloud-zuul-ratelimit |
This file contains 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://www.redisgreen.net/blog/intro-to-lua-for-redis-programmers/ | |
https://www.compose.com/articles/a-quick-guide-to-redis-lua-scripting/ |
NewerOlder