curl -s https://packagecloud.io/install/repositories/varnishcache/varnish41/script.deb.sh | sudo bashsudo nano /usr/share/varnish/reload-vcl
| eval "local _prefix = ARGV[1];\nlocal _keys = redis.call('keys', _prefix);\nfor i, _key in ipairs(_keys) do\n redis.call('del', _key);\nend" 0 REGEX |
| Enabling URL token validation | |
| Last updated December 15, 2016 | |
| Token validation allows you to create URLs that expire. Tokens are generated within your web application and appended to URLs in a query string. Requests are authenticated at Fastly's edge instead of your origin server. When Fastly receives a request for the URL, the token is validated before serving the content. After a configurable period of time, the token expires. | |
| Adding custom VCL | |
| To enable token validation, you'll need to create a Varnish configuration named vcl_recv and add the following example code to it. | |
| IMPORTANT: The ability to upload custom VCL code is disabled by default when you sign up. To enable this ability for your account, contact support@fastly.com and request it. | |
| /* make sure there is a token */ | |
| if (req.url !~ ".+\?.*token=(\d{10,11})_([^&]+)") { |
| Install docker CE ubuntu how sudo | |
| # curl -sSL get.docker.io | sh |
| var HelloMessage = React.createClass({ | |
| render: function() { | |
| return <div tabIndex="1" onBlur={this.onBlur}> | |
| Hello <input type="text" value="wat"/> | |
| </div>; | |
| }, | |
| onBlur: function(e) { | |
| var currentTarget = e.currentTarget; |
| axios.all([ | |
| axios.get('http://google.com'), | |
| axios.get('http://apple.com') | |
| ]) | |
| .then(axios.spread((googleRes, appleRes) => { | |
| // do something with both responses | |
| }); |
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>ESNext Bin Sketch</title> | |
| <!-- put additional styles and scripts here --> | |
| <link href="https://fonts.googleapis.com/css?family=Glass+Antiqua" rel="stylesheet" type="text/css"> | |
| <!-- CSS Reset --> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css"> | |
| from IPython.core.magic import register_line_magic | |
| @register_line_magic | |
| def clip(line): | |
| global_dict = globals() | |
| if not line in global_dict: | |
| return | |
| value = global_dict[line] | |
| import os | |
| os.system("echo '%s' | pbcopy" % str(value)) | |
| del clip |
| { "keys": ["f8"], "command": "permute_lines", "args": {"operation": "unique"} } |
| #!/bin/bash | |
| ### Install PHP 5.5.38 on Ubuntu 16.04 64Bits | |
| ### https://www.howtoforge.com/tutorial/how-to-install-php-5-6-on-ubuntu-16-04/ | |
| apt-get -y install build-essential libxml2-dev libxslt1-dev | |
| apt-get -y install libfcgi-dev libfcgi0ldbl libjpeg62-dbg libxml2-dev | |
| apt-get -y install libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev | |
| apt-get -y install libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev | |
| apt-get -y install libfreetype6-dev libkrb5-dev libpq-dev libicu-dev |