- A
secretbyte 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
secretfrompriv_memand the use of its value in (4) and (5) below may execute before the exception is triggered. - Calculate an
offsetinto a known arrayprobeby multiplyingsecretby 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
probeto find out which one loads fast. You've determined the value ofsecret.
This file contains hidden or 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
| // Add on element with overflow | |
| -webkit-mask-image: -webkit-radial-gradient(white, black); |
This file contains hidden or 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 | |
| # my git difftool, calls FileMerge with project as -merge target | |
| # better than using opendiff | |
| # | |
| # cd to your project dir and and run difftool like this: | |
| # git difftool -d -x gdiff | |
| # find top level of git project | |
| dir=$PWD | |
| until [ -e "$dir/.git" ]; do |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
This file contains hidden or 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
| <?php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Http\Response; | |
| use Symfony\Component\DomCrawler\Crawler; | |
| class PjaxMiddleware |
This file contains hidden or 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
| <?php | |
| namespace App\Redis; | |
| use Redis; | |
| use Illuminate\Redis\Database as RedisDatabase; | |
| use Illuminate\Contracts\Redis\Database as DatabaseContract; | |
| class Database extends RedisDatabase implements DatabaseContract | |
| { |
This file contains hidden or 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
| <?php | |
| namespace Helper; | |
| // Select2 helpers for the jQuery based replacement for select boxes. | |
| // See: http://select2.github.io/select2 | |
| // Author: Tortue Torche <[email protected]> | |
| // License: MIT | |
| // | |
| // Installation: | |
| // * Put this file in your 'tests/_support/Helper' directory |
This file contains hidden or 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
| echo "$STRING" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z |
This file contains hidden or 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
| Regex search and replace for form helpers as follows: | |
| Search: | |
| \{\{ (Form\:\:.+) \}\} | |
| Replace: | |
| {!! $1 !!} |