I hereby claim:
- I am ryanmagnusson on github.
- I am ryanmagnusson (https://keybase.io/ryanmagnusson) on keybase.
- I have a public key whose fingerprint is 4671 A7D5 B167 918E 426B D68D 8126 4927 6806 C99B
To claim this, I am signing this object:
{ | |
"type" : "record", | |
"name" : "geolocation", | |
"namespace" : "svds.trains", | |
"fields" : [ { | |
"name" : "type", | |
"type" : [ "null", "string" ], | |
"default" : null | |
}, { | |
"name" : "coordinates", |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
# OSX for Hackers (Mavericks/Yosemite) | |
# | |
# Source: https://gist.github.com/brandonb927/3195465 | |
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Ask for the administrator password upfront |
# Local Dates: | |
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt | |
# ISO Dates: | |
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt |
I hereby claim:
To claim this, I am signing this object:
# Install `dnsmasq` and configure for *.dev domains | |
$ brew install dnsmasq | |
$ vim /usr/local/etc/dnsmasq.conf | |
# Reload configuration and clear cache | |
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist | |
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist | |
$ dscacheutil -flushcache |
To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.
Via brew or other method
In order to work on every connection and on any TLD, dnsmasq
needs to be the first DNS resolver receving the query.
And since dnsmasq
is a local process, all DNS queries need to go to 127.0.0.1
On macOS, /etc/resolv.conf
is automaticaly created, depending on a variety of things (network settings, etc), so it cannot be edited.
from typing import Union, Optional, List, Dict, Set | |
from enum import Enum | |
from os import walk | |
from os.path import realpath, join, isfile, isdir, basename, getsize | |
from hashlib import md5,sha256 | |
from argparse import ArgumentParser | |
from json import loads as unpickle, dumps as pickle | |
import sys |
#!/usr/bin/python | |
# As written, this requires the following: | |
# - OS X 10.6+ (may not work in 10.10, haven't tested) | |
# - python 2.6 or 2.7 (for collections.namedtuple usage, should be fine as default python in 10.6 is 2.6) | |
# - pyObjC (as such, recommended to be used with native OS X python install) | |
# Only tested and confirmed to work against 10.9.5 | |
# Run with root |