A few weeks ago, I was at work and started to notice that occasionally I’d open a new tab or website, and it wouldn’t load (or would load broken), but my browser normally auto-retried or I F5’d, and the problem went away. It didn’t happen too often, so I ignored it for a couple days, […]
DevOps
How do S3 permissions work?
Amazon S3 is a great (and cheap) content storage and delivery service, used by millions of websites and applications around the world. However, their permissions system can be opaque to new users, and difficult to understand, due to the variety of ways you can set permissions, and inconsistent terminology in different UIs. This post aims […]
Basics Of Scaling: Cache Everything
I do a lot of work on websites that needs to scale fairly well, but I tend to use that mentality for every project. Part of scaling is performance, and the better your app performs (e.g. the more requests per second it can handle) the cheaper it is. One very easy way to improve your […]
OpsView RESTful API Tips
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.
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, 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 […]