Posts about tips

Found - a Quicksilver alternative for Mac OSX

24 January 2015

If you are looking for an alternative for [Quicksilver](http://www.blacktree.com/), the popular OSX launcher, you might find [Found](https://itunes.apple.com/us/app/found/id527134927?mt=12) (no pun intended) a suitable replacement.

To be honest it does not seem to be quite as powerful but, if - like me - you only use Quicksilver to launch apps, then Found is a great lightweight (and beautiful) alternative.

Nginx rewrite/redirect for blog URL

24 January 2015

When i moved my blog to a [middleman](http://middlemanapp.com) system, i found that i needed to provide redirects from `/2012/01/25/some-post` to `/blog/2012/01/25/some-post`. It's a relatively simple task, though i lost some time because i missed a detail that no one usually explains.

There are articles on the web explaining how to do url rewriting in Nginx. Most of them will tell you something like this:

location /2009/ { rewrite ^(/2009/.*)$ /blog$1 break; }

In a gist, that's what you need. What they forget to mention is it will not work unless you provide the *root* in that *location* block.

Another thing you might want to do, to track eventual problems with your regular expression skills (hehe), is activate rewrite logging. It's also a good idea to inform clients that the resource moved permanently (301).

The full solution ended up being:

server { listen 80; server_name pedroassuncao.com *.pedroassuncao.com;

access_log /path/to/your/logs/nginx.access.log; error_log /path/to/your/logs/nginx.error.log;

rewrite_log on;

location /2009/ { root /path/to/your/html/; rewrite ^(/2009/.*)$ /blog$1 break; return 301; }

location / { root /path/to/your/html/; expires 24h; }

error_page 404 /404; }

A final note: When you activate `rewrite_log on;` nginx will dump all rewrite information to your *error* log as a notice. Since notice is the default it will show up. You can always make sure, by adding *notice* after the log file:

error_log /path/to/your/logs/nginx.error.log notice;

Happy nginxing :)

On using MySQL and working remotely

24 January 2015

A couple of interesting articles this morning, one about [why you should not use MySQL](http://grimoire.ca/mysql/choose-something-else) (i particularly love the expression "Mysql development and administration causes brain damage, folks...") and a [rant about remote work](http://ericfarkas.com/posts/a-short-rant-about-working-remotely/) and why companies still can't see the value in it.

Displaying posts 4 - 6 of 99 in total