Skip to content

Instantly share code, notes, and snippets.

View nelsonjchen's full-sized avatar

Nelson Chen nelsonjchen

View GitHub Profile

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
@foklepoint
foklepoint / .gitlab-ci.yml
Created July 8, 2017 20:25
Build and Push images to GCP Container Registry with Gitlab CI
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
GCP_PROJECT_ID: CHANGE-TO-GCP-PROJECT-ID
IMAGE_NAME: image_id
services:
@dghubble
dghubble / kubeception.md
Last active April 24, 2024 18:29
Running QEMU/KVM and Nested Kubernetes on Bare-Metal Kubernetes
@phansch
phansch / yardoc_cheatsheet.md
Last active March 1, 2024 18:17 — forked from chetan/yardoc_cheatsheet.md
Improved YARD cheatsheet
@Garrett-R
Garrett-R / gzip_str.py
Last active March 12, 2022 10:17
Demo of how to gzip and gunzip a string in Python 3
"""How to gzip a string.
This works for Python 3.2. For 3.1-, look at the original gist (under "Revisions")
"""
import gzip
def gzip_str(string_: str) -> bytes:
return gzip.compress(string_.encode())
@guillaumevincent
guillaumevincent / README.md
Last active April 24, 2024 08:44
Windows Service with Python 3.5 and pyinstaller
@nnja
nnja / gist:9136152c163091614e70defcf3753d06
Created May 26, 2016 20:25
How to access the raw markdown source for a github wiki page
https://raw.github.com/wiki/user/repo/page.md?login=login&token=token
@lrascao
lrascao / gist:f57312ff33b799c4c0db56b10e80fe26
Created March 31, 2016 16:19
Export/Import datadog dashboards
dash_id=xxxx
api_key=xxx
app_key=xxx
# 1. export
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json
# 2. edit dash.json
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level
#!/bin/vbash
# If IPv6 is working - exit.
/bin/ping6 -c 2 -n google.com > /dev/null
if [ $? == 0 ]; then
echo "IPv6 working."
exit 0;
fi
# If we have no working IPv4 connection - exit.
@cucmberium
cucmberium / gist:8ca7f4a5c5ea5a8b6590
Last active May 11, 2019 16:40
Twitter poll api

twitterの投票

コード

var status = await tokens.Statuses.ShowAsync(id => 696716686381027328, include_cards => true, cards_platform => "Android-12");

https://api.twitter.com/1.1/statuses/show.json?id=696716686381027328&include_cards=true&cards_platform=Android-12

Twitter for AndroidのCK/CS