Blocking trackers via /etc/hosts

by

These are some of the entries I keep in my /etc/hosts file. Feel free to borrow. 127.0.0.1 facebook.com 127.0.0.1 fbcdn.com 127.0.0.1 www.facebook.com 127.0.0.1 www.google-analytics.com 127.0.0.1 ssl.google-analytics.com 127.0.0.1 www.google.com 127.0.0.1 google.com 127.0.0.1 www.google-analytics.com 127.0.0.1 google.com 127.0.0.1 plus.google.com 127.0.0.1 play.google.com 127.0.0.1 googletagservices.com 127.0.0.1 googletagmanager.com 127.0.0.1 safebrowsing.google.com 127.0.0.1 sb.l.google.com 127.0.0.1 clients1.google.com 127.0.0.1 clients.google.com 127.0.0.1 clients.l.google.com 127.0.0.1 safebrowsing-cache.google.com 127.0.0.1 support.google.com 127.0.0.1 fonts.googleapis.com 127.0.0.1 ajax.googleapis.com 127.0.0.1 apis.google.com 127.0.0.1 accounts.google.com 127.0.0.1 google-public-dns-a.google.com 127.0.0.1 ssl.gstatic.com 127.0.0.1 www.gstatic.com 127.0.0.1 csi.gstatic.com 127.0.0.1 pagead2.googlesyndication.com 127.0.0.1 partner.googleadservices.com 127.0.0.1... more


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

Installing databases as services with Homebrew on a Mac

by

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

by

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

by

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