... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| " XDG Environment For VIM | |
| " ======================= | |
| " | |
| " References | |
| " ---------- | |
| " | |
| " - http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables | |
| " - http://tlvince.com/vim-respect-xdg | |
| " - https://gist.github.com/kaleb/3885679 (the original version) | |
| " | 
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| # post_loc.txt contains the json you want to post | |
| # -p means to POST it | |
| # -H adds an Auth header (could be Basic or Token) | |
| # -T sets the Content-Type | |
| # -c is concurrent clients | |
| # -n is the number of requests to run in the test | |
| ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ | 
| # Deployment server info | |
| set :application, "APP NAME" | |
| set :domain, "APP DOMAIN NAME" | |
| set :deploy_to, "/path/on/live/server" | |
| set :app_path, "app" | |
| set :web_path, "web" | |
| set :maintenance_basename, "maintenance" | |
| # SCM info | |
| set :repository, "GIT REMOTE REPO URL" | 
| # Inspired from http://blog.hio.fr/2011/09/17/doctrine2-yaml-mapping-example.html | |
| MyEntity: | |
| type: entity | |
| repositoryClass: MyRepositoryClass | |
| table: my_entity | |
| namedQueries: | |
| all: "SELECT u FROM __CLASS__ u" | |
| # Class-Table-Inheritance | 
| server { | |
| listen 80; | |
| server_name localhost; | |
| root /home/website/web; | |
| rewrite ^/app\.php/?(.*)$ /$1 permanent; | |
| try_files $uri @rewriteapp; | |
| location @rewriteapp { | 
| This playbook has been removed as it is now very outdated. | 
| <?php | |
| abstract class BaseModelManager { | |
| protected $em; | |
| protected $class; | |
| protected $repository; | |
| protected $container; | |
| /** | |
| * Constructor. | 
| function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s } | |
| function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s } | |
| function trim(s) { return rtrim(ltrim(s)); } | |
| BEGIN { | |
| # whatever | |
| } | |
| { | |
| # whatever | |
| } | |
| END { | 
Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/