Blocking trackers via /etc/hosts


These are some of the entries I keep in my /etc/hosts file. Feel free to borrow. more

Tags: trackers, hosts, facebook, google, mac, linux

Installing databases as services with Homebrew on a Mac


First steps

Update your homebrew references and install services package to run the servers in the background.

brew update
brew tap homebrew/services

Installing services

Now you can install MongoDB, Redis or MySQL. Install whatever you need depending on your setup.

brew install mongodb
brew install redis
brew install mysql

Starting services

You can then control services with syntax typically seen in service launchers.

brew services start [service]
brew services stop [service]
brew services restart [service]

Replace [service] bit with mongodb, redis, mysql or whatever service you need to run and you're done.

Some debug options

brew services list
brew services cleanup

Tags: mac, homebrew, mongo, redis, mysql, services

Checking exit code of the last process in Terminal


When setting up your tools for Continuous Integration one of the things that you will have to do is making sure you're exiting with the correct code.

An easy way to check the exit code of last process run in Terminal is simply to execute this command:

echo $?

While in most cases the exit code will be 0 (indicating successful execution of the process) this can be extremely useful for troubleshooting and ensuring your CI tool catches the errors correctly.

Tags: mac, terminal

Simulating Retina resolutions on a non-Retina Mac


If like me you have a non-Retina Mac you may want to fake a Retina resolution in order to get a larger working area.

I was searching for a simple way to achieve this for a while. Finally I found an app called RDM (Retina DisplayMenu). It simply adds an icon to the menu bar which allows you to go beyond the default resolutions. You can download RDM here (direct link).

Since this is faking it and you're still limited by the physical number of pixels you should not expect absolute clarity so it clearly isn't a good solution for playing movies or games. For development and general browsing however it is quite a handy technique. I found that on my 13" MacBook Air 1920x1200 works quite well which is a pretty nice improvement over the native 1440x900.

Tags: mac