Skip to content

Instantly share code, notes, and snippets.

View shibli049's full-sized avatar

Tahmim Ahmed Shibli shibli049

View GitHub Profile
diff --brief --recursive --new-file ./first_dir/ /location/to/second_dir | grep -v '/.git/' # ignore .git directory
version: '2.2'
services:
limited-logging-container:
image: alpine:latest
logging:
options:
max-size: "200k"
max-file: "10"
# Remove the volumes associated with the container
docker rm -v $(docker ps -aq)
# Remove images
docker rmi $(docker images -aq)
# Remove all unused local volumes
docker volume prune
# Remove all dangling volumes
@shibli049
shibli049 / System Design.md
Created July 9, 2019 13:29 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
netsh wlan show profiles
netsh wlan show profile name=profilename key=clear
@Test
@DisplayName("Time assertions")
@RepeatedTest(10)
public void timeAssertion(){
assertTimeout(Duration.ofSeconds(1), () -> {
Thread.sleep(100);
System.out.println("hello world!!");
});
}
@shibli049
shibli049 / ForEachWith.java
Last active November 26, 2018 13:03
Iterate list/array with index
public class ForEachWith {
public static <T> Iterable<Index<T>> index(final T[] array) {
return () -> new Iterator<Index<T>>() {
int index = 0;
public boolean hasNext() {
return index < array.length;
}
public Index<T> next() {
return new Index(array[index], index++);
import java.util.Hashtable;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.Context;