Multiple network bonds in Debian 9 Stretch

If you try to configure more than one network bond in Debian 9 Stretch you will get errors when trying to bring up the second bond – this is due to the fact that only one bond is configured by default. In order to support more than one bond you need to make the following change:

Edit /etc/modprobe.d/bonding.conf and add the following:

options bonding max_bonds=2

… set the number to number of bonds you require.

CloudFront CORS with Custom Origin

Modern browsers respect Cross Origin Resource Sharing which means they won’t load web fonts (.woff, .ttf, etc.) from a CloudFront distribution.

If you are using a custom origin (AKA your website) for CloudFront you need to do the following:

1. Send the header Access-Control-Allow-Origin: * when serving up web fonts on your server.

Example for Apache (in .htaccess):

 # Set CORS headers so CloudFront will forward them
 <FilesMatch ".(eot|ttf|otf|woff|svg)">
 Header set Access-Control-Allow-Origin "*"
 </FilesMatch>

2. Edit your CloudFront distribution Behavior to Forward Headers and add Origin to the whitelist. I know this doesn’t make a ton of sense but that’s how AWS set it up (source).

 

 

3. Invalidate your cache from the AWS console or just wait until CloudFront refreshes its cache.

Debug logging chef in Vagrant

Recently I wanted to enable debug level logging of chef-solo runs in a vagrant box. As it turns out there are two ways to do this and both appear to be undocumented:

 Vagrant.configure("2") do |config|
    # ...
    config.vm.provision :chef_solo do |chef|
      chef.arguments = '-l debug'
      # ...
    end
 end
 Vagrant.configure("2") do |config|
    # ...
    config.vm.provision :chef_solo do |chef|
      chef.log_level = :debug
      # ...
    end
 end

Sources: http://stackoverflow.com/a/18778690https://coderwall.com/p/covmpg