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
| [program:gunicorn-graphite] | |
| command=/usr/local/bin/gunicorn_django -u www-data -g www-data -b 127.0.0.1:8080 --log-file=/opt/graphite/storage/log/webapp/gunicorn.log /opt/graphite/webapp/graphite/settings.py | |
| process_name=%(program_name)s | |
| autostart=true | |
| autorestart=true | |
| stopsignal=QUIT | |
| user=www-data | |
| [program:carbon-cache] | |
| command=python /opt/graphite/bin/carbon-cache.py --debug start |
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
| worker_processes 1; | |
| user nobody nogroup; | |
| pid /var/run/nginx.pid; | |
| error_log /var/log/nginx/error.log; | |
| events { | |
| worker_connections 64; | |
| } |
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 | |
| # node.js using PPA (for statsd) | |
| sudo apt-get install python-software-properties | |
| sudo apt-add-repository ppa:chris-lea/node.js | |
| sudo apt-get update | |
| sudo apt-get install nodejs npm | |
| # Install git to get statsd | |
| sudo apt-get install git |
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
| var RTBkit = require('./build/x86_64/bin/rtb.node'); | |
| var services = require('./build/x86_64/bin/services.node'); | |
| var zookeeperUri = "localhost:2181"; // must point to same Zookeeper as routers | |
| var services = new services.ServiceProxies(); | |
| services.useZookeeper(zookeeperUri); | |
| services.logToCarbon('localhost:2003'); | |
| var agent = new RTBkit.BiddingAgent("myAgent", services); |
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
| # graphite-web install is hardcoded in setup.cfg to /opt/graphite | |
| sudo mkdir /opt/graphite | |
| sudo chown brad.users /opt/graphite | |
| # run under python2.7 virtualenv | |
| virtualenv --python=python2.7 ~/ve/graphite | |
| source ~/ve/graphite/bin/activate | |
| # install the necessary python packages (simplejson is for flot graphs) | |
| pip install graphite-web carbon whisper django django-tagging uwsgi simplejson |
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
| - (void)fillProfile | |
| { | |
| RevMobAds *revmob = [RevMobAds session]; | |
| [[FBRequest requestForGraphPath:@"me?fields=id,gender,age_range,birthday"] startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { | |
| if (error == nil) { | |
| NSString *gender = [result objectForKey:@"gender"]; | |
| if (gender != nil) | |
| revmob.userGender = [gender isEqualToString:@"male"] ? RevMobUserGenderMale : RevMobUserGenderFemale; | |
| NSNumber *minAge = [[result objectForKey:@"age_range"] objectForKey:@"min"]; |
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 | |
| function gs_adreq($adreq) { | |
| // Required variable checking | |
| if(! array_key_exists('site_id', $adreq) || | |
| ! array_key_exists('HTTP_USER_AGENT', $_SERVER)) { | |
| return 'no site id or user agent'; | |
| } | |
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
| /** Class: Strophe.WebSocket | |
| * XMPP Connection manager. | |
| * | |
| * Thie class is the main part of Strophe. It manages a BOSH connection | |
| * to an XMPP server and dispatches events to the user callbacks as | |
| * data arrives. It supports SASL PLAIN, SASL DIGEST-MD5, and legacy | |
| * authentication. | |
| * | |
| * After creating a Strophe.Connection object, the user will typically | |
| * call connect() with a user supplied callback to handle connection level |