Skip to content

Instantly share code, notes, and snippets.

@felipeg48
felipeg48 / tmux-cheat-sheet.md
Created November 7, 2019 14:42 — forked from michaellihs/tmux-cheat-sheet.md
tmux Cheat Sheet

Best Practices for Azure Redis

Below are a set of best practices that I recommend for most customers. This information is based on my experience helping hundreds of Azure Redis customers investigate various issues.

Configuration and Concepts

  1. Use Standard or Premium Tier for Production systems. The Basic Tier is a single node system with no data replication and no SLA. Also, use at least a C1 cache. C0 caches are really meant for simple dev/test scenarios since they have a shared CPU core, very little memory, are prone to "noisy neighbor", etc.
  2. Remember that Redis is an In-Memory data store. Read this article so that you are aware of scenarios where data loss can occur.
  3. Configure your client library to use a "connect timeout" of at least 10 to 15 seconds, giving the system time to connect even under higher CPU conditions. If your client or server tend to be under high load
@felipeg48
felipeg48 / create-certs.sh
Created October 30, 2018 19:02 — forked from gesellix/create-certs.sh
add TLS/self-signed certificates to the Docker for Mac daemon
#!/bin/sh
mkdir -p certs
openssl req -x509 -days 365 -newkey rsa:4096 -nodes -sha256 -out certs/domain.crt -keyout certs/domain.key -subj "/C=DE/ST=Berlin/L=Berlin/O=IT/CN=docker.local"
@felipeg48
felipeg48 / Permutations.java
Created August 13, 2018 02:55 — forked from jaycobbcruz/Permutations.java
Find all permutations of given items using Java 8
public class Permutations {
public static <T> Stream<Stream<T>> of(final List<T> items) {
return IntStream.range(0, factorial(items.size())).mapToObj(i -> permutation(i, items).stream());
}
private static int factorial(final int num) {
return IntStream.rangeClosed(2, num).reduce(1, (x, y) -> x * y);
}
@felipeg48
felipeg48 / INSTALL.txt
Created May 9, 2018 16:01 — forked from fernandoaleman/INSTALL.txt
Shell script to sync remote branches from upstream and push them up to forked origin
1. Copy 'git-sync-fork' script code from gist
2. Create a file called 'git-sync-fork' in any 'bin' directory in your $PATH
3. Paste script into this new file 'git-sync-fork' and save
4. Make the file executable `chmod +x git-sync-fork`
5. Run the script inside your locally forked git repo
Example:
git-sync-fork upstream origin
@felipeg48
felipeg48 / introrx.md
Created January 13, 2017 06:22 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@felipeg48
felipeg48 / EnableSomeBeansSelector.java
Created June 25, 2016 20:18 — forked from bijukunjummen/EnableSomeBeansSelector.java
Spring Enable Annotation with Selectors
package enableannot.selector;
import org.springframework.context.annotation.Import;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@felipeg48
felipeg48 / Application.java
Created June 25, 2016 20:14 — forked from SlyDen/Application.java
Sample of Spring Boot config with custom setting for embedded Tomcat And OAuth ... imports are skiped. https://github.com/joshlong/the-spring-rest-stack/blob/master/code/web/oauth/src/main/java/com/jl/crm/web/Application.java
@ComponentScan
@Import(ServiceConfiguration.class)
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
@EnableAutoConfiguration
public class Application extends SpringBootServletInitializer {
private static Class<Application> applicationClass = Application.class;
public static void main(String[] args) {
SpringApplication.run(applicationClass);
}
@Grab('org.quartz-scheduler:quartz:2.1.6')
@Grab('org.slf4j:slf4j-simple:1.7.1')
import org.quartz.*
import org.quartz.impl.*
import org.quartz.jobs.*
import static org.quartz.DateBuilder.*
import static org.quartz.JobBuilder.*
import static org.quartz.TriggerBuilder.*
import static org.quartz.CalendarIntervalScheduleBuilder.*