- install dnsmasq
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
- edit
/usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add two bits together and get resulting bits | |
| * | |
| * @param {Number} a bit a | |
| * @param {Number} b bit b | |
| * @returns {Array<Number, Number>} Carry and sum as a result of addition | |
| */ | |
| function addBits(a, b){ | |
| return [ +( a && b ), +( a !== b ) ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| page ,132 | |
| title memcpy - Copy source memory bytes to destination | |
| ;*** | |
| ;memcpy.asm - contains memcpy and memmove routines | |
| ; | |
| ; Copyright (c) Microsoft Corporation. All rights reserved. | |
| ; | |
| ;Purpose: | |
| ; memcpy() copies a source memory buffer to a destination buffer. | |
| ; Overlapping buffers are not treated specially, so propogation may occur. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* chacha20 - 256 bits */ | |
| // Written in 2014 by Devi Mandiri. Public domain. | |
| // | |
| // Implementation derived from chacha-ref.c version 20080118 | |
| // See for details: http://cr.yp.to/chacha/chacha-20080128.pdf | |
| function U8TO32_LE(x, i) { | |
| return x[i] | (x[i+1]<<8) | (x[i+2]<<16) | (x[i+3]<<24); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <arpa/inet.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <sys/socket.h> | |
| #include <unistd.h> | |
| int main() { | |
| const char* server_name = "localhost"; | |
| const int server_port = 8877; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Include the sbrk function */ | |
| #include <unistd.h> | |
| int has_initialized = 0; | |
| void *managed_memory_start; | |
| void *last_valid_address; | |
| void malloc_init() { /* grab the last valid address from the OS*/ | |
| last_valid_address = sbrk(0); | |
| /* we don't have any memory to manage yet, so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <sys/socket.h> | |
| #include <sys/un.h> | |
| #include <sys/event.h> | |
| #include <netdb.h> | |
| #include <assert.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #include <stdio.h> | |
| #include <errno.h> |