Apache virtual host basic template

This is where I start when I have to configure an Apache server: a simple virtual host template with ssl rewrite.

<VirtualHost *:80>

    ServerName my.domain.com
    ServerAlias my.domain.com
    RewriteEngine On
    RewriteCond %{HTTPS} =off
    RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L]

<VirtualHost *:443>

    DocumentRoot "/path/to/htdocs"
    ServerName my.domain.com
    ServerAlias my.domain.com
    SSLEngine on
    SSLCertificateFile /path/to/ssl/files/ssl_certificate.crt
    SSLCertificateKeyFile /path/to/ssl/files/privatekey.pem
    SSLCertificateChainFile /path/to/ssl/files/IntermediateCA.crt
    DirectoryIndex index.html
    ErrorLog "|/path/to/bin/rotatelogs -l '/path/error_%Y-%m-%d.log' 86400"
    CustomLog "|/path/to/bin/rotatelogs -l '/path/access_%Y-%m-%d.log' 86400" common





How to create products with the least amount of complexity

A truly simple product is built around a deep understanding of the problem it’s meant to solve. This is challenging because it requires us to set aside our way of thinking and develop empathy for our users’ thought processes. When our customers ask for a feature, we need to understand why they want that feature. Getting to the real problem is key before we can figure out how to solve it. Without this understanding, we build things for the wrong reasons, which makes it difficult — or even impossible — to remove the unnecessary parts.

How to setup CrashPlan Cloud Backup on a Synology NAS

A very detailed post about setting up CrashPlan Cloud Backup on a Synology NAS running DSM 5.0

Remember, any good backup strategy follows the Backup Rule of Three.

3 copies of anything you care about - Two isn’t enough if it’s important.
2 different formats - Example: Dropbox+DVDs or Hard Drive+Memory Stick or CD+Crash Plan, or more
1 off-site backup - If the house burns down, how will you get your memories back?

Acrobat Forms - Execute javascript on document open

This is a simple trick to run a javascript code while opening an Acrobat Form. I use it very often in server side generated forms to change the required flag based on fields value.

You need to add a new document level javascript with this code.

var opened = false;

function onOpen() {

    if(!opened) {

        // Code to be executed on document open

        opened = true;



You can add a document level javascript from Advanced > Document Processing > Document JavaScripts in Acrobat 9 and from Tools > JavaScript > Document JavaScript in Acrobat 10

Remove .DS_Store Files From A Git Repository

Remove existing files from the repository:

find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch

Add the line .DS_Store to the file .gitignore, which can be found at the top level of your repository (or created if it isn’t there already). Then

git add .gitignore
git commit -m '.DS_Store banished!'

Removing orphaned users from a SQLServer database

If you are using SQLServer probably you had to restore a database from a backup and got stuck with an orphaned user that was no more associated with a login.

Microsoft provides a stored procedure to remove this orphaned user:

exec sp_revokedbaccess 'Orphaned_User_Name'

You could get an error because the user still owns a schema. To find out which schema is bound with the user you can use this query

SELECT name FROM  sys.schemas WHERE principal_id = USER_ID('Orphaned_User_Name')

And then drop the orphaned user from the schema

DROP USER Orphaned_User_Name

Welcome to iPhone 6, friend

We have spent countless hours engineering the thinnest, most powerful smartphone in the world onto which you will now put a case. We have burned untold person-years, an innumerable number of lifetimes screaming at assembly line workers to achieve perfect tolerances for you to cover with a phone glove.

One of the most satisfying industrial design elements of the iPhone 6 is the curved glass, over which your thumb will never glide once you fit upon it a furrowed hunk of dead cow.

Synchronize Sublime Text packages on multiple computers

Finally a way to synchronize Sublime packages beetween my home iMac and my work ThinkPad.