1:设置
sudo vi /etc/sysctl.conf
net.ipv4.ip_forward=1
sudo sysctl -p
2:安装
https://www.wireguard.com/install/
#include <sys/types.h> | |
#include <sys/ioctl.h> | |
#include <sys/socket.h> | |
#include <sys/sys_domain.h> | |
#include <sys/kern_control.h> | |
#include <net/if_utun.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <syslog.h> |
#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> |
NSString *const PSPDFApplicationDidReceiveMemoryWarningNotification = @"PSPDFApplicationDidReceiveMemoryWarningNotification"; | |
// Test with sudo memory_pressure -l critical. Don't forget to re-set afterwards! | |
__attribute__((constructor)) static void PSPDFInstallLowMemoryNotificationWarningMac(void) { | |
static dispatch_source_t source; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, 0, DISPATCH_MEMORYPRESSURE_WARN|DISPATCH_MEMORYPRESSURE_CRITICAL, dispatch_get_main_queue()); | |
dispatch_source_set_event_handler(source, ^{ | |
dispatch_source_memorypressure_flags_t pressureLevel = dispatch_source_get_data(source); |
// For more documentation and a newer version, | |
// check out the full repo: https://github.com/kevincennis/TinyMusic | |
[peername] | |
proto = nacltai | |
proto_publickey = LOCAL_PUBKEY | |
proto_privatekey = REMOTE_PRIKEY | |
local = tuntap | |
local_interface = tunnel | |
local_tunmode = 1 | |
peer = udp | |
peer_localaddr = REMOTE_IP | |
peer_localport = 8000 |
{ | |
"name": "libsodium", | |
"version": "1.0.16", | |
"license": "ISC license", | |
"homepage": "https://github.com/jedisct1/libsodium", | |
"authors": { | |
"Frank Dennis": "j@pureftpd.org" | |
}, | |
"summary": "Sodium is a portable, cross-compilable, installable, packageable, API-compatible version of NaCl.", | |
"source": { |
alert(1) |
#!/bin/bash | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
done | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
echo $DIR |
1:设置
sudo vi /etc/sysctl.conf
net.ipv4.ip_forward=1
sudo sysctl -p
2:安装
https://www.wireguard.com/install/
# Generating throwaway QR codes from the command line for shunting URLS to mobile devices | |
brew install qrencode | |
qrencode -o - http://www.google.com | open -f -a preview |