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
def get_hosts_for_role(role, puppetmaster="puppetmaster.mydomain.net"): | |
""" Query the puppetmaster for hosts of nodes whose server_role fact matches the given role """ | |
return yaml.load(local('ssh -T {0} \'curl -s -k -H "Accept: yaml" https://localhost:8140/production/facts_search/search?facts.server_role={1}\' | awk \'!/baseami/\''.format(puppetmaster, role), capture=True) |
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
### Keybase proof | |
I hereby claim: | |
* I am tystr on github. | |
* I am tylerstroud (https://keybase.io/tylerstroud) on keybase. | |
* I have a public key whose fingerprint is 51CB 684A 14D0 7C2D 3E41 0964 2D84 6E4B 7781 B996 | |
To claim this, I am signing this object: |
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 { | |
listen 80; | |
server_name ~(?<parentjob>[^_]+)_(?<childjob>[^.]+)\.mydomain\.dev; | |
location / { | |
root /var/lib/jenkins/workspace/$parentjob/$childjob/web; | |
return 200 $childjob; | |
try_files $uri /app.php$is_args$args; | |
} |
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
#!/bin/bash | |
# Script variables | |
SF2_ENVIRONMENT=prod | |
REPOSITORY= | |
DEPLOY_BASE_DIR=/var/www | |
DEPLOY_DIR=$DEPLOY_BASE_DIR/`date +%s` | |
USAGE="Usage: $0 install|update [git_repository_url]" | |
# Commands |
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
[pagerfanta] | |
git=http://github.com/whiteoctober/Pagerfanta.git | |
[WhiteOctoberPagerfantaBundle] | |
git=http://github.com/whiteoctober/WhiteOctoberPagerfantaBundle.git | |
target=/bundles/WhiteOctober/PagerfantaBundle | |
version=origin/symfony2.0 |
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
/** | |
* @param FilterResponseEvent $event | |
*/ | |
public function onResponse(FilterResponseEvent $event) | |
{ | |
$cookie = new Cookie('my_id', 1); | |
$response = $event->getResponse(); | |
$response->headers->setCookie($cookie); | |
} |
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 | |
// autloload.php.dist | |
$vendorDir = __DIR__.'/../../../../../vendor'; | |
echo realpath($vendorDir); | |
require_once $vendorDir.'/symfony/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'; | |
use Symfony\Component\ClassLoader\UniversalClassLoader; | |
$loader = new UniversalClassLoader(); |
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
{ | |
"name": "my/custom-name", | |
"autoload": { | |
"psr-0": { "": "src/" } | |
}, | |
"repositories": [ | |
{"type": "composer", "url": "http://192.168.11.5/satis/web" }, | |
{"type" : "pear", "url": "pear.amazonwebservices.com"} | |
], | |
"require": { |
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 | |
/** | |
* Implementation of Vose's Alias Method | |
* | |
* @param array $probabilities An array of probabilities | |
* | |
* @return int | |
*/ | |
public function aliasMethod(array $probabilities) |
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 method fetches a list of servers to deploy to from the puppetmaster | |
def get_servers(system_role) | |
require 'net/https' | |
http = Net::HTTP.new("puppetmaster.hostname", 8140) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
response = http.get2("/production/facts_search/search?facts.system_role=#{system_role}", "Accept" => "yaml") | |
require 'yaml' |
OlderNewer