View FeignRetryable.java
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
/** | |
* Enable retries on selected Feign methods. | |
* <p> | |
* <ol> | |
* <li>In the feign config class add: | |
* <pre> | |
* {@code | |
* @Bean | |
* public Retryer feignRetryer() { |
View Idempotent.java
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.extern.slf4j.Slf4j; | |
import org.springframework.data.redis.core.RedisTemplate; | |
import java.time.Duration; | |
import java.util.function.Supplier; | |
@Slf4j | |
public class Idempotent { | |
private static final String KEY_PREFIX = "idempotent-"; |
View RabbitMQConfig.java
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 com.rabbitmq.client.Connection; | |
import lombok.RequiredArgsConstructor; | |
import lombok.extern.slf4j.Slf4j; | |
import org.apache.camel.CamelContext; | |
import org.apache.camel.component.rabbitmq.RabbitMQEndpoint; | |
import org.apache.camel.component.rabbitmq.springboot.RabbitMQComponentConfiguration; | |
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.event.ContextRefreshedEvent; | |
import org.springframework.context.event.EventListener; |
View rpm_install
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
#!/bin/bash | |
set -e | |
#set -x | |
if [ "$#" -ne 2 ]; | |
then | |
echo "Usage: $0 <user@ip> [rpm url|file]" | |
exit | |
fi |
View jmx_endpoint_invoker.sh
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
#!/usr/lib/jvm/java/bin/java --source 17 | |
/* example | |
jmx_endpoint_invoker.sh Health health | |
*/ | |
import com.sun.tools.attach.AttachOperationFailedException; | |
import com.sun.tools.attach.VirtualMachine; | |
import com.sun.tools.attach.spi.AttachProvider; |
View builtin_cd.sh
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
#copy and paste in .bashrc and then: soruce .bashrc | |
# for windows pathes, you need to wrap it in double quotes | |
function cd() { | |
if [[ $@ == *"\\"* ]]; then | |
p=`wslpath "$@"` | |
builtin cd "$p" | |
else | |
builtin cd "$@" | |
fi |
View redis_subscribe.py
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 socket | |
class RedisClient: | |
def __init__(self, **kwargs): | |
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
self.sock.connect((kwargs['host'], kwargs['port'])) | |
def subscribe(self, channel): |
View scw
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
#!/usr/bin/env python3 | |
import subprocess | |
import sys | |
SCW_TYPE = 'DEV1-S' | |
SCW_ZONE = 'nl-ams-1' | |
SCW_IMAGE = 'centos_8' | |
SCW_PROJECT_ID = '<projectid>' | |
LOG_CMD = False |
View nearest.go
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"os" | |
"os/signal" | |
"time" | |
) |
View MultiRabbitConfig.java
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.Data; | |
import lombok.RequiredArgsConstructor; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.amqp.core.Message; | |
import org.springframework.amqp.rabbit.annotation.MultiRabbitListenerAnnotationBeanPostProcessor; | |
import org.springframework.amqp.rabbit.annotation.RabbitListenerAnnotationBeanPostProcessor; | |
import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory; | |
import org.springframework.amqp.rabbit.connection.*; | |
import org.springframework.amqp.rabbit.core.RabbitAdmin; | |
import org.springframework.amqp.rabbit.core.RabbitTemplate; |
NewerOlder