- 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
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
/usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
/** | |
* 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 ) ]; |
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. |
/* 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); | |
} |
#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; |
/* 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 |
#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> |
'use strict'; | |
const crypto = require('crypto'); | |
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bytes (32 characters) | |
const IV_LENGTH = 16; // For AES, this is always 16 | |
function encrypt(text) { | |
let iv = crypto.randomBytes(IV_LENGTH); | |
let cipher = crypto.createCipheriv('aes-256-cbc', new Buffer(ENCRYPTION_KEY), iv); |