Skip to content

Instantly share code, notes, and snippets.

View recolic's full-sized avatar
🏠
Working from home

Recolic recolic

🏠
Working from home
View GitHub Profile
@recolic
recolic / README.md
Last active May 21, 2019 04:09
智享校园洗澡工具dns劫持
@recolic
recolic / rlib.min.hpp
Created May 14, 2019 01:12
C++11 minified rlib. usually used while writing ALG solutions.
/*
*
* string.hpp: string process utility.
* Recolic Keghart <root@recolic.net>
* MIT License
*
* Minified version: works on C++11.
*
*/
@recolic
recolic / fuckboc.user.js
Last active March 7, 2019 05:15
[tampermonkey] SB中国银行网银购汇不用等30秒看sb购汇申请书。一键安装:https://openuserjs.org/users/recolic/scripts
// ==UserScript==
// @name FUCK BankOfChina By USD from CNY 30 seconds wait.
// @namespace https://recolic.net/
// @version 0.1
// @description If you buy other concurrency on www.boc.cn, you have to wait 30 seconds to read a document. I fucked it.
// @author Recolic Keghart <root@recolic.net>
// @match https://ebsnew.boc.cn/boc15/welcome.html*
// @grant none
// ==/UserScript==
@recolic
recolic / py3in2.py
Created February 10, 2019 00:00
Run python3 in a python2 code.
import tempfile, subprocess
def py3in2(func_text, arg):
# escape char in arg should be escaped twice.
payload = ['#/usr/bin/env python3', 'def _func(arg):']
for line in func_text.split('\n'):
payload.append(' ' + line)
payload.append('with open("/dev/fd/1", "w") as f:\n f.write(_func(\''+arg+'\'))\n')
payload = '\n'.join(payload)
@recolic
recolic / forked_udpfwd.cc
Created December 14, 2018 04:18
naive udp forwarder with naive encryption. copied from an unknown guy. the code style is extremely horrible but it's good enough to fuck GFW.
#include<stdio.h>
#include<string.h>
#include<sys/socket.h>
#include<arpa/inet.h>
#include<stdlib.h>
#include<getopt.h>
#include <unistd.h>
#include<errno.h>
#include <fcntl.h>
@recolic
recolic / README.md
Created October 20, 2018 05:07
Download public shared google drive large file with wget. by vladalive

I've used @beliys code and made a bash command.

Setup: Add this code to your ~/.bash_aliases file.

function gdrive_download () {
  CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
  wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
  rm -rf /tmp/cookies.txt
}
@recolic
recolic / Pipfile
Last active October 6, 2018 15:04 — forked from qzed/Pipfile
Surface Book 2 / Surface Pro (2017) / Surface Laptop UART protocol proof-of-concept script.
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
crcmod = "*"
pyserial = "*"
[dev-packages]
@recolic
recolic / virtualtype.py
Created August 26, 2018 07:28
Fuck the chinese shits who prevent you from pasting password.
#!/usr/bin/env python3
# Use this script with https://recolic.net/phy and https://recolic.net/phy2
# to avoid typing fucked numbers into page by hand.
# Fuck the chinese shits who prevent you from pasting password.
# E.x. Alibaba bitch
from pykeyboard import PyKeyboard
import time
def virtual_type_array(arrToType, noWait=False):
k = PyKeyboard()
@recolic
recolic / func.drive.recolic.net
Created August 7, 2018 08:34
tinc configuration file
Port = 655
Subnet = 10.143.0.127/32
-----BEGIN RSA PUBLIC KEY-----
MIICCgKCAgEAnjwfPNIG0EfokEo+Rlk81Djhqvp/KiB/UiBQy7l+g/3SJJ8halFO
D8AWFP520Epfn5PseGRMIwti745AGEMWYRnt2JgrMAJvg6AQmiiefBiCoaRtH9su
Tpfc9JekWKGzyw7E+kbxiawqQ3z7Uq85YXzrdNKKvVzKn4iU4QNI4mymAgnqPqXn
2YCCyc4oz5CTi16VYbMFq6DECvYU74QlhQLNgahmPfXhRWKi9bBCe0lCu8UfvTpJ
CVkZzJttyK+hJU6IX0u3ilwpCrnDED5cmhOamfE0IN/kkbW7egcLsmXvPQ6MYGfD
0yn1apGU27qp7zgh7IF0arT5rNylIBo+c+is2quoKoVGNXBJlY0GJBSYmA/6+Tr0
#!/bin/bash
height=$1
sleep_time=$2
[[ $height == '' ]] && echo 'Usage: ./hanoi.bash <height> [sleep_time = 0.6]' && exit 1
[[ $sleep_time == '' ]] && sleep_time=0.6
declare -a A=( $(seq 1 $height) )
declare -a B