Code snippets to accompany How-To: Tail Apache logs to Ubuntu Notifications on http://insidethe.agency/
Original Article: http://insidethe.agency/blog/how-to-tail-apache-logs-to-ubuntu-notifications
| services: | |
| mink.context: | |
| class: 'Behat\MinkExtension\Context\MinkContext' | |
| calls: | |
| - [setMink, ['@__behat__.mink']] | |
| tags: | |
| - { name: fob.context_service } | |
| dashboard.features_context.profiler_context: | |
| class: DashboardBundle\Features\Context\ProfilerContext |
| /* | |
| * Track outbound links | |
| */ | |
| $(function() { | |
| // Track outbound links | |
| if(typeof(ga) !== 'undefined') { | |
| // Track outbound links | |
| $('a[href*=http]').on('click', function(e) { | |
| <?php | |
| $ipFile = '/tmp/ip.txt'; | |
| $username = 'user'; | |
| $password = 'pass'; | |
| $hostname = 'test.test.com'; | |
| $ip = ''; | |
| $ip = @file_get_contents('http://wtfismyip.com/text'); |
| # Test the database connection using a simple query (no database tables required) | |
| cd /data/projects/insidethe.agency | |
| php app/console doctrine:query:sql "SELECT NOW()"; |
| <VirtualHost *:80> | |
| DocumentRoot /data/sites/i/insidetheagency.chris.laptop.internal/web | |
| ServerName insidetheagency.chris.laptop.internal | |
| ServerAlias insidetheagencydev.localtunnel.me | |
| ErrorLog log/insidetheagency.chris.laptop.internal-error.log | |
| CustomLog log/insidetheagency.chris.laptop.internal-access.log combined | |
| <Directory /data/sites/i/insidetheagency.chris.laptop.internal/web> |
| <?php | |
| // Check if link absolute starts with (http, https or //) | |
| preg_match('/^(http(s)?:)?\/\//', $link, $matches); |
| <?php | |
| function generateLabelContent($includeHref = true) { | |
| if($includeHref) { | |
| $content = '<a href="http://www.google.co.uk">Google</a>'; | |
| } else { | |
| $content = "Google"; | |
| } |
| $(function() { | |
| window.disqus_config = function() { | |
| this.callbacks.onNewComment = [function(comment) { | |
| // Comment parameter has 2 values | |
| // id = The id of the disqus comment | |
| // text = the comment message | |
| data = comment; | |
| // Add in our article ID parameter so we can locate the article by ID |
Code snippets to accompany How-To: Tail Apache logs to Ubuntu Notifications on http://insidethe.agency/
Original Article: http://insidethe.agency/blog/how-to-tail-apache-logs-to-ubuntu-notifications