- A
secret
byte you want to read is stored at inaccessible memory locationpriv_mem
. - The sender triggers an access exception by attempting to read
priv_mem
. - Due to CPU optimization (out-of-order execution), the load of
secret
frompriv_mem
and the use of its value in (4) and (5) below may execute before the exception is triggered. - Calculate an
offset
into a known arrayprobe
by multiplyingsecret
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. - Load
probe[offset]
, which causes the CPU to cache exactly one chunk of of our array, populating one cache line. - The exception finally triggers, clearing the modified registers...but cached data is not excised.
- Iterate over all 256 offsets into
probe
to find out which one loads fast. You've determined the value ofsecret
.
This gist is now deprecated in favor of our official documentation: https://documentation.portainer.io/api/api-examples/ which contains up to date examples!
Please refer to the link above to get access to our updated API documentation and examples.
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
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 |
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
elasticsearch: | |
image: 'elasticsearch:1.5' | |
ports: | |
- '9200:9200' | |
logstash: | |
image: 'logstash' | |
command: 'logstash -e "input { syslog { port => 12345 type => "docker" } } output { elasticsearch { hosts => "elasticsearch" } }"' | |
expose: | |
- '12345/tcp' |
Relevant Rails PRs
- rails/rails#16052
- https://github.com/rails/rails/commit/2c46d6db4feaf4284415f2fb6ceceb1bb535f278
- https://github.com/rails/rails/commit/39f2c3b3ea6fac371e79c284494e3d4cfdc1e929
- https://github.com/rails/rails/commit/bdc5141652770fd227455681cde1f9899f55b0b9
- https://github.com/rails/rails/commit/d26dd00854c783bcb1249168bb3f4adf9f99be6c
h/t to http://juanitofatas.com/2015/01/31/rails-5-active-record-or/ for some more useful links
It is important not to hide composition. It should be done centrally, at the root of the application.
In angular there are 2 different resources we must compose in order to build an application
-
Using a composition root we map
directives
,controllers
, andservices
into theinjector
. -
Using routing we compose views from HTML
partials
andcontrollers
for each different application state.
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
# This file extends and overrides parts of the ActiveAdmin DSL and internals | |
# in order to provide support for automatically displaying and editing images, | |
# which in our infrastructure are stored as URLs whose column names end in "img". | |
# Since this file will be reloaded frequently in the development environment, | |
# all operations done at load time (class_eval's, etc.) MUST be idempotent. | |
ActiveAdmin::Views::TableFor.class_eval do | |
def img_column(col_sym=:img, title="Image") | |
column title, sortable: false do |obj| |
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
module Capybara::Poltergeist | |
class Client | |
private | |
def redirect_stdout(to) | |
prev = STDOUT.dup | |
prev.autoclose = false | |
$stdout = to | |
STDOUT.reopen(to) | |
prev = STDERR.dup |
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
# This is a program trying to implement Verbal Expressions | |
# See this for more info - http://verbalexpressions.github.io/ | |
def VerEx | |
VerExClass.new | |
end | |
class VerExClass | |
attr_accessor :regex | |
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
module ActiveAdminHelper | |
def admin_arbre_context | |
@admin_arbre_context ||= Arbre::Context.new(assigns, self) | |
end | |
def default_renderer | |
case controller.send(:resource_class).name | |
when "ActiveAdmin::Page" | |
"page" |
NewerOlder