Skip to content

Instantly share code, notes, and snippets.

@ogrrd
ogrrd / dnsmasq OS X.md
Last active October 30, 2024 18:37
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@DonRichards
DonRichards / Gmail_Delete_Old_Emails.md
Created October 7, 2016 13:15
Gmail: Delete old Emails with specific label

How to delete old emails in Gmail

This script will delete emails old than 30 days with a specified label.

Focussing on emails that are from a mailing list I signed up for. I used Gmails filters to move specific email to a label called "Mailing List". You can set the label to "inbox" if you'd like but this would delete everything in your inbox older than 30 days.

Move emails to a "Mailing List" label

To protect your inbox I suggest moving emails you know are safe to delete to a new label.

  • From your inbox click the checkbox next to the email > More > "Filter Messages Like this"
  • Select how this filter selects the email (either From, Subject, To, etc)

Introduction

Sometimes you may want to use a DNS server for specific domain requests and another DNS server for all other requests. This is helpful, for instance, when connected to a VPN. For hosts behind that VPN you want to use the VPN's DNS server but all other hosts you want to use Google's public DNS. This is called "DNS splitting."

Here, we run dnsmasq as a background service on macOS. The dnsmasq configuration described below implements DNS splitting.

Install

brew install dnsmasq