Category: Examples

Code, Beer, BBQ… Examples of the Awesomesauce de Mike

0

Custom File Check for Datadog Agents

One of the greatest things I’ve found about Datadog agent is it’s extensible nature.  While there are numerous OOB integrations, we often find an edge case or two that require some quick code and a custom check here and there. This is a pretty basic check that looks to see if a file exists and if it does, reports a successful check, and if not, reports a check error tagged with the particular filename.  Additionally, if the file does exist,   file.age  and  file.modified  metrics are reported back also tagged by filename.  Handy for knowing if certain files exist and how old they may be....

Linux Shell 0

Custom Shell Check for Datadog Agents

One of the greatest things I’ve found about Datadog agent is it’s extensible nature.  While there are numerous OOB integrations, we often find an edge case or two that require some quick code and a custom check here and there. This is one that had previously been put up in one of the repos but I found that as the agent had updated, this check to run shell commands and retrieve metrics relied on some code that was included with the agent that changed over some revisions. So… I re-wrote this to operate as a standalone. This check allows you to run...

1

API Modeling and Design with Hypermedia

I’d like to share a presentation I’ve created on API Modeling and Design created for the TRI-REST API Meet Up in my role as a Principle Consultant for CA Technologies API Management team.  In this presentation I explore the concepts of adding contextual and actionable information to APIs through Hypermedia types including JSON-LD, HAL, and Collection+JSON. I will also be giving this presentation October 6th, 2015 at the DC Web API Meet Up should you like to attend.  There’s typically pizza and tasty adult beverages for those of you who are able to join! A very special thanks goes out to my friends...

1

WordPress Optimization: Installing and Configuring WordPress

Welcome to part 5 of 8 in my series on Kick-Ass WordPress Optimization!  If you’re here, you’ve probably just completed setting up your server and DNS to host your website on your very own Digital Ocean droplet.  Now we’re going to get down to business and install your database and your WordPress installation! WordPress Optimization: Installation This section on Installing and Configuring WordPress will consist of the following topics: Installing MySQL and Configuring Your Database Actually Installing MySQL Creating a Database Creating a User Granting your User Permission to Use Your Database Tuning MySQL for WordPress Installing and Configuring WordPress Downloading...

1

WordPress Optimization: Configuring CloudFlare as Your DNS Provider

Welcome to Part 4 of 8 on configuring CloudFlare as your DNS provider as part of my series on Kick Ass WordPress Optimization.  If you’re here you’ve either already set up your web server or you host your WordPress elsewhere. What is CloudFlare you ask? Well, the general overview is this: CloudFlare protects and accelerates any website online. Once your website is a part of the CloudFlare community, its web traffic is routed through our intelligent global network. We automatically optimize the delivery of your web pages so your visitors get the fastest page load times and best performance. We also block...

2

Kick-Ass WordPress Optimization

So you want to know about WordPress Optimization? Well I’ve scoured the web (and continue to do so frequently) for ways to optimize the various WordPress blogs that I run.  While I can’t claim to be the source of all knowledge on this topic, I can tell you what has worked well for me and how I run all of my blogs (some have seen upwards of 60K visits in a day!) on a single server and don’t lose a second of sleep over it. I’ll be splitting this post into several parts mostly because I just can’t bring myself...

Varnish 0

Redirecting Bad Referers with Varnish

I hate all that crap in my referrals in my analytics software!  So finally I got pissed and updated my Varnish Cache .vcl to show those jerks… well… something less than pleasant! Check it out (also note this is VCL 4.0): sub bad_referrals { # Just add the text in the referring domain you want to match, and voila! if ( req.http.referer ~ “hulfingtonpost” || req.http.referer ~ “forum.topic57969834.darodar” || req.http.referer ~ “ilovevitaly” || req.http.referer ~ “priceg” || req.http.referer ~ “blackhatworth.com” ) { set req.http.host = “www.ihateyousomuchomgroflcats.com”; return(synth(750, “All your referer are belong to us.”)); } } sub vcl_recv { #...

0

Deploying WordPress over Nginx and PHP-FPM

I found these great advanced examples of deploying nginx, PHP5, and MySQL/MariaDB from scratch including: – Installing Nginx from package repository or compiling it from scratch; – Installing php5, php-mysql, php-fpm and other php libraries if needed (like php-gd); – Installing MySql or Maria-DB; – And off course setting up php, nginx and mysql/mariadb. https://groggystuff.wordpress.com/2014/12/24/deploying-wordpress-over-nginx-and-php-fpm/ Tip for Beginners: For a more guided and beginner / n00b-level tutorial on this, try checking out my Kick-Ass WordPress Optimization Series that discusses everything from how to create a virtual server to how to optimize your nginx / PHP-FPM setup.

0

Tornado Error Handling

I thought I’d keep posting my interesting tidbits about Tornado development and simple helpers here.  I found the need for some custom error messages, and along with everything else, really a need for a more robust base request handler… So I wrote one!  The premise is simple: Use this handler as your base class for ALL of your handlers and voila! Simple error handling.  This particular example only handles 404, but that’s because it’s an example.  Feel free to handle any and all codes you may choose with this: # Simple Tornado base handler with error handling class BaseHandler(tornado.web.RequestHandler): def...