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
ssh_options[:keys] = [File.join(Dir.pwd, "config", "ubuntu.pem")] | |
set :application, "MyAPPNAME" | |
set :repository, "git@github.com:necromant2005/MYAPPName.git" | |
# If you aren't deploying to /u/apps/#{application} on the target | |
# servers (which is the default), you can specify the actual location | |
# via the :deploy_to variable: | |
set :deploy_to, "/var/www/#{application}" |
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
server { | |
server_name myhost.com www.myhost.com; | |
root /var/www/MyAppName/public; | |
index index.php; | |
location / { | |
if (!-e $request_filename) { | |
rewrite ^.*$ /index.php last; | |
} |
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
<?php | |
$dir = __DIR__ . "/nginx"; | |
foreach (new DirectoryIterator($dir) as $item) { | |
if (!$item->isFile()) continue; | |
if (strpos($item, 'access')===false) { | |
unlink($item->getPathname()); | |
continue; | |
} | |
if (!strpos($item, '.gz')) continue; | |
system('gunzip ' . escapeshellarg($item->getPathname())); |
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
<?php | |
$landing = '/'; | |
$goal = '/metric?signup'; | |
$retention = '/metric?signin'; | |
$dir = __DIR__ . '/nginx'; | |
$full = __DIR__ . '/full.log'; | |
unlink($full); | |
for($i=0;$i<100;$i++) { |
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
<?php | |
$landing = '/'; | |
$goal = '/metric?signup'; | |
$retention = '/metric?signin'; | |
$dir = __DIR__ . '/nginx'; | |
$full = __DIR__ . '/full.log'; | |
unlink($full); | |
for($i=0;$i<100;$i++) { |
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
$ brew install ec2-api-tools | |
# -- add the following into $HOME/.bash_profile: | |
# export REGION='us-west-2' | |
# export EC2_KEYPAIR="$HOME/.ssh/ec2-$REGION.pem" | |
# export EC2_HOME="`brew --prefix ec2-api-tools`/jars" | |
# export EC2_URL="https://ec2.$REGION.amazonaws.com" | |
# export EC2_CERT="$(/bin/ls $HOME/.ec2/cert-*.pem)" | |
# export EC2_PRIVATE_KEY="$(/bin/ls $HOME/.ec2/pk-*.pem)" |
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
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
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
[Unit] | |
Description=consul agent | |
Requires=network-online.target | |
After=network-online.target | |
[Service] | |
EnvironmentFile=-/etc/sysconfig/consul | |
Environment=GOMAXPROCS=2 | |
Restart=on-failure | |
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d |
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
sudo apt-get install bind9 bind9utils bind9-doc | |
wget https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip | |
/etc/bind/named.conf.options: | |
options { | |
directory "/var/cache/bind"; | |
recursion yes; | |
allow-query { localhost; }; | |
forwarders { |
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
<?php | |
// async php client | |
$request = ''; | |
$request .= "GET / HTTP/1.1\r\n"; | |
$request .= "Host: google.com\r\n"; | |
$request .= "Connection: Close\r\n\r\n"; | |
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
socket_set_nonblock($socket); |
OlderNewer