Let Nginx handle browserconfig.xml 404 errors with this inline config
If you find lots of 404 errors for browserconfig.xml files in your log files then this little trick might help. Since Windows 8 Microsofts IE requests this file from the site root to configure the desktop tiles in Windows 8.
If you just want to get rid of those 404s you can serve an empty browserconfig.xml inline from your Nginx config file:Read more…
Serve robots.txt inline in Nginx
To quickly serve a robots.txt from Nginx without actually having access to the physical file you can define the content of the robots.txt file in the Nginx .conf file.
Allow access to all User-agents:
Disallow access to every User-agent:Read more…
Create an EC2 instance-store AMI from a running Ubuntu instance
Since Amazon started offering EBS instances the classic instance-store images have gotten little love. But when you want to spawn lots and lots of instances a simple instance-store AMI is more flexible and cheaper.
The following steps let you create an instance-store AMI from a running Ubuntu 14.04 LTS instance.
Setting up your current instance
Start an instance-store Ubuntu image. You can findRead more…
Storing tree structures in a database is simple. Add a column for the
parentid and everything makes sense.
Our example data:
Which shouldRead more…
Mac OS X and Google Chrome: Set printer defaults from color to black and white / grayscale
Google Chrome on Mac OS X does not use the printer defaults set in the system.
To set the defaults for the Chrome print interface, for example to set the default color mode to black and white / grayscale, follow these steps:
Enable Web-Access to the Unix Printing System by typing
cupsctl WebInterface=yesin a terminal window.
Open http://localhost:631 in a browser.
Click on Printers:
Click on t
MS-SQL: List table sizes and row count
Need to list all table sizes and their row count of a single database in MS-SQL Server? This neat script works on MS-SQL 2008 - please comment if it works on other versions.
Just run this in the context of a database.
Credits go to this site for listing the script.
INSERT INTO @table SELECT b.name + '.'+ a.nameRead more…
How to prevent the creation of .DS_Store files on network drives
When working on network drives with Mac OS X every Mac user will by default create .DS_Store files. Those files are used by OS X to store custom attributes like icon positions. For more info on .DS_Store files read this article.
To prevent those files from being created:
- Open up the Terminal
- Run the following command
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Set AWS IAM Permissions for s3cmd backup to a single bucket
Our Linux machines use a S3 bucket to backup some files every night.
The machines only need write access (PutObject) to a single bucket on S3.
AWS Identity and Access Management (IAM) allows to define this permission on a single bucket. However to configure s3cmd correctly and run a successful test there is a little trick, otherwise the final configuration test of s3cmd shows this error: