Skip to content

Instantly share code, notes, and snippets.

@amir-rahnama
amir-rahnama / stackfile.yml
Last active October 22, 2017 00:58
Stackfile for Docker Cloud ElasticSearch Cluster (with Kibana)
es-master:
image: 'elasticsearch:latest'
command: 'elasticsearch --network.host=0.0.0.0 --node.master=true --cluster.name=escluster'
restart: always
es-develop:
image: 'elasticsearch:latest'
command: 'elasticsearch --network.host=0.0.0.0 --cluster.name=escluster --discovery.zen.ping.unicast.hosts=es-master'
deployment_strategy: high_availability
links:
- es-master
@deviantony
deviantony / README.md
Last active September 4, 2024 02:41
Portainer HTTP API by example

DEPRECATION NOTICE

This gist is now deprecated in favor of our official documentation: https://documentation.portainer.io/api/api-examples/ which contains up to date examples!

THE FOLLOWING DOCUMENTATION IS DEPRECATED

Please refer to the link above to get access to our updated API documentation and examples.

@headius
headius / meltdown_in_a_nutshell.md
Last active July 27, 2018 13:43
How Meltdown Works

Algorithm

  1. A secret byte you want to read is stored at inaccessible memory location priv_mem.
  2. The sender triggers an access exception by attempting to read priv_mem.
  3. Due to CPU optimization (out-of-order execution), the load of secret from priv_mem and the use of its value in (4) and (5) below may execute before the exception is triggered.
  4. Calculate an offset into a known array probe by multiplying secret by the width of a cache line (or whatever block size the CPU typically fetches, like a 4096-byte page). This guarantees each of those 256 possible offsets will cache separately.
  5. Load probe[offset], which causes the CPU to cache exactly one chunk of of our array, populating one cache line.
  6. The exception finally triggers, clearing the modified registers...but cached data is not excised.
  7. Iterate over all 256 offsets into probe to find out which one loads fast. You've determined the value of secret.