Skip to content

Instantly share code, notes, and snippets.

View blueset's full-sized avatar

Eana Hufwe blueset

View GitHub Profile
@blueset
blueset / kagami3.py
Created September 10, 2017 07:45
Utsushidasu Kagami ver 3
import telegram
import telegram.ext
import re
# Utsushidasu Kagami Bot v3
# With sticker removal and off-topic transfer.
# License: MIT
"""
Copyright 2017 Eana Hufwe
@blueset
blueset / README.md
Last active May 14, 2017 06:28
COMP20007 Assignment 2: 2017 Sem 1 — Auto Test Script

Hash table assignment auto test script

This script generates random commands based on the method provided by cmdgen.c, feeds it to the program and verify automatically. All table prints for stage 1, 2, 3 should follow the format provided in the template. For stage 4, the template should follow the merged format of previous stages.

This script tests:

  • Result of insertion
  • Result of query
  • Availablity, preciseness, uniqueness of keys in the printed table
@blueset
blueset / tcdrop.sh
Last active April 17, 2017 05:23
TC netem Drop packets from 32000 to 60000
modprobe sch_netem
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1: prio priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
tc qdisc add dev eth0 parent 1:2 handle 20: netem loss 80% 20%
# tc filter add dev eth0 parent 1:0 protocol ip u32 match ip protocol 17 0xff match ip sport 32768 0xe000 flowid 1:2
tc filter add dev eth0 parent 1:0 protocol ip prio 1 basic match "cmp(u16 at 0 layer transport gt 31999) and cmp(u16 at 0 layer transport lt 60001) and u32(u8 0x11 0xff at 0x9)" flowid 1:2
tc qdisc ls
tc -s qdisc show dev eth0
@blueset
blueset / telegram-zh.scpt
Last active September 6, 2018 10:39
Telegram Swift Native load language file
-- Telegram Native Swift 汉化脚本
-- 制作:Eana Hufwe
set zh_cn to "简体中文语言文件,来自 @zh_CN 的 GitHub Repo"
set zh_tw to "正體中文化文件(台灣),尚未收录"
set zh_hk to "繁體中文化文件(香港),尚未收录"
set tlocal to "本地语言文件"
set iinput to (choose file with prompt "选择您的 Telegram Native Swift 程序。" of type {"app"} default location "Applications") as string
set tgpath to POSIX path of iinput
@blueset
blueset / README.md
Last active June 6, 2019 23:21
big_text_bot: Pure text sticker Telegram inline bot.
@blueset
blueset / README.md
Created January 31, 2017 12:50
BankComm AUD/CNY Exch Offer Monitor
@blueset
blueset / README.md
Last active May 14, 2019 15:49
Filter all telegram stickers messages in groups for 60 seconds.
  1. Clone https://github.com/vysheng/tg/, and install all necessary dependencies
  2. Apply documents.patch, then ./configure && make
  3. pip3 install pytg
  4. Modify main.py and change tgdir to the correct path.
  5. Log in your tg-cli
  6. nohup ./bin/telegram-cli --json -R -W -P 4458 --permanent-peer-ids --permanent-peer-ids > /dev/null &
  7. nohup python3 kagami.py > /dev/null &
@blueset
blueset / lyricproc.py
Last active January 7, 2017 11:43
The Making of: Lyricova Screensaver v2
import json
import re
from terminaltables import SingleTable
from collections import Counter
f = open("GY_posts.json").read()
data = json.loads(f)
def lang(s):
if re.match(r".*[ぁ-ヿ].*", s):
@blueset
blueset / Netease_LRC.py
Last active May 11, 2023 12:08
Netease LRC Downloader
import requests
import argparse
import os
import re
import json
import mutagen
import base64
from mutagen import easyid3
import sys
from Crypto.Cipher import AES
@blueset
blueset / README.md
Last active October 21, 2022 02:56
Download/Print StuDocu.com documents without watermark

Usage

Add StuDocu Extracter to your Browser favorites, and click on it after you open the StuDocu document.

How it works

javascript:(function(){var a = "", x = document.getElementsByTagName("svg"); for(var i = 0; i < x.length; i++){a += x[i].outerHTML;} document.getElementsByTagName("body")[0].innerHTML = a;var a = document.getElementsByTagName("svg");for (var i = 0; i < a.length; i++){a[i].style.width="99.8%";a[i].style.height="auto";a[i].style.position="inherit";a[i].style.display="block";a[i].style.boxShadow="0 3px 3px rgba(0,0,0,0.3)";a