Skip to content

Instantly share code, notes, and snippets.

@cute
cute / wireguard_config.txt
Created September 13, 2019 14:46 — forked from diyism/wireguard_config.txt
wireguard config
$ 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 / StickyHeadersCollectionViewFlowLayout.m
Created September 20, 2022 10:06 — forked from megakode/StickyHeadersCollectionViewFlowLayout.m
A subclass of UICollectionViewFlowLayout which has UITableView style sticky headers.
// StickyHeadersCollectionViewFlowLayout
//
// A subclass of UICollectionViewFlowLayout which has UITableView style sticky headers.
//
// This code is based on Evadne Wu's code^1, with the following changes:
//
// * Fixes a crash for sections with zero items
// * Adds support for UIScrollView's contentInset
// * Adds support for UICollectionViewFlowLayout's sectionInset
//
@cute
cute / nf_check.js
Created August 24, 2022 10:13 — forked from Hyseen/nf_check.js
Netflix 解锁检测模块
/**
*
* [Panel]
* nf_check = script-name=nf_check, title="Netflix 解锁检测", content="请刷新", update-interval=1
*
* [Script]
* nf_check = type=generic, script-path=https://gist.githubusercontent.com/Hyseen/b06e911a41036ebc36acf04ddebe7b9a/raw/nf_check.js?version=1633074636264, argument=title=Netflix 解锁检测
*
* 支持使用脚本使用 argument 参数自定义配置,如:argument=key1=URLEncode(value1)&key2=URLEncode(value2),具体参数如下所示,
* title: 面板标题
@cute
cute / openssl_configure.md
Created February 21, 2022 07:54
OpenSSL configure options

Deprecated - Use LibreSSL Portable instead

OpenSSL Configure Options (1.0.1e)

Standard party line

Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...]
                 [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw]
                 [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm]

[no-dso] [no-krb5] [sctp] [386] [--prefix=DIR]

#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>

1:设置

sudo vi /etc/sysctl.conf
net.ipv4.ip_forward=1
sudo sysctl -p

2:安装

https://www.wireguard.com/install/
@cute
cute / stuns
Created April 21, 2021 01:39 — forked from zziuni/stuns
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@cute
cute / verifyReceipt.php
Created September 10, 2020 08:38 — forked from jamesstout/verifyReceipt.php
Verify iOS in-app purchase receipts
<?php
include("/var/www/vhosts/xxxxxcom/httpdocs/PHPUtils/dbConfig.php");
include("/var/www/vhosts/xxxxxcom/httpdocs/PHPUtils/DButils.php");
// verifies receipt from iOS in-app purchase
// returns:
// 0 - if params missing
// 1 - if receipt is valid
// 2 - if invalid receipt, or invalid response from verification server
// or bundle/in-app IDs are incorrect
@cute
cute / gist:25c4b233f375dae92e9997bc7a92b542
Created September 10, 2020 02:56 — forked from paulirish/gist:5558557
a brief history of detecting local storage

A timeline of the last four years of detecting good old window.localStorage.


Jan Lenhart, bless his heart contributed the first patch for support:

October 2009: 5059daa

#!name=Script - All in one . By nzw9314
#!desc=该模块为脚本合集,用于Remove Ads + unlock vip.集成: NobyDa、yichahucha、Choler、onewayticket、langkhach以及个人收集整理的脚本. 需要配置 CA 证书并启用 MitM 开关. 您可以在使用后手动将本模块禁用,以免产生不必要的MITM.如果您是YouTube会员.请添加-*.googlevideo.com到hostname,否则无法加载视频.
#!system=ios
[General]
# > 优酷 去广告
force-http-engine-hosts = %APPEND% vali.cp31.ott.cibntv.net
[Rule]
# > 京东 去启动广告
URL-REGEX,^https?:\/\/api\.m\.jd\.com\/client\.action\?functionId=start$,REJECT-TINYGIF