Recently I’ve had the displeasure of building scripts that interact with the OpsView API, which is the only way to programmatically change settings in OpsView. The API itself seems to be quite well designed, however, it’s very poorly documented. Below are a few of the things I couldn’t figure out how to do via Google.
2013 in review
2013 was a good year for me. I got a job at REDspace, a web development company in my area that does a lot of cool an interesting work (Also, they build games and mobile apps). I’ve been working on a lot of cool projects there. My current project has taught me a great deal […]
WordPress Access Control 4
I’ve been extremely busy as of late, but I managed to find some time to update my WordPress Access Control plugin to version 4! With version 4, I’ve rewritten the Walker class that I use to remove pages from the menu if a user doesn’t have access to them. Before, I implemented a custom Walker […]
Puppet Tip: Preinstall Stage
If you have some commands that you want to run before everything else, it can be annoying to add a require statement to every resource (as Puppet doesn’t execute things in order). Luckily you can get around this using stages. stage { ‘preinstall’: before => Stage[‘main’] } class apt_get_update { file { ‘/etc/apt/sources.list’: ensure => […]
Puppet Tip: Set global exec path
Here’s a quick tip you might not know about. In Puppet, you can set a global path option for all Exec resources. This saves you from having to prefix all of your commands with the absolute path. Just throw this at the top of your file: Exec { path => [‘/usr/sbin’, ‘/usr/bin’, ‘/sbin’, ‘/bin’] } […]
Don’t use symlinks in Vagrant for config files
I’ve been building a lot of Vagrant machines lately, and I’m learning a few things to make the process easier/optimal. One of the things I recently discovered was that you should avoid using symlinks for your config files, if you’re using a provisioner like Puppet. I had gotten into the habit of just symlinking config […]
Disable sendfile when using Nginx + Vagrant
Source: http://jeremyfelt.com/code/2013/01/08/clear-nginx-cache-in-vagrant/ Scenario 1… You installed Vagrant with VirtualBox on your local machine and have a sweet nginx setup going as your development environment. You made a few changes to a CSS file and the new style is not reflecting on the page. You try saving the file again in your text editor, no go. You look at the file […]
Start SASS/Compass on Vagrant reload
I use SASS & Compass on most of my projects, as well as Vagrant. I normally have my puppet provisioning scripts start a compass watcher to compile my SASS files into CSS, but this no longer works with Vagrant 1.3.0+ as provision scripts aren’t run on vagrant up or vagrant reload (only on the first […]
Nginx SSL behind SSL terminator
Recently I ran into an issue when using Nginx behind an SSL terminator (load balancer). Both $scheme in Nginx and $_SERVER[‘HTTPS’] in PHP were incorrect, because Nginx thought it was behind HTTP. I finally figured out a fix, which is a bit hacky, but it works. In your site config, above your server block, put […]
Nginx, Varnish and optional CloudFlare: Real IPs
If you use a proxy such as Varnish or CloudFlare, your web server isn’t going to see visitor’s real IP address, it’ll see the IP of your proxy (for example, Varnish would be 127.0.0.1 if running on the same box as your web server). You can easily find instructions to fix this for Varnish or […]