Skip to content

Instantly share code, notes, and snippets.

@cute
cute / test.js
Created December 29, 2017 07:55
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/
@cute
cute / QR-Code-Example
Created November 20, 2017 13:08 — forked from BPScott/QR-Code-Example
QR Code generation and instant preview from the command line
# 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
@cute
cute / wg_demo.go
Created October 17, 2017 09:40 — forked from rot256/wg_demo.go
Quick, very dirty, wg ping demo
package main
import (
"bytes"
"crypto/hmac"
"crypto/rand"
"encoding/base64"
"encoding/binary"
"encoding/hex"
"fmt"
@cute
cute / gencert.sh
Last active October 6, 2019 00:34
#!/bin/sh
# create self-signed server certificate:
read -p "Enter your domain [www.example.com]: " DOMAIN
echo "Create server key..."
openssl genrsa -aes256 -out $DOMAIN.key 4096
echo "Create server certificate signing request..."
@cute
cute / fix_symlinks_fmk_ios.sh
Created July 23, 2017 10:05 — forked from spawnrider/fix_symlinks_fmk_ios.sh
This script recreate corrupted Symlinks into iOS Frameworks
@cute
cute / ws-client.cpp
Created June 25, 2017 23:27 — forked from optman/ws-client.cpp
libevent websocket client test
#include <event2/bufferevent.h>
#include <event2/buffer.h>
#include <event2/event.h>
#include <event2/dns.h>
#include <arpa/inet.h>
#include <iostream>
using namespace std;
@cute
cute / NSNUll+ InternalNullExtention.m
Created June 20, 2017 10:39 — forked from cyndibaby905/NSNUll+ InternalNullExtention.m
NSNUll+ InternalNullExtention.m
#define NSNullObjects @[@"",@0,@{},@[]]
@interface NSNull (InternalNullExtention)
@end
@implementation NSNull (InternalNullExtention)

cipher:AEAD_AES_128_GCM password: 123456

[]byte{138,63,217,116,14,116,56,73,33,70,156,41,233,72,190,145,113,182,5,56,182,149,118,220,138,110,150,113,18,121,249,240,247,26,253,240,88,195,246,238,204,245,60,59,17,128,30,105,58,187,22,149,215,243,167,124,58,190,8,54,19,154,74,74,52,124,246,81,7,43,167,86,29,108,147,180,159,196,6,159,141,88,17,214,71,238,136,19,87,130,129,92,198,139,12,200,121,42,50,232,31,163,129,157,15,160,160,169,182,128,12,86,150,103,202,159,5,115,38,0,231,215,32,90,205,68,255,161,172,82,108,232,202,237,3,30,64,107,136,209,50}