Skip to content

Instantly share code, notes, and snippets.

Guangming Li cute

Block or report user

Report or block cute

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cute
cute / ssl_server_nonblock.c
Created Nov 28, 2019 — forked from darrenjs/ssl_server_nonblock.c
OpenSSL example using memory BIO with non-blocking socket IO
View ssl_server_nonblock.c
/*
This file had now been added to the git repo
https://github.com/darrenjs/openssl_examples
... which also includes a non blocking client example.
-------------------------------------------------------------------------------
ssl_server_nonblock.c -- Copyright 2017 Darren Smith -- MIT license
View main.c
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <netinet/tcp.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
int main(int argc, char **argv) {
int s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
@cute
cute / osx-openssh-portable.md
Created Sep 27, 2019 — forked from surjikal/osx-openssh-portable.md
Compile OpenSSH Portable on OSX
View osx-openssh-portable.md
brew install openssl

git clone git://anongit.mindrot.org/openssh.git
cd openssh

# ./configure script does not exist, so we have to build it
autoreconf

mkdir dist
View wireguard_config.txt
$ sudo apt-get install linux-headers-$(uname -r)
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
$ sudo modprobe wireguard
$ sudo mkdir /etc/wireguard
$ (umask 077 && printf "[Interface]\nPrivateKey = " | sudo tee /etc/wireguard/wg0.conf > /dev/null)
$ wg genkey | sudo tee -a /etc/wireguard/wg0.conf | wg pubkey | sudo tee /etc/wireguard/publickey
$ sudo nano /etc/wireguard/wg0.conf
@cute
cute / nginx.conf
Created Aug 1, 2019 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
View nginx.conf
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@cute
cute / Apple_mobile_device_types.txt
Created Jun 19, 2019 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
View Apple_mobile_device_types.txt
i386 : iPhone Simulator
x86_64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
iPhone5,1 : iPhone 5 (GSM)
@cute
cute / filer.js
Last active Aug 8, 2019
weibo intl launch screen ad filter
View filer.js
/*
* weibo intl launch screen ad filter
* @author Li Guangming
*
* add rule: DOMAIN,weibointl.api.weibo.com,DIRECT,script-filter
*
*/
function scriptFilterExecute(args) {
if (args.url.indexOf('get_coopen_ads') > 0) {
@cute
cute / openssl_commands.md
Created May 31, 2019 — forked from p3t3r67x0/openssl_commands.md
Some list of openssl commands for check and verify your keys
View openssl_commands.md

openssl

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@cute
cute / mime.txt
Created May 29, 2019
MIME types and file extensions
View mime.txt
application/pkcs8 .p8 .key
application/pkcs10 .p10 .csr
application/pkix-cert .cer
application/pkix-crl .crl
application/pkcs7-mime .p7c
application/x-x509-ca-cert .crt .der
application/x-x509-user-cert .crt
application/x-pkcs7-crl .crl
@cute
cute / JavaScriptCore+fetch.swift
Created Apr 26, 2019 — forked from yycking/JavaScriptCore+fetch.swift
add fetch, console.log and Promise.then/catch to JavaScriptCore on iOS/Mac
View JavaScriptCore+fetch.swift
import JavaScriptCore
extension JSContext {
subscript(key: String) -> Any {
get {
return self.objectForKeyedSubscript(key)
}
set{
self.setObject(newValue, forKeyedSubscript: key as NSCopying & NSObjectProtocol)
}
You can’t perform that action at this time.